Learn R Programming

timsac (version 1.3.0)

bsubst: Bayesian Type All Subset Analysis

Description

Produce Bayesian estimates of time series models such as pure AR models, AR models with non-linear terms, AR models with polynomial type mean value functions, etc. The goodness of fit of a model is checked by the analysis of several steps ahead prediction errors.

Usage

bsubst(y, mtype, lag=NULL, nreg, reg=NULL, term.lag=NULL, cstep=5,
       plot=TRUE)

Arguments

y
a univariate time series.
mtype
model type. Allowed values are rl{ 1 : autoregressive model, 2 : polynomial type non-linear model (lag's read in), 3 : polynomial type non-linear model (lag's automatically set), 4 : AR-model with polynomial mean value f
lag
maximum time lag. Default is $2 \sqrt(n)$, where $n$ is the length of the time series y.
nreg
number of regressors.
reg
specification of regressor (mtype = 2). $i$-th regressor is defined by $z(n-L1(i)) \times z(n-L2(i)) \times z(n-L3(i))$, where $L1(i)$ is reg(1,i), $L2(i)$ is reg(2,i) and $L3(i)$ is reg(3,i).
term.lag
maximum time lag specify the regressors ($L1(i),L2(i),L3(i)$) (i=1,...,nreg) (mtype = 3). rl{ term.lag(1) : maximum time lag of linear term term.lag(2) : maximum time lag of squared term term.lag(
cstep
prediction errors checking (up to cstep-steps ahead) is requested. (mtype = 1,2,3).
plot
logical. If TRUE (default) daic, perr and peautcor are plotted.

Value

  • ymeanmean of y.
  • yvarvariance of y.
  • vinnovation variance.
  • aicAIC(m), (m=0,...,nreg).
  • aicminminimum AIC.
  • daicAIC(m)-aicmin (m=0,...,nreg).
  • order.maiceorder of minimum AIC.
  • v.maiceinnovation variance attained at order.maice.
  • arcoef.maiceAR coefficients attained at order.maice.
  • v.bayresidual variance of Bayesian model.
  • aic.bayAIC of Bayesian model.
  • np.bayequivalent number of parameters.
  • arcoef.bayAR coefficients of Bayesian model.
  • ind.cindex of parcor2 in order of increasing magnitude.
  • parcor2square of partial correlations (normalized by multiplying N).
  • dampbinomial type damper.
  • bweightfinal Bayesian weights of partial correlations.
  • parcor.baypartial correlations of the Bayesian model.
  • eicminminimum EIC.
  • esumwhole subset regression models.
  • npmeanmean of number of parameter.
  • npmean.nreg=npmean/nreg.
  • perrprediction error.
  • meanmean.
  • varvariance.
  • skewskewness.
  • peakpeakedness.
  • peautcorautocorrelation function of 1-step ahead prediction error.
  • pspecpower spectrum (mtype = 1).

Details

The AR model is given by ( mtype = 2 ) $$y(t) = a(1)y(t-1) + ... + a(p)y(t-p) + u(t).$$ The non-linear model is given by ( mtype = 2,3 ) $$y(t) = a(1)z(t,1) + a(2)z(t,2) + ... + a(p)z(t,p) + u(t).$$ Where $p$ is AR order and $u(t)$ is Gaussian white noise with mean $0$ and variance $v(p)$.

References

H.Akaike, G.Kitagawa, E.Arahata and F.Tada (1979) Computer Science Monograph, No.11, Timsac78. The Institute of Statistical Mathematics.

Examples

Run this code
data(Canadianlynx)
  Regressor <- matrix(
       c( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 1, 2, 1, 3, 1, 2, 3,
          0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0, 1, 2, 2, 3, 1, 2, 3,
          0, 0, 0, 0, 0, 0, 0, 0, 0,  0,  0,  0, 0, 0, 0, 0, 1, 2, 3 ),
        3,19, byrow=TRUE)

  z <- bsubst(Canadianlynx, 2, 12, 19, Regressor)

  z$arcoef.bay

Run the code above in your browser using DataLab