Sensitivity analysis using Itô-Malliavin calculus and application to stochastic optimal control