Time Series Analysis and Its Applications: With R Examples

Second Edition

This is the site for the second edition of the text and is no longer maintained

Follow this link if you're looking for the site of the 4th edition


Getting Started With R

  • To download R, go to CRAN. The installation includes help files and some user manuals. In addition, you can find helpful tutorials by following CRAN's link to Contributed Documentation. If you're new to R/Splus, then R for Beginners is a great introduction. There's also a lot of advice out there in cyberspace, but some of it will be outdated because R goes through many revisions.
  • Here's a little tutorial on R and time series analysis: an R time series quick fix.
  • Here are some issues we have with R and time series analysis: R issues.

Data Files

The data files below are listed according to the chapter in which they are first presented. Most of the data files are one long column, even if they contain more than one series. Some data files are in multicolumn formats. It would be a good idea to look at the file before you use it. As you can see, the data files have .dat.txt extensions, but they are ascii files that can be opened with any text editor (like notepad).


CHAPTER 1
eq5exp6.dat.txt
fmri.dat.txt
globtemp.dat.txt   
jj.dat.txt
nyse.dat.txt
recruit.dat.txt
soi.dat.txt
soiltemp.dat.txt
speech.dat.txt
CHAPTER 2
cmort.dat.txt
gas.dat.txt
oil.dat.txt
part.dat.txt
temp.dat.txt
varve.dat.txt LApollution


CHAPTER 3
ar1boot.dat.txt
birth.dat.txt
globtemp2.dat.txt
gnp96.dat.txt
prod.dat.txt
so2.dat.txt
unemp.dat.txt


CHAPTER 4
salt.dat.txt
sunspots.dat.txt







CHAPTER 5
flu.dat.txt
fracdiff.dat.txt
lead.dat.txt
prob513.dat.txt
sales.dat.txt
sdyr.dat.txt

CHAPTER 6
ar1miss.dat.txt
Folland.dat.txt
HL.dat.txt
Jones.dat.txt
Newbold.dat.txt


CHAPTER 7
beamd.dat.txt
bnrf1ebv.dat.txt
bnrf1hvs.dat.txt
ch7fmri.dat.txt
clim-hyd.dat.txt
econ5.dat.txt
eqexp.dat.txt
EVERYTHING
data.zip
(for windows)

data.tar.gz
(for unix)



anything below this line is very old and useless



R Code That May Be Useful for Class

  • Here's a list of the R code used in the examples in Chapters 1 to 5: R code used in the text.
  • A few useful scripts: Below are a few R scripts that may be helpful. You can get all of the code listed below in one file: itall.R. Just download the file to a convenient location and then "source" it. For information on how to source code, details and some examples, go here: EXAMPLES. Brief descriptions follow:
    • lag.plot2 can be used to get a grid of lagged scatterplots of one series versus another (as in Figure 2.8).
    • lag.plot1 is similar to R's lag.plot but it comes with some extra bells and whistles.

    • acf2 will give you both the sample ACF and PACF of a series... you get the values and a nice graphic.
    • sarima can be used to easily and quickly fit both seasonal and nonseasonal ARIMA models.
    • sarima.for is a companion to sarima and it gives the desired forecasts along with a nice graphic.
    • spec.arma can be used to exhibit the spectral density of a specified ARMA model. It can also be used to check causality and invertibility conditions of the model.

    If any or all of these sound intriguing, head on over to EXAMPLES for details and examples.

R Code and Examples for Chapter 6

... has been moved to Chapter 6 R Scripts and Examples

R and Matlab Code and Examples for Chapter 7

... was never here in the first place and it's still not here. But you can find it at Chapter 7 Code and Examples

ASTSA

astsa is now an R package ... for more details, go the page for the third edition tsa3

(the stuff below is old)

ASTSA is a Windows time series package that is distributed as Freeware and is provided “As is” without warranty of any kind, either expressed or implied. ASTSA may not be distributed as a component of any commercial product without a prior license agreement with the authors. If you do not agree with these terms, do not download the program. If you have questions about ASTSA, please contact RHS. Just so you know, ASTSA was written in Visual Basic 3, so it's a 16-bit application (think Windows 3.1). It seems to have held up and runs on XP with high probability. It's anyone's guess if it will run on Vista. ASTSA hasn't been supported for a long time, and there won't be any updates.

  • To install ASTSA, download ASTSAsetup.exe (less than 1 mb) to your desktop and run the setup program.
  • If you prefer, you can get ASTSA in a zipped archive: astsa.zip. Just download astsa.zip, unzip it to a convenient location, and put a shortcut to astsa.exe on your desktop and/or your start menu.
  • You can uninstall the program by simply deleting the ASTSA directory and any shortcuts that were created. ASTSAsetup puts one shortcut on the desktop and another on the Start-Programs menu.
  • You might also want the ASTSA manual. Many of the data sets used in the text are included with ASTSA - click here for details.

STuFF - LinKs and Other Useful Info

  • To request an evaluation copy of the text or to request an instructor's manual, follow this link to Springer. This will take you to the site for North America. You can select a different region from a menu at the top of the page.
  • This is a good Complex Numbers Primer, in case you are a bit rusty and need a good coat of primer.
  • If you are still data hungry, you can find lots of time series data here: StatLib Datasets. Just search on key words time series.
  • Anthony Brockwell has an open source time series package that runs on Windows and Linux called Cronos. You can use it to fit ARIMA, ARFIMA, GARCH, and Stochastic Volatility models using both Bayesian and frequentist analyses.
  • There are at least three R packages that facilitate state space modeling: DLM, DSE, and SSPIR.