計(jì)量經(jīng)濟(jì)學(xué)的各種檢驗(yàn).ppt_第1頁
計(jì)量經(jīng)濟(jì)學(xué)的各種檢驗(yàn).ppt_第2頁
計(jì)量經(jīng)濟(jì)學(xué)的各種檢驗(yàn).ppt_第3頁
計(jì)量經(jīng)濟(jì)學(xué)的各種檢驗(yàn).ppt_第4頁
計(jì)量經(jīng)濟(jì)學(xué)的各種檢驗(yàn).ppt_第5頁
已閱讀5頁,還剩55頁未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

1、b,1,經(jīng)濟(jì)計(jì)量學(xué)的幾種檢驗(yàn),b,2,多重共線性,.Multicollinearity arises because we have put in too many variables that measure the same thing. As the degree of multicollinearity increases, the regression model estimates of the coefficients become unstable and the standard errors for the coefficients can get wildly infla

2、ted. Measure :vif, tol=1/vif,condition index;etc.,b,3,多重共線性的后果,1.存在完全多重共線性時(shí),參數(shù)的估計(jì)值無法確定,而且估計(jì)值的方差變?yōu)闊o窮大. 2.存在不完全多重共線性時(shí),可以估計(jì)參數(shù)值,但是數(shù)值不穩(wěn)定,而且方差很大. 3.多重共線性會(huì)降低預(yù)測(cè)的精度,甚至失效,增大零假設(shè)接受的可能性(t值變小).,b,4,多重共線性的檢測(cè)方法(1)樣本可決系數(shù)法,如果樣本的可決系數(shù)R-square 比較大,且回歸系數(shù)幾乎沒有統(tǒng)計(jì)上的顯著性,則可認(rèn)為存在多重共線性。 Theil 提出了一個(gè)指標(biāo):多重共線性效應(yīng)系數(shù),b,5,Theil test resu

3、lts,Sas 結(jié)果: 結(jié)果表明有多重共線性。,b,6,多重共線性檢測(cè)方法(2)輔助回歸檢驗(yàn)法,若存在多重共線性,則至少有一個(gè)解釋變量可精確或近似地表示為其余皆是變量的線性組合。 相應(yīng)的檢驗(yàn)統(tǒng)計(jì)量為:,b,7,輔助回歸檢驗(yàn)結(jié)果,Sas 結(jié)果: Klein經(jīng)驗(yàn)法則:若存在一個(gè)i,使得 R(i)-squareR-square,則認(rèn)為多重共線性嚴(yán)重;本例中x1,x3有多重共線性。,b,8,多重共線性檢驗(yàn)方法(3)樣本相關(guān)系數(shù)檢驗(yàn)法,b,9,FG test results,fg=20.488013401 p=0.0001344625; 拒絕零假設(shè),認(rèn)為存在多重共線性。 具體那些變量之間存在多重共線性,

4、除了上面提到的輔助回歸的方法外,還有以下提到的條件數(shù)檢驗(yàn)和方差膨脹因子法。,b,10,多重共線性檢驗(yàn)方法:(4)特征值分析法所用的檢驗(yàn)統(tǒng)計(jì)指標(biāo),; 為第k各自變量和其余自變量回歸的可決系數(shù). VIF10,有多重共線性;TOL=1/VIF; 條件指數(shù): 條件數(shù): ;C20,共線性嚴(yán)重.,b,11,多重共線性的檢驗(yàn)和補(bǔ)救,例一:進(jìn)口總額和三個(gè)自變量之間回歸; Sas 結(jié)果如下:Pearson Correlation Coefficients, N = 11 Prob |r| under H0: Rho=0 x1 x2 x3 x1 1.00000 0.02585 0.99726 GDP 0.9399

5、 .0001 x2 0.02585 1.00000 0.03567 存蓄量 0.9399 0.9171 x3 0.99726 0.03567 1.00000 總消費(fèi) .0001 0.9171 從上面可以看出x1和x3線性相關(guān)嚴(yán)重.,b,12,多重共線性的檢驗(yàn)和補(bǔ)救,(2)回歸結(jié)果: Parameter Estimates Parameter Standard Variance Variable DF Estimate Error t Value Pr |t| Inflation Intercept 1 -10.12799 1.21216 -8.36 .0001 0 x1 1 -0.05140

6、0.07028 -0.73 0.4883 185.99747 x2 1 0.58695 0.09462 6.20 0.0004 1.01891 x3 1 0.28685 0.10221 2.81 0.0263 186.11002 發(fā)現(xiàn)x1的系數(shù)為負(fù),和現(xiàn)實(shí)經(jīng)濟(jì)意義不符,出現(xiàn)原因就是x1 和x3之間的線性相關(guān).,b,13,補(bǔ)救措施,增加樣本;嶺回歸或主分量回歸; 至少去掉一個(gè)具有多重共線性的變量;對(duì)具有多重共線性的變量進(jìn)行變換. 對(duì)所有變量做滯后差分變換(一般是一階差分),問題是損失觀測(cè)值,可能有自相關(guān). 采用人均形式的變量(例如在生產(chǎn)函數(shù)估計(jì)中) 在缺乏有效信息時(shí),對(duì)系數(shù)關(guān)系進(jìn)行限制,變?yōu)橛屑s

7、束回歸(Klein,Goldberger,1955),可以降低樣本方差和估計(jì)系數(shù)的標(biāo)準(zhǔn)差,但不一定是無偏的(除非這種限制是正確的). 對(duì)具有多重共線性的變量,設(shè)法找出其因果關(guān)系,并建立模型和原方程構(gòu)成聯(lián)立方程組.,b,14,嶺回歸,嶺回歸估計(jì): K=0, b(k)=b即為OLSE; K的選取: 即使b(k)的均方誤差比b的均方誤差小.,b,15,嶺跡圖,b,16,嶺回歸結(jié)果,Obs _MODEL_ _TYPE_ _DEPVAR_ _RIDGE_k _PCOMIT_ _RMSE_ Intercept x1 x2 x3 y 1 MODEL1 PARMS y 0.48887 -10.1280 -0.

8、051 0.58695 0.287 -1 2 MODEL1 RIDGEVIF y 0.00 方差膨脹因子 185.997 1.01891 186.110 1 3 MODEL1 RIDGE y 0.00 0.48887 -10.1280 -0.051 0.58695 0.287 1 4 MODEL1 RIDGEVIF y 0.01 8.599 0.98192 8.604 -1 5 MODEL1 RIDGE y 0.01 0.55323 -9.1805 0.046 0.59886 0.144 1 6 MODEL1 RIDGEVIF y 0.02 2.858 0.96219 2.859 -1 7 M

9、ODEL1 RIDGE y 0.02 0.57016 -8.9277 0.057 0.59542 0.127 -1 8 MODEL1 RIDGEVIF y 0.03 1.502 0.94345 1.502 -1 9 MODEL1 RIDGE y 0.03 0.57959 -8.7337 0.061 0.59080 0.120 -1 10 MODEL1 RIDGEVIF y 0.04 0.979 0.92532 0.979 -1 11 MODEL1 RIDGE y 0.04 0.58745 -8.5583 0.064 0.58591 0.116 -1,b,17,主分量回歸,主分量回歸是將具有多重

10、相關(guān)的變量集綜合得出少數(shù)幾個(gè)互不相關(guān)的主分量. 兩步:(1)找出自變量集的主分量,建立y與互不相關(guān)的前幾個(gè)主分量的回歸式.(2)將回歸式還原為原自變量結(jié)果. 詳見,方開泰;,b,18,主分量回歸結(jié)果,Obs _MODEL_ _TYPE_ _DEPVAR_ _PCOMIT_ _RMSE_ Intercept x1 x2 x3 y 1 MODEL1 PARMS y 0.48887 -10.1280 -0.05140 0.58695 0.28685 1 2 MODEL1 IPCVIF y 1 0.25083 1.00085 0.25038 1 3 MODEL1 IPC y 1 0.55001 -9.

11、1301 0.07278 0.60922 0.10626 1 4 MODEL1 IPCVIF y 2 0.24956 0.00095 0.24971 -1 5 MODEL1 IPC y 2 1.05206 -7.7458 0.07381 0.08269 0.10735 -1,b,19,主分量回歸結(jié)果,由輸出結(jié)果看到在刪去第三個(gè)主分量(pcomit=1)后的主分量回歸方程: Y=-9.1301+0.07278x1+0.60922x2+0.10626x3; 該方程的系數(shù)都有意義,且回歸系數(shù)的方差膨脹因子均小于1.1;主分量回歸方程的均方根誤差(_RMSE=0.55) 比普通OLS方程的均方根誤差(

12、_RMSE=0.48887) 有所增大但不多。,b,20,Sas 程序,data ex01; input x1 x2 x3 y; label x1=國內(nèi)生產(chǎn)總值; label x2=存儲(chǔ)量; label x3=消費(fèi)量; label y=進(jìn)口總額; cards; 149.3 4.2 108.1 15.9 161.2 4.1 114.8 16.4 171.5 3.1 123.2 19.0 175.5 3.1 126.9 19.1 180.8 1.1 132.1 18.8 190.7 2.2 137.7 20.4 202.1 2.1 146 22.7 212.4 5.6 154.1 26.5 226

13、.1 5.0 162.3 28.1 231.9 5.1 164.3 27.6 239.0 0.7 167.6 26.3 ; run;,proc corr data=ex01; var x1-x3; run; *嶺回歸*; proc reg data=ex01 outest=ex012 graphics outvif; model y=x1-x3/ridge=0.0 to 0.1 by 0.01; plot/ridgeplot; run; proc print data=ex012;run; *主分量回歸法*; proc reg data=ex01 outest=ex103; model y=x

14、1-x3/pcomit=1,2 outvif;*pcomit表示刪去最后面的1或2個(gè)主分量,用前面m-1或 m-2各主分量進(jìn)行回歸*; run; proc print data=ex103;run;,b,21,Sas 程序,/*theil test*/; proc reg data=ex01; equation3:model y=x1 x2; equation2:model y=x1 x3; equation1:model y=x2 x3; run;/*r-.9473;r3s=0.9828*/; data theil; rsq=0.9919;r1s=0.9913;r2s=0.9473;r3s=

15、0.9828; theil=rsq-(3*rsq-(r1s+r2s+r3s);put theil=; run; /*輔助回歸檢驗(yàn)法*/; proc reg data=ex01; equation3:model x3=x1 x2; equation2:model x2=x1 x3; equation1:model x1=x2 x3; run;,/*FG test*/; proc corr data=ex01 outp=corr nosimple;var x1-x3;run; proc print data=corr;run; title 計(jì)算相關(guān)矩陣的行列式; proc iml; R=1.000

16、 0.026 0.997,0.026 1 0.036,0.9152 0.6306 1; d=det(R); print d; run;/*d=0.081371*/; title 計(jì)算檢驗(yàn)統(tǒng)計(jì)量及其p值; data fg; n=11;p=3;d=0.081371; fg=-(n-1-1/6*(2*p+5)*log(d);df=p(p-1)/2; p=1-probchi(fg,df); put fg= p=; run;/*fg=20.488013401 p=0.0001344625,拒絕零假設(shè)*/;,b,22,異方差的檢驗(yàn)和補(bǔ)救,OLSE unbiased,inefficient;t, F tes

17、t invalid; forecast accuracy decreased. If the model is well-fitted, there should be no pattern to the residuals plotted against the fitted values. If the variance of the residuals is non-constant, then the residual variance is said to be heteroscedastic.,b,23,異方差的檢測(cè),There are graphical and non-grap

18、hical methods for detecting heteroscedasticity. A commonly used graphical method is to plot the residuals versus fitted (predicted) values. Example :grade:educated years;potexp:working years;exp2=potexp2;union:dummy variable.,b,24,收入方程回歸的結(jié)果,Dependent Variable: LNWAGE Analysis of Variance Sum of Mean

19、 Source DF Squares Square F Value Pr F Model 4 12.42236 3.10559 14.06 |t| Intercept 1 0.59511 0.28349 2.10 0.0384 GRADE 1 0.08354 0.02009 4.16 .0001 POTEXP 1 0.05027 0.01414 3.56 0.0006 EXP2 1 -0.00056172 0.00028785 -1.95 0.0540 UNION 1 0.16593 0.12445 1.33 0.1856,b,25,圖示法檢測(cè),利用殘差平和對(duì)因變量的預(yù)測(cè)值做散點(diǎn)圖 如右圖所示

20、:殘差變化不大,因此認(rèn)為沒有異方差存在.,b,26,懷特檢驗(yàn),Sas程序結(jié)果: Analysis of Varianc Sum of Mean Source DF Squares Square F Value Pr F Model 12 1.18881 0.09907 0.88 0.5731 Error 87 9.83078 0.11300 Corrected Total 99 11.01958 Root MSE 0.33615 R-Square 0.1079 Dependent Mean 0.20989 Adj R-Sq -0.0152 Coeff Var 160.15281 Paramet

21、er Standard Variable DF Estimate Error t Value Pr |t| Intercept 1 -0.07767 0.98580 -0.08 0.9374 GRADE 1 -0.01220 0.12502 -0.10 0.9225 POTEXP 1 0.07784 0.07188 1.08 0.2819 EXP2 1 -0.00399 0.00409 -0.97 0.3325 UNION 1 0.64879 0.86160 0.75 0.4535 grade2 1 0.00220 0.00425 0.52 0.6065 exp4 1 -3.34378E-7

22、0.00000151 -0.22 0.8256 exp3 1 0.00006170 0.00014192 0.43 0.6648 gx2 1 0.00011683 0.00011102 1.05 0.2955 gp 1 -0.00375 0.00494 -0.76 0.4498 gu 1 -0.05137 0.04430 -1.16 0.2494 pu 1 0.00193 0.06061 0.03 0.9746 eu 1 -0.00022185 0.00126 -0.18 0.8605,殘差項(xiàng)平方對(duì)所有一階,二階及交叉項(xiàng)回歸. 1.由左邊的結(jié)果可知: 故同方差的假設(shè)未被拒絕. 2.Proc r

23、eg data=aa; Model y=x/spec; Run; 可得到相同的結(jié)果。,b,27,布羅施-帕甘/戈弗雷檢驗(yàn)懷特檢驗(yàn)的特例,(1)OLS殘差額et和一個(gè)估計(jì)的干擾誤差 (2)用OLS將 對(duì)選中的解釋變量進(jìn)行回歸,并計(jì)算解釋平方和(ESS); (3)在零假設(shè)下,有 (4)一個(gè)更簡(jiǎn)單且漸進(jìn)等價(jià)的做法是直接利用殘差平方對(duì)選中的解釋變量進(jìn)行回歸.在零假設(shè)(同方差)下,b,28,Dependent Variable: rsq Sum of Mean Source DF Squares Square F Value PrF Model 12 1.18881 0.09907 0.88 0.573

24、1 Error 87 9.83078 0.11300 Corrected Total 99 11.01958 Root MSE 0.33615 R-Square 0.1079 Dependent Mean 0.20989 Adj R-Sq -0.0152,BPG test results(1),b,29,BPG test results(2),Dependent Variable: rsqadjust Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr F Model 3 10.70415 3.56805 1

25、.43 0.2386 Error 96 239.41116 2.49387 Corrected Total 99 250.11531 Root MSE 1.57920 R-Square 0.0428 Dependent Mean 0.99997 Adj R-Sq 0.0129 Coeff Var 157.92443 ESS=10.70415,b,30,BPG test results(3),*ESS=5.35 F Model 3 0.47160 0.15720 1.43 0.2386 Error 96 10.54798 0.10987 Root MSE 0.33147 R-Square 0.0

26、428,b,31,戈德菲爾德-匡特(Goldfeld-Quandt)檢驗(yàn),按potexp的值將數(shù)據(jù)從小到大進(jìn)行排列. 取前后個(gè)35個(gè)觀測(cè)值分別回歸.c=30; 回歸的主要結(jié)果: RSS1=6.39573;RSS2=7.2517;RSS2/RSS1=1.13; 而 ;該比值不顯著,不能拒絕同方差的原假設(shè); 去掉的中間觀測(cè)值的個(gè)數(shù)要適中,否則會(huì)降低功效,一般取觀測(cè)值個(gè)數(shù)的1/3.,b,32,補(bǔ)救措施-已知方差的形式,1.廣義最小二乘法(GLS); 請(qǐng)參考講義中的例子; 2.模型變換法,適用于函數(shù)型異方差;已知方差的函數(shù)形式; 3.加權(quán)最小二乘法(WLS);實(shí)質(zhì)上是一種模型變換法;具體參見講義中的例

27、子; 采用面板數(shù)據(jù),增加信息量.,b,33,未知方差的形式,Furnival(1961)提出了一種擬合指數(shù)進(jìn)行不斷的修正,最后找出最佳的權(quán)重(使得該指數(shù)值最小).,b,34,處理盲點(diǎn)-robust regression,1.迭代加權(quán)最小二乘法(IRLS),Neter提出了2中加權(quán)函數(shù), Huber and Bisquare,但是不易操作.SAS v8中常使用Proc NLIN迭代. 2.非參數(shù)回歸.Proc Loess. 3.SAS v9.0中有一個(gè)過程Proc robustreg Stata 中有一個(gè)比較好的命令:rreg直接進(jìn)行魯棒回歸(robust),采用迭代過程.,b,35,序列相關(guān)性

28、(serial correlation),OLSE unbiased,but inefficient and its standard error estimators are invalid; BLUE of the Gauss-Markov Theorem no longer holds. The variance formulas for the least squares estimators are incorrect. AR,MA,or ARMA forms of serial correlation. Take the AR(1) for instance:,b,36,Dw 檢驗(yàn)

29、需要注意的地方,假定了殘差是服從正態(tài)分布,而且是同方差;自變量是外生的,如果包含了內(nèi)生滯后變量,就需要用修正的dh檢驗(yàn)(proc autoreg). 只適用于一階自相關(guān),對(duì)高階或非線性自相關(guān)不適用. 樣本容量至少為15.,b,37,自相關(guān)檢驗(yàn)的標(biāo)準(zhǔn),德賓和沃森根據(jù)顯著水平,n,k,確定了二個(gè)臨界值du(上界),dl(下界);然后進(jìn)行比較; (1)ddu,不拒絕零假設(shè); (3)dl2,負(fù)自相關(guān);d=2,無自相關(guān);,b,38,Eg:Ice cream demand(Hildreth,Lu(1960),Cons:consumption of ice cream per head(pints); In

30、come:average family income per week($); Price :price of ice cream(per pint); Temp: average temperature(in Fahrenheit); Data:30 four-weekly obs from March 1951 to 11 July 1953;,b,39,殘差的散點(diǎn)圖,b,40,回歸結(jié)果,Parameter Estimates Parameter Standard Variable DF Estimate Error t Value Pr |t| Intercept 1 0.19732 0

31、.27022 0.73 0.4718 price 1 -1.04441 0.83436 -1.25 0.2218 income 1 0.00331 0.00117 2.82 0.0090 temp 1 0.00346 0.00044555 7.76 .0001 Durbin-Watson D 1.021 Number of Observations 30 1st Order Autocorrelation 0.330,b,41,1.DW test,查表可得:在0.05的顯著水平上,dl=1.21(N=30,k=3);du=1.65; 直接在回歸的語句中加上一個(gè)dw選項(xiàng); Dw=1.021dl=

32、1.21;故有一階正的自相關(guān);,b,42,2.當(dāng)回歸元嚴(yán)格外生時(shí)-AR(1)序列相關(guān)的檢驗(yàn),1.yt對(duì)做xt1,xt2,xtk回歸,得到殘差t. 2.進(jìn)行回歸: t 對(duì)t-1,采用t檢驗(yàn). 注意:采用t檢驗(yàn)時(shí),必須假定: t = t-1+et種的誤差項(xiàng)et服從同方差的假定,否則采用穩(wěn)健的檢驗(yàn)統(tǒng)計(jì)量(robust ).,b,43,3.當(dāng)回歸元非嚴(yán)格外生時(shí)-AR(1)序列相關(guān)的檢驗(yàn)步驟,當(dāng)解釋變量非嚴(yán)格外生時(shí),會(huì)有一個(gè)或多個(gè)解釋變量和ut-1相關(guān),t檢驗(yàn)和dw檢驗(yàn)失效. 例如含滯后因變量 一種解決辦法: dh檢驗(yàn)統(tǒng)計(jì)量(Durbin,1970). 另一種更一般的方法,無論有多少個(gè)非嚴(yán)格外生變量都有

33、效: 1.yt對(duì)做xt1,xt2,xtk回歸,得到殘差t. 2.進(jìn)行回歸: t 對(duì)xt1,xt2,xtk ,t-1(包含截距項(xiàng)),采用t檢驗(yàn).(同樣可以采取穩(wěn)健性t檢驗(yàn)),b,44,4.高階的BG(Breusch-Godfrey檢驗(yàn))AR(P)序列相關(guān)檢驗(yàn),假設(shè)干擾項(xiàng): 零假設(shè):所有自回歸系數(shù)為零; 檢驗(yàn)步驟:(拉格朗日乘數(shù)檢驗(yàn)) (1) yt對(duì)做xt1,xt2,xtk回歸,得到殘差t. (2)輔助回歸 (3),b,45,Breusch-Goldfrey(BG) test,P=1;(一般從低階開始探測(cè)直到10左右,如果沒有什么顯著的結(jié)果,就認(rèn)為擾動(dòng)項(xiàng)不存在序列相關(guān)). e(t)e(t-1),

34、OLS N*R-square=29*0.15=4.35 ; 因此拒絕零假設(shè),認(rèn)為有自相關(guān);且顯著一階正相關(guān); Parameter Estimates Parameter Standard Variable DF Estimate Error t Value Pr |t| resid 1 0.38454 0.17029 2.26 0.0319,b,46,補(bǔ)救方法,1.已知rho時(shí),采用廣義差分變換. 2.未知rho時(shí),先求相關(guān)系數(shù),然后進(jìn)行廣義差分. 求相關(guān)系數(shù)的方法有: (1)Cochrane-Orcutt迭代方法; (2)Hildreth-Lu. (3)Durbin 2 step.,b,47

35、,對(duì)嚴(yán)格外生回歸元的序列相關(guān)的校正AR(1)模型-可行的廣義最小二乘法(FGLS),采用估計(jì)的相關(guān)系數(shù)值 回歸方程: FGLS步驟: 1. .yt對(duì)做xt1,xt2,xtk回歸,得到殘差t. 2. t = t-1+et,求出相關(guān)系數(shù)的估計(jì)值 3.對(duì)上面的方程進(jìn)行回歸.常見的標(biāo)準(zhǔn)誤,t統(tǒng)計(jì)量和F統(tǒng)計(jì)量都是漸進(jìn)正確的.采用相關(guān)系數(shù)估計(jì)值的代價(jià)是FGLS有限樣本性質(zhì)較差,可能不是無偏的(數(shù)據(jù)弱相關(guān)時(shí)),但仍然是一致的. 盡管FGLS不是無偏的,不是BLUE,但是當(dāng)序列相關(guān)的AR(1)模型成立時(shí),比OLS更漸進(jìn)有效,b,48,區(qū)分科克倫-奧克特(Cochrane-Orcutt)和普萊斯-溫斯登(Par

36、is-Winsten)估計(jì),Co 估計(jì)省略了第一次的觀測(cè)值,使用的是t = t-1+et 滯后項(xiàng)系數(shù)估計(jì)值,而Pw估計(jì)方法使用了第一次的觀測(cè)值,見上面的回歸式. 大體來說是否使用第一次的估計(jì)值并不會(huì)帶來很大的差別,但是時(shí)間序列的樣本很小,實(shí)際中還是有很大差別. 注意下面的估計(jì)結(jié)果中沒有還原到原方程,還原時(shí)要寫正確. 高階序列相關(guān)的校正,類似于一階的修正,廣義的差分方法.,b,49,Sas 程序,data ice; input cons income price temp time; cards;.; proc reg data=ice; model cons=price income temp

37、/dw; output out=ice1 p=consp r=resid; run; symbol1 i=none v=dot c=blue h=.5; proc gplot data=ice1; plot resid*time=1/vref=0; run;,/*BG test*/ data tt1; set ice1; resid1=lag(resid); run; proc reg data=tt1; model resid=resid1/noint; run;/*rh0=0.40063,R-square=0.1541*/; data bgt; bg=29*0.1541; chisq=ci

38、nv(0.95,1); if bgchisq then t=1;else t=0; put t=; run;/*t=0*/;,b,50,Sas 程序,高階的BG檢驗(yàn): /*高階BG test p=3*/; data tt2; set ice1; resid1=lag(resid); resid2=lag(resid1); resid3=lag(resid2); run; proc reg data=tt2; model resid=resid1 resid2 resid3/noint; run;/*R-square=0.1792*/; data bgt2; bg=(29-3)*0.1792;

39、chisq=cinv(0.95,3); if bgchisq then t=1;else t=0; put t= chisq= bg=; run;/*t=0,無高階自相關(guān)*/;,b,51,Sas 程序,/*yule-walker estimates*/; proc autoreg data=ice; model cons=price income temp/nlag=1 method=yw ; run; * COCHRANE-ORCUTT; proc reg data=ice; model cons=price income temp/dw; output out=tt p=chat r=re

40、s; run; proc print data=tt;run; data tt; set tt; relag=Lag(res); run; proc print data=tt;run; proc reg data=tt outest=b1; model res=relag/noint; run;/*可算出rh0=0.40063*/;,data pp; set tt; c1=lag(cons); t1=lag(temp); i1=lag(income); p1=lag(price); run; proc print data=pp;run; data pp1; set pp; if _n_=1

41、 then delete; c2=cons-0.40063*c1; t2=temp-0.40063*t1; i2=income-0.40063*i1; p2=price-0.40063*p1; run; proc print data=pp1;run; proc reg data=pp1; MODEL c2=t2 i2 p2/dw; run; /*dw=1.541.65,因此不拒絕平穩(wěn)性假設(shè)*/;,b,52,Sas 程序,上頁的科克倫-奧科特迭代只用了1次; 對(duì)小樣本情況,迭代多次的仍然很難收斂,我做了三次迭代發(fā)現(xiàn)仍然不收斂;所以說多次迭代效果和一次的效果相差不大.從理論上來說兩者的漸進(jìn)性一樣

42、. 大樣本情況只需幾步就可收斂;,/*下面采用fgls進(jìn)行估計(jì)校正*/; data fgls; set tt1; if _n_=1 then int=sqrt(1-0.40063*0.40063);else int=1-0.40063; if _n_=1 then cons1=cons*sqrt(1-0.40063*0.40063);else cons1=cons-0.40063*cons; if _n_=1 then price1=price*sqrt(1-0.40063*0.40063);else price1=price-0.40063*price; if _n_=1 then inco

43、me1=income*sqrt(1-0.40063*0.40063);else income1=income-0.40063*income; if _n_=1 then temp1=temp*sqrt(1-0.40063*0.40063);else temp1=temp-0.40063*temp; run; proc reg data=fgls; model cons1=int price1 income1 temp1/noint; run;,b,53,Sas 程序,proc autoreg data=ice; model cons=price income temp/nlag=1 dwpro

44、b archtest; run; 估計(jì)方法缺省為yule-walker估計(jì);又稱為兩步完全變換法;已知自回歸參數(shù)下的GLS估計(jì); 其他方法:在model /method=ML;ULS;ITYW; 分別為極大似然估計(jì),無條件最小二乘估計(jì),以及迭代yule-walker估計(jì);自回歸參數(shù)較大時(shí)ml方法uls(又稱NLS)方法較好. 詳見SAS/ETS中的autoreg過程.,b,54,Yuler-walker estimate,The AUTOREG Procedure Dependent Variable cons Ordinary Least Squares Estimates SSE 0.03

45、527284 DFE 26 MSE 0.00136 Root MSE 0.03683 SBC -103.63408 AIC -109.23887 Regress R-Square 0.7190 Total R-Square 0.7190 Durbin-Watson 1.0212 Pr DW 0.9997 NOTE: PrDW is the p-value for testing negative autocorrelation Standard Approx Variable DF Estimate Error t Value Pr |t| Intercept 1 0.1973 0.2702

46、0.73 0.4718 price 1 -1.0444 0.8344 -1.25 0.2218 income 1 0.003308 0.001171 2.82 0.0090 temp 1 0.003458 0.000446 7.76 .0001 Preliminary MSE 0.00105 Estimates of Autoregressive Parameters Standard Lag Coefficient Error t Value 1 -0.329772 0.188812 -1.75,b,55,EGLS(Cochrane-Orcutt 兩步法) results(一次迭代),Dependent Variable: c2(general differenced) Analysis of Variance Sum of Mean Source DF Squares Square F Valu

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論