## a TARMA(1,1,1,1) where the threshold effect is on the AR parameters
set.seed(123)
x1 <- TARMA.sim(n=100, phi1=c(0.5,-0.5), phi2=c(0.0,0.8), theta1=0.5, theta2=0.5, d=1, thd=0.2)
TARMA.test(x1, ar.ord=1, ma.ord=1, d=1)
TARMA.test(x1, ar.ord=1, ma.ord=1, d=1, ma.fixed=FALSE) # full TARMA test
## a TARMA(1,1,1,1) where the threshold effect is on the MA parameters
set.seed(212)
x2 <- TARMA.sim(n=100, phi1=c(0.5,0.2), phi2=c(0.5,0.2), theta1=0.6, theta2=-0.6, d=1, thd=0.2)
TARMA.test(x2, ar.ord=1, ma.ord=1, d=1)
TARMA.test(x2, ar.ord=1, ma.ord=1, d=1, ma.fixed=FALSE) # full TARMA test
## a ARMA(1,1)
x3 <- arima.sim(n=100, model=list(order = c(1,0,1),ar=0.5, ma=0.5))
TARMA.test(x3, ar.ord=1, ma.ord=1, d=1)
## a TAR(1,1)
x4 <- TARMA.sim(n=100, phi1=c(0.5,-0.5), phi2=c(0.0,0.8), theta1=0, theta2=0, d=1, thd=0.2)
TARMA.test(x4, ar.ord=1, ma.ord=0, d=1)
## a AR(1)
x5 <- arima.sim(n=100, model=list(order = c(1,0,0),ar=0.5))
TARMA.test(x5, ar.ord=1, ma.ord=0, d=1)
Run the code above in your browser using DataLab