print_marssMLE: Printing functions for MARSS MLE objects

Description Usage Arguments Value Author(s) Examples

Description

The MARSS fitting function, MARSS, outputs marssMLE objects. print(marssMLE), where marssMLE is a marssMLE object, will print out information on the fit. However, print can be used to print a variety of information (residuals, smoothed states, imputed missing values, etc) from a marssMLE object using the what argument in the print call.

Usage

1
2
## S3 method for class 'marssMLE'
print(x, digits = max(3, getOption("digits")-4), ..., what="fit", form=NULL, silent=FALSE)

Arguments

x

A marssMLE object.

digits

Number of digits for printing.

...

Other arguments for print.

what

What to print. Default is "fit". If you input what as a vector, print returns a list. See examples.

  • "model" The model parameters with names for the estimted parameters. The output is customized by the form of the model that was fit. This info is in attr(x$model, "form") .

  • "par" A list of only the estimated values in each matrix. Each model matrix has it's own list element. Standard function: coef(x)

  • "start" or "inits" The values that the optimization algorithm was started at. Note, x$start shows this in form="marss" while print shows it in whatever form is in attr(x$model, "form") .

  • "paramvector" A vector of all the estimated values in each matrix. Standard function: coef(x, type="vector"). See coef.marssMLE.

  • "par.se","par.bias","par.lowCIs","par.upCIs" A vector the estimated parameter standard errors, parameter bias, lower and upper confidence intervals. Standard function: MARSSparamCIs(x) See MARSSparamCIs.

  • "xtT" or "states" The estimated states conditioned on all the data. x$states

  • "data" The data. This is in x$model$data

  • "logLik" The log-likelihood. Standard function: x$logLik. See MARSSkf for a discussion of the computation of the log-likelihood for MARSS models.

  • "ytT" The expected value of the data conditioned on all the data. Returns the data if present and the expected value if missing. This is in x$ytT (ytT is analogous to xtT).

  • "states.se" The state standard errors. x$states.se

  • "states.cis" Approximate confidence intervals for the states. See MARSSparamCIs.

  • "model.residuals" The smoothed model residuals. y(t)-E(y(t)|xtT(t)), aka actual data at time t minus the expected value of the data conditioned on the smoothed states estimate at time t. Standard function: residuals(x)$model.residuals See residuals.marssMLE for a discussion of residuals in the context of MARSS models.

  • "state.residuals" The smoothed state residuals. E(xtT(t))-E(x(t)|xtT(t-1)), aka the expected value of x at t conditioned on all the data minus the expected value of x at t conditioned on (x(t-1) conditioned on all the data). Standard function: residuals(x)$state.residuals See residuals.marssMLE.

  • parameter name Returns the parameter matrix for that parameter with fixed values at their fixed values and the estimated values at their estimated values. Standard function: coef(x, type="matrix")$elem

  • "kfs" The Kalman filter and smoother output. See MARSSkf for a description of the output. The full kf output is not normally attached to the output from a MARSS() call. This will run the filter/smoother if needed and return the list INVISIBLY. So assign the output as foo=print(x,what="kfs")

  • "Ey" The expectations involving y conditioned on all the data. See MARSShatyt for a discussion of these expectations. This output is not normally attached to the output from a MARSS() call–except ytT which is the predicted value of any missing y. The list is returned INVISIBLY. So assign the output as foo=print(x,what="Ey").

form

By default, print uses the model form specified in the call to MARSS. This information is in attr(marssMLE$model, "form") , however you can specify a different form. form="marss" should always work since this is the model form in which the model objects are stored (in marssMLE$marss).

silent

If TRUE, do not print just return the object. If print call is assigned, nothing will be printed. See examples. If what="fit", there is always output printed.

Value

A print out of information. If you assign the print call to a value, then you can reference the output. See the examples.

Author(s)

Eli Holmes, NOAA, Seattle, USA.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 
  dat = t(harborSeal)
  dat = dat[c(2,11),]
  MLEobj = MARSS(dat)
  
  print(MLEobj)
  
  print(MLEobj,what="model")
  
  print(MLEobj,what="par")
  
  #silent doesn't mean silent unless the print output is assigned
  print(MLEobj,what="paramvector", silent=TRUE)
  tmp=print(MLEobj,what="paramvector", silent=TRUE)
  #silent means some info on what you are printing is shown whether
  #or not the print output is assigned
  print(MLEobj,what="paramvector", silent=FALSE)
  tmp=print(MLEobj,what="paramvector", silent=FALSE)
  
  cis=print(MLEobj,what="states.cis")
  cis$up95CI
  
  vars=print(MLEobj, what=c("R","Q"))

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