Front Cover
Other Information
Errata & Clarifications
Diving for Pearls
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. Be sure to check out R Tips. 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 extensions, but they are ascii files that can be opened with any text editor (like notepad).
| CHAPTER 1 eq5exp6.dat fmri.dat globtemp.dat jj.dat nyse.dat recruit.dat soi.dat soiltemp.dat speech.dat |
CHAPTER 2 cmort.dat gas.dat oil.dat part.dat temp.dat varve.dat LApollution |
CHAPTER 3 ar1boot.dat birth.dat globtemp2.dat gnp96.dat prod.dat so2.dat unemp.dat |
CHAPTER 4 salt.dat sunspots.dat |
| CHAPTER 5 flu.dat fracdiff.dat lead.dat prob513.dat sales.dat sdyr.dat |
CHAPTER 6 ar1miss.dat Folland.dat HL.dat Jones.dat Newbold.dat |
CHAPTER 7 beamd.dat bnrf1ebv.dat bnrf1hvs.dat ch7fmri.dat clim-hyd.dat econ5.dat eq+exp.dat |
EVERYTHING data.zip (for windows) data.tar.gz (for unix) |
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:
- In Chapter 2, Example 2.6, there's code to duplicate Figure 2.8, the lag plots of one series versus another. I wrote a small script for that called lag.plot2. The basic call is lag.plot2(x1,x2,m) and the result is a grid of scatterplots of x1(t-h) versus x2(t) for h = 0, 1,..., m. For example, lag.plot2(soi,rec,8) will reproduce Figure 2.8. There's also something called lag.plot1 that is similar to R's lag.plot but it comes with some extra bells and whistles. Details are on the Examples page.
- To help with modeling in Chapter 3, here's an R script that will plot the ACF and PACF of a time series at the same time on the SAME SCALE, and it leaves out the zero lag in the ACF: acf2. If your time series is in x and you want the ACF and PACF of x to lag 50, the call to the function is acf2(x,50). The number of lags is optional, so acf2(x) will use a default number of lags [√n + 10, where n is the number of observations].
- We also have something that makes it easier to fit ARIMA models (both seasonal and non-seasonal). For lack of a better name, it's called sarima: sarima. If your time series is in x and you want to fit an ARIMA(p,d,q) model to your data, the call is sarima(x,p,d,q). The results are the parameter estimates, standard errors, AIC, AICc, BIC and diagnostics. To fit a seasonal ARIMA model, the call is sarima(x,p,d,q,P,D,Q,s).
- If you want to obtain forecasts after a suitable model is chosen, you can use sarima.for in a similar manner to sarima. The call for the non-seasonal case is sarima.for(x,n.ahead,p,d,q) and the call for the seasonal case is sarima.for(x,n.ahead,p,d,q,P,D,Q,s), where n.ahead specifies the number of steps ahead you want to forecast.
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 ExamplesR 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 ExamplesASTSA
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.
- Our web pages render beautifully with Firefox: