恩,谢谢方老师。
前几天特忙,昨天晚上才有时间试一下,确实是安装路径有问题,问题四如您所言
安装路径我参考了您提供的说明文档,又参考了GARCH in R,您课件code中的m3和m1命令就可以运行了。code中其他的命令我还没有试。
GARCH in R
This article is provided by professor Zongwu Cai from University of North Carolina at Challotte and the copyright belongs to him.
Ps: The directory can be disigned as you want.
####################################
1) Download and install R:
After you install R, please install R packages (fBasics, fSeries, tseries, nnet, evir). During the installation, please use default directory of the R
C:\Program Files\R\R-2.6.1
From within R select Packages -> Install Package(s)...
Choose your CRAN mirror if necessary and select fBasics, fSeries, tseries, nnet, evir, click "OK".
If other packages are also required (e.g. fBasics). Agree to install them as well.
You may already have this package installed in your computer, if so, please update the package instead.
####################################
2) Install Ox Console:
Download Ox Console 4.10 for Windows XP/2000/NT/9x (.exe, 4MB) from following link:
http://www.doornik.com/download/b736gw/oxcons.html
Install 'oxcons410.exe' in the default directory C:\Program Files\OxMetrics4, then copy the whole subdirectory 'Ox' to 'C:\'.
####################################
3) Download and install G@RCH 4.2:
Download garch42.zip from following link:
http://www.core.ucl.ac.be/~laurent/G@RCH/site/xbdcons/garch42.zip
Create a new directory (folder) on your PC: C:\Ox\Packages
[The subdirectory "packages" might exist already. In this case, you do not need to create one.]
Unzip "garch42.zip" into "C:\Ox\Packages"
4) Installation of the interface:
Download “GarchOxModelling.ox” from
http://www.math.uncc.edu/~zcai/GarchOxModelling.ox
and copy the file "GarchOxModelling.ox" to "C:\Ox\lib".
5) Download a corrected version of the garchOxFit function from
http://www.math.uncc.edu/~zcai/garchoxfit_R.txt
Save the file “garchoxfit_R.txt” in your R working directory, say save it into c:\Ox\lib
####################################
6) Using garchOxFit function in R:
Begin each R session with the following commands after changing your working directory:
>library(fSeries)
>source("c:/Ox/lib/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")