View source: R/fitting_functions.R
s_semiarma | R Documentation |
Fit a seasonal semiparametric autoregressive moving-average
(S-Semi-ARMA) model to a univariate time series. The estimation is
in two steps: firstly, the series is detrended and seasonally adjusted using the
function deseats
. Then an ARMA model is fitted to the
residuals using arima
.
s_semiarma(
yt,
smoothing_options = set_options(),
arma_options = list(ar_order = NULL, ma_order = NULL),
bwidth_start = 0.2,
inflation_rate = c("optimal", "naive"),
correction_factor = FALSE,
drop = NULL,
error_model = c("free", "ARMA"),
nar_lim = c(0, 3),
nma_lim = c(0, 3),
arma_mean = FALSE
)
yt |
a numerical vector or a time series object of class |
smoothing_options |
an S4 object of class |
arma_options |
a list with the two elements |
bwidth_start |
a single numeric value that is only relevant if the slot
|
inflation_rate |
a character vector of length one that indicates, which inflation rate
to use in the bandwidth selection; for a local linear trend, we have
|
correction_factor |
A logical vector of length one; theoretically, a
larger bandwidth to estimate the sum of autocovariances from residuals of
pilot trend and seasonality estimates is advisable than for estimating trend
and seasonality; for |
drop |
a numeric vector of length one that indicates the proportion of
the observations to not include at each boundary in the bandwidth estimation
process, if a bandwidth is selected automatically; the default is
|
error_model |
a character vector of length one that indicates whether
for |
nar_lim |
only valid for |
nma_lim |
only valid for |
arma_mean |
only valid for |
For information on the nonparametric regression step, see
deseats
. After the trend and the seasonality have
been removed from the data, an autoregressive moving-average (ARMA) model
is fitted to the residuals either with orders selected by the Bayesian
information criterion (BIC) or with manually selected orders. The ARMA
model is fitted using arima
.
All function arguments except for arma_options
are identical to
those in deseats
. If all elements in
arma_options
are set to NULL
, the ARMA model orders are
selected for p, q
from nar_lim[[1]]
and nma_lim[[1]]
up
until nar_lim[[2]]
and nma_lim[[2]]
according to the BIC.
The function returns and S4 object with the following elements (access them
via @
):
decomp
an object of class "mts"
that includes the
observed time series and its estimated components.
nonpar_model
an object of class "deseats"
; this is
the result of applying deseats
.
par_model
an object of class "Arima"
; the result of
applying arima
to the residuals of the nonparametric
estimation step.
Dominik Schulz (Research Assistant) (Department of Economics, Paderborn
University),
Author and Package Creator
Yuanhua Feng (Department of Economics, Paderborn
University),
Author
Xt <- log(EXPENDITURES)
est <- s_semiarma(Xt)
est
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.