varest {glinvci}R Documentation

Estimate the variance-covariance matrix of the maximum likelihood estimator.

Description

varest estimates the uncertainty of an already-computed maximum likelihood estimate.

Usage

varest(mod, ...)

## S3 method for class 'glinv'
varest(
  mod,
  fitted,
  method = "analytical",
  numDerivArgs = list(method = "Richardson", method.args = list(d = 0.5, r = 3)),
  num_threads = 2L,
  store_gaussian_hessian = FALSE,
  control.mc = list(),
  ...
)

Arguments

mod

An object of class glinv

...

Not used.

fitted

Either an object returned by fit.glinv or a vector of length mod$nparams that contains the maximum likelihood estimate.

method

Either ‘analytical’, ‘linear’ or ‘mc’. It specifies how the covariance matrix is computed.

numDerivArgs

Arguments to pass to numDeriv::jacobian. Only used if the user did not supply parjacs when constructing mod.

num_threads

Number of threads to use.

store_gaussian_hessian

If TRUE and method is not mc, the returned list will contain a (usually huge) Hessian matrix gaussian_hessian with respect to the Gaussian parameters \Phi, w, V'. This option significantly increases the amount of memory the function uses, in order to store the matrix.

control.mc

A list of additional arguments to pass to the mc method.

Details

If method is analytical then the covariance matrix is estimated by inverting the negative analytically-computed Hessian at the maximum likelihood estimate; if it is mc then the estimation is done by using Spall's Monte Carlo simultaneous perturbation method; if it is linear then it is done by the "delta method", which approximates the user parameterisation with its first-order Taylor expansion.

The analytical method requires that parhess was specified when 'mod' was created. The linear method does not use the curvature of the reparameterisation and its result is sometimes unreliable; but it does not require the use of parhess. The mc method also does not need parjacs, but the it introduces an additional source complexity and random noise into the estimation; and a large number of sample may be needed.

The control.mc can have the following elements:

Nsamp

Integer. Number of Monte Carlo iteration to run. Default is 10000.

c

Numeric. Size of perturbation to the parameters. Default is 0.005.

quiet

Boolean. Whether to print progress and other information or not. Default is TRUE.

Value

A list containing

vcov

The estimated variance-covariance matrix of the maximum likelihood estimator.

mlepar

The maximum likelihood estimator passed in by the user.

hessian

The Hessian of the log-likelihood at the maximum likelihood estimate. Only exists when method is not mc

gaussian_hessian

Optional, only exists when 'store_gaussian_hessian' is TRUE.

References

Spall JC. Monte Carlo computation of the Fisher information matrix in nonstandard settings. Journal of Computational and Graphical Statistics. 2005 Dec 1;14(4):889-909.


[Package glinvci version 1.2.4 Index]