epoh 发表于 2011-11-2 16:33 
先改一个tar_rate.R供你参考.jiezi.txt tar_rate.R 请自行参照更改tar_ci.R,ur_rate.R不过你的数据有问题 ...
epoh 老师你好
我按你说的方法 里面完全复制你里面的 tar_rate.rar
tar_ci.R 里改成
#dat <- read.table("zeroyld.dat")
#datstore <- dat[1:nrow(dat),(7:62)]
#rs <- rbind(as.matrix(seq(0,18,1)),21,24,30,as.matrix(seq(36,(36+7*12),12)))
#data(zeroyld)
#datstore<-zeroyld
datstore=read.table("jiezi.txt")
rs=c(1,2)
rates_i <- matrix(c(1,2),1,2)
rates_i
上面的control改成
gn <- 30 # number of gridpoints for gamma
bn <- 30 # number of gridpoints for beta
ur_rate.R也做了类似改动
然后先运行tar_ci.R
出来
**********************************************************
Number of Bootstrap Replications 5000
Number of Gridpoints for threshold 30
Estimated Cointegrating Vector
Number of Gridpoints for ci vector 30
错误于cat("Long Rate (month): ", long, "\n") : 找不到对象'long'
再运行tar_rate.R
出来
**********************************************************
Number of Bootstrap Replications 5000
Number of Gridpoints for threshold 300
Cointegrating Vector fixed at 1
**********************************************************
Long Rate (month): 2
Short Rate (month): 1
Number of VAR lags: 1
Linear VECM Estimates
Cointegrating Vector 1
Negative Log-Like -19.11605
AIC -3.116053
BIC -7.416869
Equation 1
-0.5267066 0.1586
3.5619265 1.0860
0.3454491 0.1908
-1.0579601 1.0998
Equation 2
0.0431858 0.0162
-0.2902415 0.1348
-0.0004176 0.0176
0.6190880 0.1442
错误于if (min(rbind(n1, (t - n1)))/t > trim) { :
需要TRUE/FALSE值的地方不可以用缺少值
再运行ur_rate.R
出来
**********************************************************
Number of Bootstrap Replications 5000
**********************************************************
Long Rate (month): 2
Short Rate (month): 1
Number of VAR lags: 1
ADF test -3.935788
Estimated CI vector 12.50954 -0.8366052
Engle-Granger test -3.964176
错误于t(x1) %*% sim1 : 非整合参数
这样之后在运行tar_ci.R
就完全出来了 效果和原程序一样
不知道为什么 不过已经能全出来了
很感谢您!!!