## a TAR(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, theta2=0, d=1, thd=0.2)
TAR.test.B(x1, ar.ord=1, d=1)
TAR.test.B(x1, ar.ord=1, d=1, btype='wb.r')
TAR.test.B(x1, ar.ord=1, d=1, btype='wb.h')
## a AR(1)
x2 <- arima.sim(n=100, model=list(order = c(1,0,0),ar=0.5))
TAR.test.B(x2, ar.ord=1, d=1)
TAR.test.B(x2, ar.ord=1, d=1, btype='wb.r')
TAR.test.B(x2, ar.ord=1, d=1, btype='wb.h')
Run the code above in your browser using DataLab