TSA (version 1.3)

tar.sim: Simulate a two-regime TAR model

Description

Simulate a two-regime TAR model.

Usage

tar.sim(object, ntransient = 500, n = 500, Phi1, Phi2, thd, d, p, sigma1, 
sigma2, xstart = rep(0, max(p,d)), e)

Arguments

object

a TAR model fitted by the tar function; if it is supplied, the model parameters and initial values are extracted from it

ntransient

the burn-in size

n

sample size of the simulated series

Phi1

the coefficient vector of the lower-regime model

Phi2

the coefficient vector of the upper-regime model

thd

threshold

d

delay

p

maximum autoregressive order

sigma1

noise std. dev. in the lower regime

sigma2

noise std. dev. in the upper regime

xstart

initial values for the simulation

e

standardized noise series of size equal to length(xstart)+ntransient+n; if missing, it will be generated as some normally distributed errors

Value

A list containing the following components:

y

simulated TAR series

e

the standardized errors

...

Details

The two-regime Threshold Autoregressive (TAR) model is given by the following formula: $$ Y_t = \phi_{1,0}+\phi_{1,1} Y_{t-1} +\ldots+ \phi_{1,p} Y_{t-p_1} +\sigma_1 e_t, \mbox{ if } Y_{t-d}\le r $$ $$ Y_t = \phi_{2,0}+\phi_{2,1} Y_{t-1} +\ldots+\phi_{2,p_2} Y_{t-p}+\sigma_2 e_t, \mbox{ if } Y_{t-d} > r.$$ where r is the threshold and d the delay.

References

Tong, H. (1990) "Non-linear Time Series, a Dynamical System Approach," Clarendon Press Oxford "Time Series Analysis, with Applications in R" by J.D. Cryer and K.S. Chan

See Also

tar

Examples

Run this code
# NOT RUN {
set.seed(1234579)
y=tar.sim(n=100,Phi1=c(0,0.5),
Phi2=c(0,-1.8),p=1,d=1,sigma1=1,thd=-1,
sigma2=2)$y
plot(y=y,x=1:100,type='b',xlab="t",ylab=expression(Y[t]))
# }

Run the code above in your browser using DataCamp Workspace