全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 统计软件培训班VIP答疑区
4915 2
2009-08-30
感谢方老师上次的解答,我以前的安装是按照在您视频时打开的ox网页地址下载的ox,我卸载了,安装的是您讲义中ox软件,不过觉得还是有些问题:

1、安装路径
默认的还是programes下的安装路径,但是不管是默认的C:\Program Files\OxMetrics5安装路径,还是C:\OxMetrics5安装路径,
都和您提供的把ox引入带R中的代码(见下一行代码)的路径不一致

command = "C:\\OX\\OxMetrics5\\Ox\\bin\\oxl.exe C:\\OX\\OxMetrics5\\Ox\\lib\\GarchOxModelling_w.ox"

2、并且运行
m3=garchOxFit(formula.mean=~arma(0,0),formula.var=~garch(0,3),series=intc)
m1=garchOxFit(formula.mean=~arma(0,0),formula.var=~garch(0,1),series=intc)
这两个代码均会有下面的Warning message:

> m3=garchOxFit(formula.mean=~arma(0,0),formula.var=~garch(0,3),series=intc)
Warning message:
In system(command, show.output.on.console = trace, invisible = TRUE) :
  C:\OX\OxMetrics5\Ox\bin\oxl.exe not found
> m1=garchOxFit(formula.mean=~arma(0,0),formula.var=~garch(0,1),series=intc)
Warning message:
In system(command, show.output.on.console = trace, invisible = TRUE) :
  C:\OX\OxMetrics5\Ox\bin\oxl.exe not found

3、运行m3和m1后,再运行names(m1)会显示如下信息,因为我不知道下面的信息是否和您执行的命令的返回结果时候一致,所以列出来供您比较参考。
[1] "x"            "csts"         "cond.dist"    "arma.orders"  "arfima"       "garch.orders" "arch.in.mean" "model"        "ox"           "call"         "residuals"   
[12] "condvars"     "coef"         "title"        "description"


4、另外,执行下述代码只会产生一行一列的图形,而不是par(mfco=c(2,1))要求的两行一列,所以我想一定是哪里出了问题
par(mfco=c(2,1))
plot(intc,type="l")
plot(sqrt(m1$condvars),type="l")


还请方老师您释疑,感谢中!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2009-8-31 20:42:53
你好!
问题1,2。应该是你没安装正确或是引用正确。你现在可以按我给的路径重新安装试试,如果安装后对应路径没有oxl.exe或GarchOxModelling_w.ox,你可以从其他目录拷到对应的目录下。然后再执行一下。
问题3 的object基本上这些
问题4,你的par(mfco=c(2,1))错误,应该是par(mfcol=c(2,1))或是par( mfrow=c(2,1))
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-9-8 19:53:08
恩,谢谢方老师。
前几天特忙,昨天晚上才有时间试一下,确实是安装路径有问题,问题四如您所言
安装路径我参考了您提供的说明文档,又参考了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")
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群