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, mat = matrix(1:2, 2), widths = rep(1, ncol(mat)), heights = rep(1, nrow(mat)), lty.rect = 2, ...)
x 
univariate timeseries (a single numerical vector); default to be

k 
an integer of the window width 
conf 
a positive number: the confidence intervals are computed as

mat, widths, heights 
arguments passed to 
lty.rect 
the line type of the rectangles respresenting the moving “windows” 
... 
other arguments passed to 
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
Examples at https://yihui.name/animation/example/mwarani/
Robert A. Meyer, Jr. Estimating coefficients that change over time. International Economic Review, 13(3):705710, 1972.