Functions to create an autoregressive model (ar
) or a
modified autoregressive model (ar2
)
Usage
ar(
name,
ar,
fixedar = FALSE,
variance = 0.01,
fixedvariance = FALSE,
nlags = 0,
zeroinit = FALSE
)
ar2(
name,
ar,
fixedar = FALSE,
variance = 0.01,
fixedvariance = FALSE,
nlags = 0,
nfcasts = 0
)
Arguments
- ar
vector of the AR coefficients (\(\varphi_1, \dots, \varphi_p\)).
- fixedar
boolean that triggers the estimation of the AR coefficients (
FALSE
) or fixed it (TRUE
) to a pre-specified value set by the parameterar
.- variance
the variance (\(\sigma^2_{ar}\)).
- fixedvariance
boolean that triggers the estimation of the variance (
FALSE
) or fixed it (TRUE
) to a pre-specified value set by the parametervariance
.- nlags
integer specifying how many lags of the state variable are needed
- zeroinit
boolean determining the initial condition for the state variable, which is equal to zero if
zeroinit = TRUE
. The default (zeroinit = FAKSE
) triggers the an initialization based on the unconditional mean and variance of the AR(p) process.- nfcasts
integer specifying how many forecasts of the state variable are needed