This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Hessian of negative log-likelihood function


Hessian = ecmnhess(Data,Covariance,InvCovariance,MatrixFormat)



NUMSAMPLES-by-NUMSERIES matrix of observed multivariate normal data


NUMSERIES-by-NUMSERIES matrix with covariance estimate of Data


(Optional) Inverse of covariance matrix: inv(Covariance)


(Optional) Character vector that identifies parameters included in the Hessian matrix. If MatrixFormat = [] or '', the default method full is used. The parameter choices are:

  • full — (Default) Compute full Hessian matrix.

  • meanonly — Compute only components of the Hessian matrix associated with the mean.


Hessian = ecmnhess(Data,Covariance,InvCovariance,MatrixFormat) computes a NUMPARAMS-by-NUMPARAMS Hessian matrix of the observed negative log-likelihood function based on current parameter estimates, where


if MatrixFormat = 'full' and


if MatrixFormat = 'meanonly'.

This routine is slow for NUMSERIES > 10 or NUMSAMPLES > 1000.

The data matrix has NaNs for missing observations. The multivariate normal model has


distinct parameters. Therefore, the full Hessian is a NUMPARAMS-by-NUMPARAMS matrix.

The first NUMSERIES parameters are estimates for the mean of the data in Mean and the remaining NUMSERIES*(NUMSERIES + 1)/2 parameters are estimates for the lower-triangular portion of the covariance of the data in Covariance, in row-major order.

If MatrixFormat = 'meanonly', the number of parameters is reduced to NUMPARAMS = NUMSERIES, where the Hessian is computed for the mean parameters only. In this format, the routine executes fastest.

This routine expects the inverse of the covariance matrix as an input. If you do not pass in the inverse, the routine computes it.

The equation

Stderr = (1.0/sqrt(NumSamples)) .* sqrt(diag(inv(Hessian)));

provides an approximation for the observed standard errors of estimation of the parameters.

Because of the additional uncertainties introduced by missing information, these standard errors can be larger than the estimated standard errors derived from the Fisher information matrix. To see the difference, compare to standard errors calculated from ecmnfish.

Introduced before R2006a