I have a function with the form like this, $F(\beta) = ln (\int_{X\beta}^{\infty} \phi(u|0,\Sigma) du)$. Here $X, \Sigma$ are matrices. $\beta$ and $u$ are vectors. $\phi$ is the multivariate normal density function.
I need to get the second derivative of this function.
I'm poor in doing matrix calculus. But, I derive the result for the first derivative as follows,
$\frac{\partial F(\beta)}{\partial \beta} = \frac{1}{\int_{X\beta}^{\infty} \phi(u|0,\Sigma) du} \frac{\partial \phi(u|0,\Sigma)}{\partial \beta} =\frac{1}{\int_{X\beta}^{\infty} \phi(u|0,\Sigma) du} \frac{\partial \sqrt{(2\pi)^k |\Sigma|}exp(-\frac{1}{2}(X\beta)^T\Sigma^{-1}X\beta)}{\partial \beta}= \frac{1}{\int_{X\beta}^{\infty} \phi(u|0,\Sigma) du} \sqrt{(2\pi)^k |\Sigma|}exp(-\frac{1}{2}(X\beta)^T\Sigma^{-1}X\beta) \frac{\partial -\frac{1}{2} (X\beta)^T\Sigma^{-1}X\beta}{\partial \beta}= \frac{1}{\int_{X\beta}^{\infty} \phi(u|0,\Sigma) du} \sqrt{(2\pi)^k |\Sigma|}exp(-\frac{1}{2}(X\beta)^T\Sigma^{-1}X\beta) (-\frac{1}{2}X^T\Sigma^{-1}X\beta-\frac{1}{2}(X\beta)^T\Sigma^{-1}X)$
Is my first derivative correct? Can anyone show me the result for the second derivative?
Restating the problem $$\eqalign{ y &= X\beta \cr \phi(y) &= \phi_o\,\exp(-\tfrac{y^T\Sigma^{-1}y}{2}) \cr p = \exp(F) &= \int_y^\infty\phi(u)\,du \cr }$$ Since the variable $y$ only appears in the lower limit of integration, and not explicitly in the kernel inside the integral, Leibniz's rule is simply $$\eqalign{ dp &= -\phi(y)\,dy = -\phi(y)\,X\,d\beta \cr }$$ We can also calculate the differential of $p$ directly in terms of $F$, with the help of the Hadamard $(\odot)$ product
$$\eqalign{ dp &= p\odot dF = {\rm diag}(p)\,dF = P\,dF \cr }$$ Equating the two expression allows us to find the gradient wrt $\beta$ $$\eqalign{ dF &= -\phi(y)\,P^{-1}X\,d\beta\cr \frac{\partial F}{\partial\beta} &= -\phi(X\beta)\,P^{-1}X \cr &= -\phi_o\,\exp\Big(\tfrac{-\beta^TX^T\Sigma^{-1}X\beta}{2}\Big)\,{\rm diag}\big(\exp(F)\big)^{-1}X \cr\cr }$$ So that's the gradient; the Hessian will be much more complicated. Are you sure you need it?