bang4kimo 发表于 2012-2-27 14:46 
我覺得應該是要這樣改
底下建立vecm model与在e-views结果相同.
open data 12345_plas.xls
data(format=xls,org=columns) 1 1990 EX PLAS
set lex = log(ex)
set lplas = log(plas)
set dlex = lex-lex{1}
set dlplas = lplas-lplas{1}
*Using VARLagSelect
@varlagselect(lags=6,crit=aic)
#lex lplas
@varlagselect(lags=6,crit=bic)
#lex lplas
*Use @JohMLE to test the cointegrating rank
*RC restricts a
constant to the CV.
@johmle(lags=2,det=rc,cv=cvector)
# lex lplas
*-32.943952 -4.664164 138.156062
*Setting the Cointegrating Vectors
set ect = lex+(-4.664164/-32.943952)*lplas+(138.156062/-32.943952)
system(model=ectmodel)
variables dlex dlplas
det dlex{1} dlplas{1} ect{1}
end(system)
estimate
garch(p=1,q=1,model=ectmodel,mv=CC,variances=varma,pmethod=simplex,piters=10) / dlex dlplas
###Result
VAR Lag Selection
Lags AICC
0 -7915.392
1 -27573.420
2 -27690.568*
3 -27686.446
4 -27684.223
5 -27680.034
6 -27676.404
VAR Lag Selection
Lags SBC/BIC
0 -7904.210
1 -27539.884
2 -27634.694*
3 -27608.252
4 -27583.724
5 -27557.248
6 -27531.346
Likelihood Based Analysis of Cointegration
Variables: LEX LPLAS
Estimated from 3 to 1990
Data Points 1988 Lags 2 with Constant restricted to Cointegrating Vector
Unrestricted eigenvalues and -T log(1-lambda)
Rank EigVal Lambda-max Trace Trace-95% LogL
0 13875.4709
1 0.0082 16.3881 21.0371 20.1600 13883.6650
2 0.0023 4.6490 4.6490 9.1400 13885.9895
Cointegrating Vector for Largest Eigenvalue
LEX LPLAS
Constant
-32.943952 -4.664164 138.156062
VAR/System - Estimation by Least Squares
Usable Observations 1988
Dependent Variable DLEX
Mean of Dependent Variable -0.000056503
Std Error of Dependent Variable 0.003859426
Standard Error of Estimate 0.003772583
Sum of Squared Residuals 0.0282512779
Durbin-Watson Statistic 2.0112
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. DLEX{1} -0.197217952 0.022550732 -8.74552 0.00000000
2. DLPLAS{1} -0.012928663 0.005830038 -2.21760 0.02669531
3. ECT{1} -0.010949180 0.002787445 -3.92803 0.00008857
Dependent Variable DLPLAS
Mean of Dependent Variable 0.0002526575
Std Error of Dependent Variable 0.0149844276
Standard Error of Estimate 0.0148682946
Sum of Squared Residuals 0.4388163770
Durbin-Watson Statistic 2.0013
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. DLEX{1} -0.286770831 0.088875693 -3.22665 0.00127287
2. DLPLAS{1} 0.078548137 0.022977022 3.41855 0.00064227
3. ECT{1} 0.021328734 0.010985724 1.94150 0.05233954
MV-GARCH, CC with VARMA Variances - Estimation by BFGS
Convergence in 50 Iterations. Final criterion was 0.0000002 <= 0.0000100
Usable Observations 1988
Log Likelihood 14772.1370
Variable Coeff Std Error T-Stat Signif
************************************************************************************
1. DLEX{1} 0.1119 0.0262 4.27376 0.00001922
2. DLPLAS{1} 6.3905e-003 2.7082e-003 2.35968 0.01829052
3. ECT{1} -2.7697e-003 1.1520e-003 -2.40418 0.01620858
4. DLEX{1} -0.2148 0.0615 -3.49070 0.00048175
5. DLPLAS{1} 0.0726 0.0246 2.95159 0.00316138
6. ECT{1} 0.0194 9.2769e-003 2.09551 0.03612601
7. C(1) 2.8101e-007 9.9215e-008 2.83240 0.00462007
8. C(2) 1.5275e-006 5.9145e-007 2.58257 0.00980679
9. A(1,1) 0.3345 0.0325 10.28299 0.00000000
10. A(1,2) 0.0162 3.8395e-003 4.21287 0.00002521
11. A(2,1) -0.0336 0.0378 -0.88964 0.37366150
12. A(2,2) 0.0451 0.0118 3.81509 0.00013613
13. B(1,1) 0.7402 0.0158 46.83072 0.00000000
14. B(1,2) -6.1707e-003 0.0136 -0.45328 0.65034634
15. B(2,1) 0.0896 0.0462 1.93839 0.05257527
16. B(2,2) 0.9523 0.0127 74.84755 0.00000000
17. R(2,1) -0.2958 0.0198 -14.91109 0.00000000