R and Ox, interfacing "garchOxFit" installation instructions (for Windows OS) 2006-03-30, DSM (matteson@uchicago.edu) Business 41202: Analysis of Financial Time Series (FTS) Instructor: Ruey S. Tsay Class webpage: http://gsbwww.uchicago.edu/fac/ruey.tsay/teaching/bs41202/ (all necessary links are found at the above class page under "R and Ox") #################################### 1) Download and install R: FTS class page click: Download R here Under Download on left side click: CRAN Choose a local mirror, e.g. http://rh-mirror.linux.iastate.edu/CRAN/ Iowa State University. Choose platform, e.g. Windows (95 and later) Select "base" (Binaries for base distribution (managed by Duncan Murdoch)) Save and run Setup program: R-2.2.1-win32.exe #################################### 2) Download and install Ox Console: FTS class page click: Download Ox here. Under Chapter contents, click: Packages Click link at the end of the following "The following packages are currently available for downloading, with up-to-date links and additional packages provided here:" Under Ox Console, click: Download Ox Console (all platforms) "The Console version of Ox may be used without paying a fee for academic research, study and teaching purposes only!" Fill in the information and agree to the terms. Check your email after a couple minutes, find link at bottom of message: Ex: =========================================================== *** For Ox Console downloads (all platforms), go to : http://www.doornik.com/download/..../.... =========================================================== Ox Console 3.4 for Windows 2000/NT/9x (.exe, 3.5MB), choose a download site (you can use right-click to save to installation file): Install oxcons340.exe in a new directory "C:\Ox" if you install it somewhere else you will need to edit some scripts for R to find it. #################################### 3) Download and install G@RCH 4.0: Create a new directory(folder) on your PC: C:\Ox\Packages FTS class page click: Download G@RCH here. Under "News...News...News..." click: A free (console) version is just "ONE CLICK AWAY" Download "garch_v40.zip" and unzip into "C:\Ox\Packages" #################################### 4) Install fSeries package for R: Make sure an up to date version of R is installed (at least v2.2.0) if you skipped step 1 above. From within R select Packages -> Install Package(s)... Choose your CRAN mirror if necessary and select fSeries, click "OK". If other packages are also required (e.g. fBasics). Agree to install them as well. You may already have this package installed, if so update the package instead. #################################### 5) Installation of the interface: copy the file "GarchOxModelling.ox" from "\fSeries\data" to "C:\Ox\lib". (e.g "C:\...\R-2.2.0\library\fSeries\data") #################################### 6) Download a corrected version of the garchOxFit function from Kung-Sik Chan: FTS class page click: A corrected version pf the garchOxFit function Save as... garchoxfit_R.txt in your R work folder with personal functions/libraries #################################### 7) Using garchOxFit function in R: Begin each R session with the following commands after changing your working directory: >library(fSeries) >source("garchoxfit_R.txt") The function usage is: > garchOxFit function (formula.mean = ~arma(0, 0), formula.var = ~garch(1, 1), series = x, cond.dist = c("gaussian", "t", "ged", "skewed-t"), include.mean = TRUE, truncation = 100, trace = TRUE, title = NULL, description = NULL,arch.in.mean=0) For information on package 'fSeries': >library(help="fSeries") #################################### 8) A (dated) tutorial of G@RCH (but not for the R interface): FTS class page click: A (dated) tutorial of G@RCH.