BAYSTAR {BAYSTAR} | R Documentation |
Threshold Autoregressive model: Bayesian approach
Description
Bayesian estimation and one-step-ahead forecasting for two-regime TAR model, as well as monitoring MCMC convergence. One may want to allow for higher-order AR models in the different regimes. Parsimonious subset AR could be assigned in each regime in the BAYSTAR function rather than a full AR model (i.e. the autoregressive orders could be not a continuous series).
Usage
BAYSTAR(x, lagp1, lagp2, Iteration, Burnin, constant, d0,
step.thv, thresVar, mu01, v01, mu02, v02, v0, lambda0, refresh,tplot)
Arguments
x |
A vector of time series. |
lagp1 |
A vector of non-zero autoregressive lags for the lower regime (regime one).
For example, an AR model with p1=3 in lags 1,3, and 5 would be set
as |
lagp2 |
A vector of non-zero autoregressive lags for the upper regime (regime two). |
Iteration |
The number of MCMC iterations. |
Burnin |
The number of burn-in iterations for the sampler. |
constant |
The intercepts include in the model for each regime, if |
d0 |
The maximum delay lag considered. (Default: |
step.thv |
Step size of tuning parameter for the Metropolis-Hasting algorithm. |
thresVar |
A vector of time series for the threshold variable. (if missing, the series x is used.) |
mu01 |
The prior mean of |
v01 |
The prior covariance matrix of |
mu02 |
The prior mean of |
v02 |
The prior covariance matrix of |
v0 |
|
lambda0 |
|
refresh |
Each |
tplot |
Trace plots and ACF plots for all parameter estimates. (Default: |
Details
Given the maximum AR orders p1 and p2, the two-regime SETAR(2:p1;p2) model is specified as:
x_{t} = ( \phi _0^{(1)} + \phi _1^{(1)} x_{t - 1} + \ldots + \phi _{p1 }^{(1)} x_{t - p1 } +
a_t^{(1)} ) I( z_{t-d} <= th) + ( \phi _0^{(2)} + \phi _1^{(2)} x_{t - 1} + \ldots +
\phi _{p2 }^{(2)} x_{t - p2 } + a_t^{(2)} I( z_{t-d} > th)
where th
is the threshold value for regime switching;
z_{t}
is the threshold variable; d
is the delay lag
of threshold variable; and the error term a_t^{(j)}
, j,
(j=1,2)
, for each regime is assumed to be an i.i.d. Gaussian
white noise process with mean zero and variance sigma_j^2,
j=1,2
. I(A) is an indicator function. Event A will occur if
I(A)=1 and otherwise if I(A)=0. One may want to allow parsimonious
subset AR model in each regime rather than a full AR model.
Value
A list of output with containing the following components:
mcmc |
All MCMC iterations. |
posterior |
The initial |
coef |
Summary Statistics of parameter estimation based on the final sample of ( |
residual |
Residuals from the estimated model. |
lagd |
The mode of time delay lag of the threshold variable. |
DIC |
The deviance information criterion (DIC); a Bayesian method for model comparison (Spiegelhalter et al, 2002) |
Author(s)
Cathy W. S. Chen, Edward M.H. Lin, F.C. Liu, and Richard Gerlach
Examples
set.seed(989981)
## Set the true values of all parameters
nob<- 200 ## No. of observations
lagd<- 1 ## delay lag of threshold variable
r<- 0.4 ## r is the threshold value
sig.1<- 0.8; sig.2<- 0.5 ## variances of error distributions for two regimes
p1<- 2; p2<- 1 ## No. of covariate in two regimes
ph.1<- c(0.1,-0.4,0.3) ## mean coefficients for regime 1
ph.2<- c(0.2,0.6) ## mean coefficients for regime 2
lagp1<-1:2
lagp2<-1:1
yt<- TAR.simu(nob,p1,p2,ph.1,ph.2,sig.1,sig.2,lagd,r,lagp1,lagp2)
## Total MCMC iterations and burn-in iterations
Iteration <- 500
Burnin <- 200
## A RW (random walk) MH algorithm is used in simulating the threshold value
## Step size for the RW MH
step.thv<- 0.08
out <- BAYSTAR(yt,lagp1,lagp2,Iteration,Burnin,constant=1,step.thv=step.thv,tplot=TRUE)