x <- nonlinearAR1.sim(100, g = function(x) x*sin(x), sd = 1.5) # simulated data
ChengTS(x, degree = 1, hopt = 0.5)
x <- nonlinearAR1.sim(100, g = function(x) x*sin(x), sd = 0.5) # simulated data
degree <- 1; xrange <- c(-.5, .5); n <- length(x)
h <- thumbBw(x[-n], x[-1], deg = degree, kernel=gaussK)
x.lp <- ARlocpoly(x, deg = degree, h = h, range.x = xrange)
x.shp <- sharpARlocpoly(x, deg = degree, range.x = xrange, h = x.lp$h*n^(4/45))
x.cheng <- ChengTS(x, degree = degree, hopt = h, range.x = xrange)
lag.plot(x, do.lines=FALSE)
lines(x.lp)
lines(x.shp, col=2)
lines(x.cheng, col=4)
Run the code above in your browser using DataLab