MS: Multiple Seasonality modeling procedure

Description Usage Arguments Details Value Author(s)

View source: R/MS.R

Description

Detect potential seasonality periods by spectrum analysis, fit models on blurred seasonality periods terms, select best model, and predict. Now only for centered and detrended univariate time series.

Usage

1
2
3
4
MS(X, W = NULL, U, p_range, q_range, r = 1, S = NULL, 
    blur.out = c(2, 2), sar = T, sma = T, sfourier = F, order = 1, 
    sfactor = F, pred_t = 0, crit = "BC", level = 0.05, 
    multicore = T)

Arguments

X

a data vector or a n by 1 matrix

W

exogenous matrix p by (n+pred_t)

U

number of data points burned-in. Upper bound for seasonality, i.e. U > max(S1,S2)

p_range

a range of regular AR lag to be selected

q_range

a range of regular MA lag to be selected

r

number of seasonality periods allowed

S

pre-specified seasonal ARMA components;if NULL, suggested by information criterion and MS procedure will be performed

blur.out

2-elements vector, left and right bounds of blurring seasonality intervals

sar

logical, including seasonal AR components or not

sma

logical, including seasonal MA components or not

sfourier

logical, including triangular components or not

order

order of triangular components

sfactor

logical, including binary seasonal components or not

pred_t

n-predict out of samples. if NULL then will not predict

crit

selection criterion. crit = c('BC','AIC','BIC')

level

level of z-score test on spectral spikes. Used to control significance of potential seasonality in the first step

multicore

logical, whether to employ parallel computation

Details

The model is estimated by BFGS algorithm in optim(). Note that in univariate ARMA estimation, quasi-Newton method usually provide a robust result rather than aggressive ML with second order algorithms.

The algorithm optimize conditional likelihood based on burned in samples. This is specified by argument U. U has to be greater than p,q or any element in seasonality terms.

For models that have diverging estimation, the aic value will be recorded as Inf.

The function make static prediction within each observation period, while use dynamic prediction for out-sampled period.

Value

obj

best fitted model object

ic_panel

selection panel for all parameters combination

prediction

a vector recording predicted values. Length= n + pred_t

Author(s)

Tianyang Xie


TYtianyang/tsms documentation built on Sept. 10, 2020, 1:54 p.m.