mbsts_function: Main function for the multivariate Bayesian structural time...

mbsts_functionR Documentation

Main function for the multivariate Bayesian structural time series (MBSTS) model

Description

The MBSTS model uses MCMC to sample from the posterior distribution of a MBSTS model. The model is given by

y=μ+τ+ω+β X+ε,

where μ, τ, ω, β X, and ε denote the trend component, the seasonal component, the cycle component, the regression component, and the error term, respectively. Note that, without a regression component, the MBSTS model is an ordinary state space time series model. The predictors and response variables in the MBSTS model are designed to be contemporaneous. Lags and differences can be generated by manipulating the predictor matrix. The "spike-and-slab" prior is used for the regression component of models, which enables feature selection among a large number of features.

Usage

mbsts_function(
  Y,
  Xtrain,
  STmodel,
  ki,
  pii,
  b = NULL,
  v0,
  kapp = 0.01,
  R2 = 0.8,
  v = 0.01,
  ss = 0.01,
  mc = 500,
  burn = 50
)

## S4 method for signature 'array'
mbsts_function(
  Y,
  Xtrain,
  STmodel,
  ki,
  pii,
  b = NULL,
  v0,
  kapp = 0.01,
  R2 = 0.8,
  v = 0.01,
  ss = 0.01,
  mc = 500,
  burn = 50
)

Arguments

Y

A (n*m)-dimensional matrix containing multiple target series, where n is the number of observations and m is the number of target series.

Xtrain

A (n*K)-dimensional matrix containing all candidate predictor series for each target series. K=∑ k_i is the number of all candidate predictors for all target series. The first k_1 variables are the set of candidate predictors for the first target series, and the next k_2 variables are the set of candidate predictors for the second target series, etc. Note that, one variable can appear in the X.star several times, since different target series can contain the same candidate predictors.

STmodel

A state space model of SSmodel class returned by tsc.setting.

ki

A vector of integer values denoting the acumulated number of predictors for target series. For example, if there are three target series where the first has 8 predictors, the second has 6 predictors, and the third has 10 predictors, then the vector is c(8,14,24).

pii

A vector describing the prior inclusion probability of each candidate predictor.

b

NULL or a vector describing the prior means of regression coefficients. The default value is NULL.

v0

A numerical value describing the prior degree of freedom of the inverse Wishart distribution for Σ_ε.

kapp

A scalar value describing the number of observations worth of weight on the prior mean vector. The default value is 0.01.

R2

A numerical value taking value in [0,1], describing the expected percentage of variation of Y to be explained by the model. The default value is 0.8.

v

A numerical value describing the prior degree of freedom of the inverse Wishart distribution for (Σ_μ,Σ_δ,Σ_τ,Σ_ω). The default value is 0.01.

ss

A numerical value describing the prior scale matrix of the inverse Wishart distribution for (Σ_μ,Σ_δ,Σ_τ,Σ_ω). The default value is 0.01.

mc

A positive integer giving the desired number of MCMC draws. The default value is 500.

burn

A positive integer giving the number of initial MCMC draws to be discarded. The default value is 50.

Value

An object of mbsts class

Author(s)

Jinwen Qiu qjwsnow_ctw@hotmail.com Ning Ning patricianing@gmail.com

References

\Qiu

2018

\Ning

2021

\Jammalamadaka

2019


mbsts documentation built on Jan. 7, 2023, 9:07 a.m.