Is there any built in function calculating the value of a gradient of multivariate normal probability density function for a given point?
Edit: found this how to evaluate derivative of function in matlab? but that is not what I am looking for
Edit2: owkay, that’s what I’m using http://www.mathworks.co.uk/help/stats/mvnpdf.html case 3, looking for value of derivative with respect to X
Might I suggest you check The Matrix Cookbook by Peterson and Pedersen (available for free online – just google it). The analytical solution to your problem is on p39, equation 325 (2008 edition).
We didn’t even need Matlab for this one!
EDIT: As YBE implies, perhaps I should include the solution in my answer. So, let p(x) denote the multivariate Gaussian pdf, characterized by mean vector m and covariance matrix S. Then:
dp(x) / dx = -p(x) * S^(-1) * (x – m)
and
d^2p / dx dx’ = p(x) * (S^(-1) (x – m)(x – m)’ S^(-1) – S^(-1))
If you want a Matlab function, then: