Time Series Analysis

0 views
Skip to first unread message

Bill

unread,
Sep 30, 2010, 4:19:46 PM9/30/10
to Houston R users
At last nights meeting, time series analysis came up (including
seasonality). There's a lot of ground that can be covered on this
subject, but to start off, a quick example might be worthwhile.

If you download the "stats" package:

http://stat.ethz.ch/R-manual/R-devel/library/stats/html/00Index.html

You'll get the HoltWinters routine. The current example of its use
(from typing help(HoltWinters) at the R prompt) is given below. Give
it a try and you'll see plots with seasonality and trends. Later,
we can go over the ARIMA issues on the noise terms and the "trasfer
function" thing.


Bill

==============================



require(graphics)

## Seasonal Holt-Winters
(m <- HoltWinters(co2))
plot(m)
plot(fitted(m))

(m <- HoltWinters(AirPassengers, seasonal = "mult"))
plot(m)

## Non-Seasonal Holt-Winters
x <- uspop + rnorm(uspop, sd = 5)
m <- HoltWinters(x, gamma = FALSE)
plot(m)

## Exponential Smoothing
m2 <- HoltWinters(x, gamma = FALSE, beta = FALSE)
lines(fitted(m2)[,1], col = 3)

Bill

unread,
Sep 30, 2010, 11:28:29 PM9/30/10
to Houston R users
More time series stuff to play around with:

http://www.stat.pitt.edu/stoffer/tsa2/R_time_series_quick_fix.htm


Bill

Bill

unread,
Oct 2, 2010, 7:36:49 PM10/2/10
to Houston R users
Here are some of the links to the X12-ARIMA stuff that was discussed
at the meeting:

http://www.census.gov/srd/www/x12a/
http://cran.us.r-project.org/web/packages/x12/index.html

As you can see, this involves a multi-step process where the R
interface is very new. I haven't had a chance to play with it yet,
but I said I would post some links, so here it is.



Bill
> > lines(fitted(m2)[,1], col = 3)- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages