x**a 发帖数: 152 | 1 刚开始学习用SAS进行time series modeling,现在有一组数据X(t),想用ARIMA-GARCH
来fit,如果现在假设选择orders为ARIMA(6,1,1-GARCH(1,3),那么怎么样coding最方
便?
又或者用ARMA-GARCH,但是这种情况下AR的order可能是不连续的一个子集,比如说p=(1
2 24 48)这样,那么又该怎么实现最方便?能用一个proc autoreg完成吗?
顺便问一下GARCH model的p和q用什么方法来identify比较方便?我看了sas的帮助说根
据Q和LM检验,但是我现在得出的结果是1-12全部都是significant (p value <0.0001
),我又该怎么选呢?
因为是初学者,也不知道叙述的是否清楚合理,第一次发贴,请版上大牛不吝赐教!谢
谢! |
s*********e 发帖数: 1051 | 2 below was posted on my blog before and hope it helpful.
/************************************************
* ARMA - GARCH ESTIMATION USING PROC MODEL *
************************************************/
data garch;
lu = 0;
lh = 0;
ly = 0;
do i = 1 to 1000;
h = 0.3 + 0.4 * lu ** 2 + 0.5 * lh;
u = sqrt(h) * rannor(1);
y = 1 + 0.6 * (ly - 1) + u - 0.7 * lu;
lu = u;
lh = h;
ly = y;
output;
end;
run;
proc model data = garch;
parms ar1 ma1 mu;
y = mu + ar1 * zlag1(y - mu) + ma1 * zlag1(resid.y);
fit y / method = marquardt fiml white;
/* Nonlinear FIML Parameter Estimates
Approx Approx
Parameter Estimate Std Err t Value Pr > |t|
ar1 0.777183 0.0702 11.07 <.0001
ma1 0.841133 0.0639 13.16 <.0001
mu 1.020479 0.0392 26.01 <.0001
RESULT: ESTIMATION OF ARMA(1, 1) WITHOUT GARCH COMPONENT.
Heteroscedasticity Test
Equation Test Statistic DF Pr > ChiSq
y White's Test 89.85 9 <.0001
RESULT: WHITE'S TEST SUGGESTS HETEROSCEKASTICITY.
*/
test "AR1 = 0.6" ar1 = 0.6;
test "MA1 = 0.7" ma1 = 0.7;
/* Test Results
Test Type Statistic Pr > ChiSq
AR1 = 0.6 Wald 6.37 0.0116
MA1 = 0.7 Wald 4.88 0.0272
RESULT: ESTIMATES ARE DIFFERENT FROM SIMULATION PARAMETERS.
*/
run;
quit;
proc model data = garch;
parms ar1 ma1 mu arch0 arch1 garch1;
y = mu + ar1 * zlag1(y - mu) + ma1 * zlag1(resid.y);
h.y = arch0 + arch1 * xlag(resid.y ** 2, mse.y) +
garch1 * xlag(h.y, mse.y);
fit y / method = marquardt fiml out = forecast outall;
/* Nonlinear FIML Parameter Estimates
Approx Approx
Parameter Estimate Std Err t Value Pr > |t|
ar1 0.51709 0.1036 4.99 <.0001
ma1 0.658866 0.0866 7.61 <.0001
mu 0.989957 0.0257 38.54 <.0001
arch0 0.391227 0.0702 5.58 <.0001
arch1 0.398557 0.0539 7.39 <.0001
garch1 0.464724 0.0530 8.76 <.0001
RESULT: ESTIMATION OF ARMA(1, 1) WITH GARCH(1, 1).
*/
test "AR1 = 0.6" ar1 = 0.6;
test "MA1 = 0.7" ma1 = 0.7;
test "ARCH1 = 0.4" arch1 = 0.4;
test "GARCH1 = 0.5" garch1 = 0.5;
/* Test Results
Test Type Statistic Pr > ChiSq
AR1 = 0.6 Wald 0.64 0.4237
MA1 = 0.7 Wald 0.23 0.6347
ARCH1 = 0.4 Wald 0.00 0.9786
GARCH1 = 0.5 Wald 0.44 0.5059
RESULT: ESTIMATES ARE IN LINE WITH SIMULATION PARAMETERS.
*/
run;
quit; |
d*******o 发帖数: 493 | 3 '又或者用ARMA-GARCH,但是这种情况下AR的order可能是不连续的一个子集,比如说p=(
1
2 24 48)这样,那么又该怎么实现最方便?能用一个proc autoreg完成吗?'
Agree with statcompute. No way for proc autoreg. PROC MODEL has more
flexibility. You can expand his solution. |
x**a 发帖数: 152 | 4 非常谢谢statcompute和dapanmao!
那么如果需要ARIMA-GARCH,比如说是和Y(t-24)和y(t-24*7),(分别对应一天24小时
和一周24*7小时),有什么比较简单的方法在proc model里表现?
GARCH模型说不能参数估计converge 怎么办?
最后model validation (比如说residual analysis等)一般怎么做比较好。有没有比
较具体的例子吗?抱歉这些问题都很小白,但是对时间序列建模以及SAS变成都是菜鸟
级别,感觉不知道从哪里开始。或者看什么相关的统计建模教材比较有用? |
x**a 发帖数: 152 | 5 还有一个问题,在写模型的形式时写zlag1(y-mu),和直接用zlag(y)有什么区别吗,我
试验了一下发现得到的结果有一些偏差。
【在 s*********e 的大作中提到】 : below was posted on my blog before and hope it helpful. : /************************************************ : * ARMA - GARCH ESTIMATION USING PROC MODEL * : ************************************************/ : data garch; : lu = 0; : lh = 0; : ly = 0; : do i = 1 to 1000; : h = 0.3 + 0.4 * lu ** 2 + 0.5 * lh;
|
a*z 发帖数: 294 | 6 求 statcompute's blog address! |
x**a 发帖数: 152 | 7 铜球!
【在 a*z 的大作中提到】 : 求 statcompute's blog address!
|
w*******t 发帖数: 364 | |
x**a 发帖数: 152 | |