Live Autoregressive Process

August 26, 2012

(This article was first published on Jkunst - R category, and kindly contributed to R-bloggers)

This post join two things that I like: Highcharts and the Time series. So I have a lot of fun making this minipost
to show how works an autoregressive process. Well, let’s remember the structure of an autoregresive process.
$y_t = varphi,y_{t-1}+epsilon_t$, where $epsilon_t$ is a white noise, i.e, a $cov(epsilon_j, epsilon_i) = 0$
if $i neq j$, $Var(epsilon_t) = sigma^2_epsilon$, and $varphi$ is a real parameter.

Now, let’s see first how a white noise looks like. The next chart show the process $y_t = epsilon_t$, so if we see
for a moment the chart we’ll notice the process look likes an independent random sequence. There’s no structure
of any dependence.

The two charts above show autoregressive process for two distinct values of $varphi$. It’s easy to see the difference.
In the first process the next value of the serie tends to have the same sign of the past value. In the other procces
ocurrs the oposite. That’s the effect of the sign of the parameter.

It’s interesting to note: the two process are diferents but they have the same mean and variance. In fact,
in the $AR(1)$ process $Var(y_t) = frac{sigma_epsilon^2}{1-varphi^2}$, only if the process are stationary $|varphi| < 1$.


To leave a comment for the author, please follow the link and comment on their blog: Jkunst - R category. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)