Skip to contents

Creates bootstrap parameter estimates and simulated (or bootstrapped) data (if appropriate). This is a base function in the MARSS-package.

Usage

MARSSboot(MLEobj, nboot = 1000, 
    output = "parameters", sim = "parametric", 
    param.gen = "MLE", control = NULL, silent = FALSE)

Arguments

MLEobj

An object of class marssMLE. Must have a $par element containing MLE parameter estimates.

nboot

Number of bootstraps to perform.

output

Output to be returned: "data", "parameters" or "all".

sim

Type of bootstrap: "parametric" or "innovations". See Details.

param.gen

Parameter generation method: "hessian" or "MLE".

control

The options in MLEobj$control are used by default. If supplied here, must contain all of the following:

max.iter

Maximum number of EM iterations.

tol

Optional tolerance for log-likelihood change. If log-likelihood decreases less than this amount relative to the previous iteration, the EM algorithm exits.

allow.degen

Whether to try setting \(\mathbf{Q}\) or \(\mathbf{R}\) elements to zero if they appear to be going to zero.

silent

Suppresses printing of progress bar.

Details

Approximate confidence intervals (CIs) on the model parameters can be calculated by the observed Fisher Information matrix (the Hessian of the negative log-likelihood function). The Hessian CIs (param.gen="hessian") are based on the asymptotic normality of ML estimates under a large-sample approximation. CIs that are not based on asymptotic theory can be calculated using parametric and non-parametric bootstrapping (param.gen="MLE"). In this case, parameter estimates are generated by the ML estimates from each bootstrapped data set. The MLE method (kem or BFGS) is determined by MLEobj$method.

Stoffer and Wall (1991) present an algorithm for generating CIs via a non-parametric bootstrap for state-space models (sim = "innovations"). The basic idea is that the Kalman filter can be used to generate estimates of the residuals of the model fit. These residuals are then standardized and resampled and used to generate bootstrapped data using the MARSS model and its maximum-likelihood parameter estimates. One of the limitations of the Stoffer and Wall algorithm is that it cannot be used when there are missing data, unless all data at time \(t\) are missing. An alternative approach is a parametric bootstrap (sim = "parametric"), in which the ML parameter estimates are used to produce bootstrapped data directly from the state-space model.

Value

A list with the following components:

boot.params

Matrix (number of params x nboot) of parameter estimates from the bootstrap.

boot.data

Array (n x t x nboot) of simulated (or bootstrapped) data (if requested and appropriate).

marss

The marssMODEL object (form="marss") that was passed in via MLEobj$marss.

nboot

Number of bootstraps performed.

output

Type of output returned.

sim

Type of bootstrap.

param.gen

Parameter generation method: "hessian" or "KalmanEM".

References

Holmes, E. E., E. J. Ward, and M. D. Scheuerell (2012) Analysis of multivariate time-series using the MARSS package. NOAA Fisheries, Northwest Fisheries Science Center, 2725 Montlake Blvd E., Seattle, WA 98112 Type RShowDoc("UserGuide",package="MARSS") to open a copy.

Stoffer, D. S., and K. D. Wall. 1991. Bootstrapping state-space models: Gaussian maximum likelihood estimation and the Kalman filter. Journal of the American Statistical Association 86:1024-1033.

Cavanaugh, J. E., and R. H. Shumway. 1997. A bootstrap variant of AIC for state-space model selection. Statistica Sinica 7:473-496.

Author

Eli Holmes and Eric Ward, NOAA, Seattle, USA.

Examples

# nboot is set low in these examples in order to run quickly
# normally nboot would be >1000 at least
dat <- t(kestrel)
dat <- dat[2:3, ]
# maxit set low to speed up the example
kem <- MARSS(dat,
  model = list(U = "equal", Q = diag(.01, 2)),
  control = list(maxit = 50)
)
#> Success! algorithm run for 15 iterations. abstol and log-log tests passed.
#> Alert: conv.test.slope.tol is 0.5.
#> Test with smaller values (<0.1) to ensure convergence.
#> 
#> MARSS fit is
#> Estimation method: kem 
#> Convergence test: conv.test.slope.tol = 0.5, abstol = 0.001
#> Algorithm ran 15 (=minit) iterations and convergence was reached. 
#> Log-likelihood: -11.12704 
#> AIC: 30.25409   AICc: 30.78742   
#>  
#>                       Estimate
#> R.diag                 0.04958
#> U.1                   -0.00783
#> x0.X.British.Columbia  0.78786
#> x0.X.Alberta           0.73740
#> Initial states (x0) defined at t=0
#> 
#> Standard errors have not been calculated. 
#> Use MARSSparamCIs to compute CIs and bias estimates.
#> 
# bootstrap parameters from a Hessian matrix
hess.list <- MARSSboot(kem, param.gen = "hessian", nboot = 4)
#> MARSSboot: Computing the Hessian.  This might take awhile.
#>           |2%      |20%      |40%      |60%      |80%      |100%
#> Progress: ||||||||||||||||||||||||||||||||||||||||||||||||||

# from resampling the innovations (no missing values allowed)
boot.innov.list <- MARSSboot(kem, output = "all", sim = "innovations", nboot = 4)
#>           |2%      |20%      |40%      |60%      |80%      |100%
#> Progress: ||||||||||||||||||||||||||||||||||||||||||||||||||

# bootstrapped parameter estimates
hess.list$boot.params
#>                              [,1]         [,2]         [,3]        [,4]
#> R.diag                 0.04015958  0.055319732  0.048188019 0.026875603
#> U.1                   -0.02639235 -0.005100932 -0.003792567 0.006973745
#> x0.X.British.Columbia  1.11099485  0.861835256  0.656915029 1.063038005
#> x0.X.Alberta           0.61250010  0.612674666  1.182270491 0.825369394