is_marssMLE: Tests marssMLE object for completeness

is.marssMLER Documentation

Tests marssMLE object for completeness

Description

Tests a marssMLE object for completeness to determine if it has all the pieces and attributes necessary to be passed to MARSS functions for fitting, filtering, smoothing, or displaying. Internal function, use MARSS::: to access. This is a very slow function which should not be called repeatedly in a for loop for example.

Usage

is.marssMLE(MLEobj)

Arguments

MLEobj

An object of class marssMLE. See Details.

Details

The is.marssMLE() function checks components marss, start and control, which must be present for estimation by functions e.g. MARSSkem(). Components returned from estimation must include at least method, par, kf, numIter, convergence and logLik. Additional components (e.g. AIC) may be returned, as described in function help files.

model

An object of class marssMODEL in whatever form the user specified in the call to MARSS(). Default is form "marxss".

marss

An object of class marssMODEL in "marss" forms, needed for all the base MARSS functions.

start

List with matrices specifying initial values for parameters to be used (if needed) by the maximization algorithm.

B

Initial value(s) for \mathbf{B} matrix (m x m).

U

Initial value(s) for \mathbf{u} matrix (m x 1).

Q

Initial value(s) for \mathbf{Q} variance-covariance matrix (m x m).

Z

Initial value(s) for \mathbf{Z} matrix (n x m).

A

Initial value(s) for \mathbf{a} matrix (n x 1).

R

Initial value(s) for \mathbf{R} variance-covariance matrix (n x n).

x0

Initial value(s) for initial state vector (m x 1).

V0

Initial variance(s) for initial state variance (m x m).

control

A list specifying estimation options. The following options are needed by MARSSkem(). Other control options can be set if needed for other estimation methods, e.g. the control options listed for optim for use with MARSSoptim(). The default values for control options are set in alldefaults[[method]] which is specified in MARSSsettings.R.

minit

The minimum number of iterations to do in the maximization routine (if needed by method).

maxit

Maximum number of iterations to be used in the maximization routine (if needed by method).

min.iter.conv.test

Minimum iterations to run before testing convergence via the slope of the log parameter versus log iterations.

conv.test.deltaT=9

Number of iterations to use for the testing convergence via the slope of the log parameter versus log iterations.

conv.test.slope.tol

The slope of the log parameter versus log iteration to use as the cut-off for convergence. The default is 0.5 which is a bit high. For final analyses, this should be set lower.

abstol

The logLik.(iter-1)-logLik.(iter) convergence tolerance for the maximization routine. Both the abstol and the slope of the log of the parameters versus the log iteration tests must be met for convergence.

trace

A positive integer. If not 0, a record will be created during maximization iterations (what's recorded depends on method of maximization). -1 turns off most internal error checking.

safe

Logical. If TRUE, then the Kalman filter is run after each update equation in the EM algorithm. This slows down the algorithm. The default is FALSE.

allow.degen

If TRUE, replace \mathbf{Q} or \mathbf{R} diagonal elements by 0 when they become very small.

min.degen.iter

Number of iterations before trying to set a diagonal element of \mathbf{Q} or \mathbf{R} to zero).

degen.lim

How small the \mathbf{Q} or \mathbf{R} diagonal element should be before attempting to replace it with zero.

silent

Suppresses printing of progress bar, error messages and convergence information.

method

A string specifying the estimation method. MARSS allows "kem" for EM and "BFGS" for quasi-Newton.

Once the model has been fitted, additional elements are added.

par

A list with 8 matrices of estimated parameter values Z, A, R, B, U, Q, x0, V0.

states

Expected values of the x (hidden states).

states.se

Standard errors on the estimates states.

ytT

Expected values of the y. This is just y for non-missing y.

ytT.se

Standard errors on the ytT. This will be 0 for non-missing y.

kf

A list containing Kalman filter/smoother output if control$trace is > 0.

Ey

A list containing expectations involving y. Output if control$trace is > 0.

numIter

Number of iterations which were required for convergence.

convergence

Convergence status and errors. 0 means converged successfully. Anything else means an error or warning.

logLik

Log-likelihood.

AIC

AIC

AICc

Corrected AIC.

call

A list of all the arguments passed into the MARSS call. Not required for most functions, but is a record of what was used to call MARSS for checking and can be used to customize the printing of MARSS output.

Value

TRUE if no problems; otherwise a message describing the problems.

Author(s)

Eli Holmes and Kellie Wills, NOAA, Seattle, USA.

See Also

marssMODEL, MARSSkem()


MARSS documentation built on May 31, 2023, 9:28 p.m.