varest estimates the uncertainty of an already-computed maximum likelihood estimate.
varest(mod, ...)# S3 method for 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(),
...
)
A list containing
The estimated variance-covariance matrix of the maximum likelihood estimator.
The maximum likelihood estimator passed in by the user.
The Hessian of the log-likelihood at the maximum likelihood estimate. Only exists when method is not mc
Optional, only exists when `store_gaussian_hessian` is TRUE.
An object of class glinv
Not used.
Either an object returned by fit.glinv or a vector of length mod$nparams
that contains the maximum likelihood estimate.
Either `analytical', `linear' or `mc'. It specifies how the covariance matrix is computed.
Arguments to pass to numDeriv::jacobian. Only used if the
user did not supply parjacs when constructing mod.
Number of threads to use.
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.
A list of additional arguments to pass to the mc method.
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:
Integer. Number of Monte Carlo iteration to run. Default is 10000.
Numeric. Size of perturbation to the parameters. Default is 0.005.
Boolean. Whether to print progress and other information or not. Default is TRUE.
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.