set.seed(123)
## a TAR(1,1) ---------------
x1 <- 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)
TAR.test(x1, ar.ord=1, d=1)
## a AR(1) ----------------
x2 <- arima.sim(n=100, model=list(order=c(1,0,0), ar=0.5))
TAR.test(x2, ar.ord=1, d=1)
Run the code above in your browser using DataLab