Learn R Programming

MissMech (version 1.0.2)

Ddf: Hessian of the observed datat Multivariate Normal Log-Likelihood with Incomplete Data

Description

The Hessian of the normal-theory observed data log-likelihood function, evaluated at a given value of the mean vector and the covariance matrix, when data are incomplete. The output is a symmetric matrix with rows/columns corresponding to elements in the mean vector and lower diagonal of the covariance matrix.

Usage

Ddf(data, mu, sig)

Arguments

data
A matrix consisting of at least two columns. Values must be numerical with missing data indicated by NA.
mu
A row matrix consisting of the values of the mean at which points the Hessian of the log-likelihood is to be computed
sig
A symmetric covariance matrix at at which points the Hessian of the log-likelihood is to be computed

Value

dd
The resulting Hessian matrix
se
Negative of the inverse of the Hessian matrix

Details

While mu is a vector, it has to be input as a matrix object. See example nelow.

References

Jamshidian, M. and Bentler, P. M. (1999). ``ML estimation of mean and covariance structures with missing data using complete data routines.'' Journal of Educational and Behavioral Statistics, 24, 21-41.

Examples

Run this code
set.seed <- 50
n <- 200
p <- 4
pctmiss <- 0.2
y <- matrix(rnorm(n * p),nrow = n)
missing <- matrix(runif(n * p), nrow = n) < pctmiss
y[missing] <- NA
mu <- c(0,0,0,0)
sig <- matrix(c(1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1),4,4)
Ddf(data=y, as.matrix(mu), sig)

Run the code above in your browser using DataLab