Learn R Programming

MARSS stands for Multivariate Auto-Regressive(1) State-Space. The MARSS R package estimates the parameters of linear MARSS models with Gaussian errors. This class of model is extremely important in the study of linear stochastic dynamical systems, and these models are important in many different fields, including economics, engineering, genetics, physics and ecology. The model class has different names in different fields, for example in some fields they are termed dynamic linear models (DLMs) or vector autoregressive (VAR) state-space models. The MARSS package allows you to easily fit time-varying constrained and unconstrained MARSS models with or without covariates via maximum-likelihood using an EM algorithm or BFGS. Fast fitting with TMB is available with the companion package marssTMB.

INSTALL {#install}

To install MARSS from CRAN:

install.packages("MARSS")
library(MARSS)

The latest release on GitHub may be ahead of the CRAN release. To install the latest release on GitHub. You can install from our r-universe repository:

install.packages('MARSS', repos = c('https://atsa-es.r-universe.dev', 'https://cloud.r-project.org'))

or install from GitHub

install.packages("remotes") # if needed
remotes::install_github("atsa-es/MARSS@*release")

To install an R package from GitHub, you need to be able to build an R package on your machine. If you are on Windows, that means you may need to install Rtools. In more recent versions of R, it seems like the Rtools dependency for Windows users has been removed, so try installing. If you get an error about no gcc installation, it means you need Rtools. On a Mac, installation should work fine; you do not need to install anything.

If you are on a Windows machine and get an error saying 'loading failed for i386' or similar, then try

options(devtools.install.args = "--no-multiarch")

If R asks you to update packages, and then proceeds to fail at installation because of a warning that a package was built under a later R version than you have on your computer, use

Sys.setenv(R_REMOTES_NO_ERRORS_FROM_WARNINGS=TRUE)

DOCUMENTATION and TUTORIALS {#documentation}

  • Quick Start Guide.
  • User Manual - The extensive user manual included in the package has many examples of how to fit MARSS models to a variety of data sets.
  • ATSA lab book - Many applications are also covered in our Applied Time Series Analysis book developed from the labs in our course.
  • ATSA course website - We have lectures and all material from our course on our course website. Select the Lectures tab to find the lecture material and videos of lectures.

ISSUES and BUG REPORTS {#bugs}

Issues? https://github.com/atsa-es/MARSS/issues

CITATION {#cite}

If you use MARSS results in publications, please cite the primary citation:

Holmes, E. E., Ward, E. J. and Wills, K. (2012) MARSS: Multivariate Autoregressive State-space Models for Analyzing Time-series Data. The R Journal. 4(1):11-19

You can also cite the package and user guide:

Elizabeth E. Holmes, Eric J. Ward, Mark D. Scheuerell and Kellie Wills (2020). MARSS: Multivariate Autoregressive State-Space Modeling. R package version 3.11.4.

Holmes, E. E., M. D. Scheuerell, and E. J. Ward (", year, ") Analysis of multivariate time-series using the MARSS package. Version ", meta$Version, ". NOAA Fisheries, Northwest Fisheries Science Center, 2725 Montlake Blvd E., Seattle, WA 98112, DOI: 10.5281/zenodo.5781847

Type citation("MARSS") at the command line to get the most up to data citations.

PUBLICATIONS {#pubs}

To see our publications using MARSS models, see the Applied Time Series Analysis website.

Developers

See inst/DEVELOPER_NOTES.md for instructions on creating a release from the repository.

License

The MARSS package as a whole is distributed under GPL-3 (GNU GENERAL PUBLIC LICENSE version 3).

In addition this software has the following license addendum:

Software code created by U.S. Government employees is not subject to copyright in the United States (17 U.S.C. §105). The United State s/Department of Commerce reserve all rights to seek and obtain copyright protection in countries other than the United States for Software authored in its entirety by the Department of Commerce. To this end, the Department of Commerce hereby grants to Recipient a royalty-free, nonexclusive license to use, copy, and create derivative works of the Software outside of the United States.

NOAA Disclaimer

This repository is a scientific product and is not official communication of the National Oceanic and Atmospheric Administration, or the United States Department of Commerce. All NOAA GitHub project code is provided on an ‘as is’ basis and the user assumes responsibility for its use. Any claims against the Department of Commerce or Department of Commerce bureaus stemming from the use of this GitHub project will be governed by all applicable Federal law. Any reference to specific commercial products, processes, or services by service mark, trademark, manufacturer, or otherwise, does not constitute or imply their endorsement, recommendation or favoring by the Department of Commerce. The Department of Commerce seal and logo, or the seal and logo of a DOC bureau, shall not be used in any manner to imply endorsement of any commercial product or activity by DOC or the United States Government.

Copy Link

Version

Install

install.packages('MARSS')

Monthly Downloads

750

Version

3.11.9

License

GPL-2

Maintainer

Elizabeth Holmes NOAA Federal

Last Published

February 19th, 2024

Functions in MARSS (3.11.9)

MARSS.dfa

Multivariate Dynamic Factor Analysis
MARSS.marxss

Multivariate AR-1 State-space Model with Inputs
MARSS.marss

Multivariate AR-1 State-space Model
MARSS

Fit a MARSS Model via Maximum-Likelihood Estimation
MARSSaic

AIC for MARSS Models
MARSSFisherI

Observed Fisher Information Matrix at the MLE
MARSS.vectorized

Vectorized Multivariate AR-1 State-space Model
MARSS-package

Multivariate Autoregressive State-Space Model Estimation
CSEGriskfigure

Plot Extinction Risk Metrics
CSEGtmufigure

Plot Forecast Uncertainty
MARSShessian

Parameter Variance-Covariance Matrix from the Hessian Matrix
MARSShessian.numerical

Hessian Matrix via Numerical Approximation
MARSSharveyobsFI

Hessian Matrix via the Harvey (1989) Recursion
MARSSinfo

MARSS Error Messages and Warnings
MARSShatyt

Compute Expected Value of Y, YY, and YX
MARSSboot

Bootstrap MARSS Parameter Estimates
MARSSfit

Generic for fitting MARSS models
MARSSapplynames

Names for marssMLE Object Components
MARSSinits

Initial Values for MLE
MARSScv

MARSScv is a wrapper for MARSS that re-fits the model with cross validated data.
MARSSresiduals.tt

MARSS Contemporaneous Residuals
MARSSkf

Kalman Filtering and Smoothing
MARSSinnovationsboot

Bootstrapped Data using Stoffer and Wall's Algorithm
MARSSresiduals.tt1

MARSS One-Step-Ahead Residuals
MARSSresiduals

MARSS Residuals
MARSSparamCIs

Standard Errors, Confidence Intervals and Bias for MARSS Parameters
MARSSoptim

Parameter estimation for MARSS models using optim
MARSSkem

EM Algorithm function for MARSS models
MARSSresiduals.tT

MARSS Smoothed Residuals
MARSSkemcheck

Model Checking for MLE objects Passed to MARSSkem
SalmonSurvCUI

Salmon Survival Indices
allowed

MARSS Function Defaults and Allowed Methods
checkMARSSInputs

Check inputs to MARSS call
marss.conversion

Convert Model Objects between Forms
coef.marssMLE

Coefficient function for MARSS MLE objects
MARSSsimulate

Simulate Data from a MARSS Model
datasets

Example Data Sets
MARSSvectorizeparam

Vectorize or Replace the par List
checkModelList

Check model List Passed into MARSS Call
is.marssMLE

Tests marssMLE object for completeness
accuracy

Return accuracy metrics
describe.marssMODEL

Describe a marssMODEL Objects
forecast.marssMLE

forecast function for marssMLE objects
isleRoyal

Isle Royale Wolf and Moose Data
fitted.marssMLE

Return fitted values for X(t) and Y(t) in a MARSS model
ldiag

Return a diagonal list matrix
population-count-data

Population Data Sets
glance

Return brief summary information on a MARSS fit
harborSeal

Harbor Seal Population Count Data (Log counts)
is.marssMODEL

Test Model Objects
marssMODEL-class

Class "marssMODEL"
marssMLE-class

Class "marssMLE"
logLik.marssMLE

logLik method for MARSS MLE objects
marssPredict-class

Class "marssPredict"
marssResiduals-class

Class "marssResiduals"
model.frame.marssMODEL

model.frame method for marssMLE and marssMODEL objects
plankton

Plankton Data Sets
plot.marssMLE

Plot MARSS MLE objects
match.arg.exact

match.arg with exact matching
print.marssMODEL

Printing marssMODEL Objects
print.marssMLE

Printing functions for MARSS MLE objects
summary.marssMLE

Summary methods for marssMLE objects
plot.marssPredict

Plot MARSS Forecast and Predict objects
plot.marssResiduals

Plot MARSS marssResiduals objects
loggerhead

Loggerhead Turtle Tracking Data
stdInnov

Standardized Innovations
predict.marssMLE

predict and forecast MARSS MLE objects
predict

predict and forecast MARSS MLE objects
print.marssPredict

Printing function for MARSS Predict objects
residuals.marssMLE

Model and state fitted values, residuals, and residual sigma
tsSmooth.marssMLE

Smoothed and filtered x and y time series
toLatex.marssMODEL

Create a LaTeX Version of the Model
sysdata

Palettes
tidy.marssMLE

Return estimated parameters with summary information
utility.functions

Utility Functions
zscore

z-score a vector or matrix