mwar.ani {animation} | R Documentation |
This function just fulfills a very naive idea about moving window regression using rectangles to denote the ``windows'' and move them, and the corresponding AR(1) coefficients as long as rough confidence intervals are computed for data points inside the ``windows'' during the process of moving.
mwar.ani(x, k = 15, conf = 2, control = ani.control(), ...)
x |
univariate time-series (a single numerical vector); default to be sin(seq(0, 2 * pi, length = 50)) + rnorm(50, sd = 0.2) |
k |
an integer of the window width |
conf |
a positive number: the confidence intervals are computed as [ar1 - conf*s.e., ar1 + conf*s.e.] |
control |
control parameters for the animation; see ani.control |
... |
other arguments passed to ani.control |
The AR(1) coefficients are computed by arima
.
A list containing
phi |
the AR(1) coefficients |
L |
lower bound of the confidence interval |
U |
upper bound of the confidence interval |
Yihui Xie
Robert A. Meyer, Jr. Estimating coefficients that change over time. International Economic Review, 13(3):705-710, 1972.
# moving window along a sin curve mwar.ani(interval = 0.3) # for the data 'pageview' data(pageview) mwar.ani(pageview$visits, k = 30, interval = 0.2) ## Not run: # HTML animation page ani.start() mwar.ani(interval = 0.2, width = 600, height = 500) ani.stop() ## End(Not run)