| sparma | R Documentation |
Implements a Sparse ARMA model in the State Space form. Unlike standard ARIMA which expands polynomials, this function directly maps AR and MA orders to specific lags.
sparma(data, orders = list(ar = c(1), ma = c(1)), constant = FALSE,
loss = c("likelihood", "MSE", "MAE", "HAM", "LASSO", "RIDGE", "MSEh",
"TMSE", "GTMSE", "MSCE", "GPL"), h = 0, holdout = FALSE, arma = NULL,
initial = c("backcasting", "optimal", "two-stage", "complete"),
bounds = c("none", "usual", "admissible"), silent = TRUE, ...)
data |
Vector or ts object with the data |
orders |
List with vectors for ar and ma, specifying, which AR and MA orders to fit
e.g. orders=list(ar=c(1,4), ma=0) will fit ARMA
|
constant |
Logical, whether to include a constant term (default: FALSE) |
loss |
Loss function type. |
h |
Forecast horizon (default: 0) |
holdout |
Logical, whether to use holdout sample (default: FALSE) |
arma |
List with ar and ma parameters if they do not need to be estimated |
initial |
Initialisation method for states |
bounds |
Parameter bounds |
silent |
Logical, whether to suppress output (default: TRUE) |
... |
Other parameters passed to god knows what. |
The model implements:
y_t = phi * y_{t-p} + theta * epsilon_{t-q} + epsilon_t
with a possibility of defining several lags for AR/MA.
Object of class c("adam", "smooth") containing:
model - Model name
timeElapsed - Computation time
data - Input data
holdout - Holdout sample (if applicable)
fitted - Fitted values
residuals - Residuals
forecast - Point forecasts if h>0
states - State matrix
persistence - Persistence vector (g)
transition - Transition matrix (F)
measurement - Measurement matrix (W)
B - Vector of estimated parameters
orders - Orders specified by the user
constant - Constant value (if included)
arma - vector of ARMA parameters
initial - Initial state values
initialType - Type of initialisation
nParam - Number of parameters
logLik - Log-likelihood value
loss - Loss function used in the estimation
lossValue - Value of the loss function
accuracy - Accuracy measures
## Not run:
# Fit SpARMA(1,1) model
model <- sparma(BJSales, orders=c(2,1), h=12, holdout=TRUE)
# Provide fixed parameters
model <- sparma(rnorm(100), orders=c(1,1), arma=c(0.7,0.5))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.