MARSShessian: MARSS Parameter Variance-Covariance Matrix from the Hessian...

Description Usage Arguments Details Value Author(s) See Also Examples

Description

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.

Usage

1
2
MARSShessian(MLEobj)
MARSShessian.backtrans(MLEobj.hessian, par.hessian)

Arguments

MLEobj

An object of class marssMLE. This object must have a $par element containing MLE parameter estimates from e.g. MARSSkem.

MLEobj.hessian

An object of class marssMLE but with any variance-covariance matrices in their Cholesky decomposition form. This requires a marssMODEL with transformed fixed elements and transformed par element in the marssMLE object.

par.hessian

A vector of parameter estimates where any variance matrix elements are in the Cholesky decomposed form.

Details

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.

Value

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).

Author(s)

Eli Holmes, NOAA, Seattle, USA.

eli(dot)holmes(at)noaa(dot)gov

See Also

MARSSparamCIs marssMLE

Examples

 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)

gragusa/MARSS documentation built on May 17, 2019, 8:18 a.m.