mbsts_function {mbsts} | R 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=\mu+\tau+\omega+\beta X+\epsilon,
where \mu
, \tau
, \omega
, \beta X
, and \epsilon
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 ( |
Xtrain |
A ( |
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 |
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 |
R2 |
A numerical value taking value in |
v |
A numerical value describing the prior degree of freedom of the inverse Wishart distribution for ( |
ss |
A numerical value describing the prior scale matrix of the inverse Wishart distribution for ( |
mc |
A positive integer giving the desired number of MCMC draws. The default value is |
burn |
A positive integer giving the number of initial MCMC draws to be discarded. The default value is |
Value
An object of mbsts class
Author(s)
Jinwen Qiu qjwsnow_ctw@hotmail.com Ning Ning patricianing@gmail.com
References
Qiu, Jammalamadaka and Ning (2018), Multivariate Bayesian Structural Time Series Model, Journal of Machine Learning Research 19.68: 1-33.
Ning and Qiu (2021), The mbsts package: Multivariate Bayesian Structural Time Series Models in R.
Jammalamadaka, Qiu and Ning (2019), Predicting a Stock Portfolio with the Multivariate Bayesian Structural Time Series Model: Do News or Emotions Matter?, International Journal of Artificial Intelligence, Vol. 17, Number 2.