Skip to contents

Fits a state space model using classical maximum likelihood estimation with no attempt to detect or account for outliers. This serves as a baseline model for comparison.

Usage

classical_SSM(
  y,
  init_par,
  build,
  lower = NA,
  upper = NA,
  control = list(parscale = init_par)
)

Arguments

y

A numeric matrix of observations (time points in rows).

init_par

A numeric vector of initial parameter values.

build

A function that returns a dlm model given a parameter vector. The specify_SSM() function can be used to create this build function.

lower

Optional numeric vector of lower bounds for parameter estimation. Defaults to -Inf. Must be of same length as init_par.

upper

Optional numeric vector of upper bounds for parameter estimation. Defaults to Inf. Must be of same length as init_par.

control

Optional list of control parameters passed to optim via dlm::dlmMLE(). Default is list(parscale = init_par), which can help the optimizer if parameters are on vastly different scales.

Value

An object of class classical_SSM containing the optimization result, the original data, and the original build function.