Description Usage Arguments Details Value Author(s) See Also Examples
Calculates an approximate parameter variance-covariance matrix for the parameters. The variance-covariance parameters are transformed via a Cholesky decomposition so that the variance-covariance matrices remain positive definite. The function returns a
marssMLE
object in this TRANSFORMED form. It appends $Hessian
, $parMean
, $parSigma
in this transformed state. This is a utility function in the MARSS-package
.
1 2 | MARSShessian(MLEobj)
MARSShessian.backtrans(MLEobj.hessian, par.hessian)
|
MLEobj |
An object of class |
MLEobj.hessian |
An object of class |
par.hessian |
A vector of parameter estimates where any variance matrix elements are in the Cholesky decomposed form. |
Uses fdHess
from package nlme
to numerically estimate the Hessian matrix
(the matrix of partial 2nd derivatives of the parameter estimates). Hessian CIs are based on
the asymptotic normality of ML estimates under a large-sample approximation.
MARSShessian()
returns a transformed marssMLE
object passed in along with additional components
Hessian
, gradient
, parMean
and parSigma
computed by the MARSShessian
function.
MARSShessian.backtrans(MLEobj.hessian, par.hessian)
takes a transformed marssMLE
object (as output by MARSShessian
along with a parameter vector in transformed form and returns a parameter vector in regular (non-transformed form).
Eli Holmes, NOAA, Seattle, USA.
eli(dot)holmes(at)noaa(dot)gov
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | dat = t(harborSeal)
dat = dat[c(2,11),]
MLEobj = MARSS(dat)
#variance terms are TRANSFORMED by the Cholesky decomposition
MLEobj.hessian = MARSShessian(MLEobj)
#show the approx Hessian, again variance terms are transformed
MLEobj.hessian$Hessian
#generate a (Cholesky transformed) parameter sample using the Hessian
#this uses the rmvnorm function in the mvtnorm package
hess.params = mvtnorm::rmvnorm(1, mean=MLEobj.hessian$parMean,
sigma=MLEobj.hessian$parSigma)
#back transform so variance terms are non-transformed
MARSShessian.backtrans(MLEobj.hessian, hess.params)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.