收藏 分销(赏)

计量经济学的各种检验课件.ppt

上传人:w****g 文档编号:3254699 上传时间:2024-06-26 格式:PPT 页数:60 大小:221.50KB
下载 相关 举报
计量经济学的各种检验课件.ppt_第1页
第1页 / 共60页
计量经济学的各种检验课件.ppt_第2页
第2页 / 共60页
计量经济学的各种检验课件.ppt_第3页
第3页 / 共60页
计量经济学的各种检验课件.ppt_第4页
第4页 / 共60页
计量经济学的各种检验课件.ppt_第5页
第5页 / 共60页
点击查看更多>>
资源描述

1、经济计量学的几种检验1多重共线性n.Multicollinearityarisesbecausewehaveputintoomanyvariablesthatmeasurethesamething.nAsthedegreeofmulticollinearityincreases,theregressionmodelestimatesofthecoefficientsbecomeunstableandthestandarderrorsforthecoefficientscangetwildlyinflated.nMeasure:vif,tol=1/vif,conditionindex;etc.2

2、多重共线性的后果n1.存在完全多重共线性时,参数的估计值无法确定,而且估计值的方差变为无穷大.n2.存在不完全多重共线性时,可以估计参数值,但是数值不稳定,而且方差很大.n3.多重共线性会降低预测的精度,甚至失效,增大零假设接受的可能性(t值变小).3多重共线性的检测方法(1)样本可决系数法n如果样本的可决系数R-square比较大,且回归系数几乎没有统计上的显著性,则可认为存在多重共线性。nTheil提出了一个指标:多重共线性效应系数4TheiltestresultsnSas结果:n结果表明有多重共线性。5多重共线性检测方法(2)辅助回归检验法n若存在多重共线性,则至少有一个解释变量可精确或

3、近似地表示为其余皆是变量的线性组合。n相应的检验统计量为:6辅助回归检验结果nSas结果:nKlein经验法则:若存在一个i,使得nR(i)-squareR-square,则认为多重共线性严重;本例中x1,x3有多重共线性。7多重共线性检验方法(3)样本相关系数检验法8FGtestresultsnfg=20.488013401 p=0.0001344625;n拒绝零假设,认为存在多重共线性。n具体那些变量之间存在多重共线性,除了上面提到的辅助回归的方法外,还有以下提到的条件数检验和方差膨胀因子法。9多重共线性检验方法:(4)特征值分析法所用的检验统计指标n ;为第k各自变量和其余自变量回归的可

4、决系数.VIF10,有多重共线性;TOL=1/VIF;n条件指数:n条件数条件数:;C20,共线性严重.10多重共线性的检验和补救n例一:进口总额和三个自变量之间回归;nSas 结果如下:Pearson Correlation Coefficients,N=11 Prob|r|under H0:Rho=0n x1 x2 x3nx1 1.00000 0.02585 0.997260.99726nGDP 0.9399 .0001.0001nx2 0.02585 1.00000 0.03567n存蓄量 0.9399 0.9171nx3 0.997260.99726 0.03567 1.00000n总

5、消费.0001|t|InflationnIntercept 1 -10.12799 1.21216 -8.36 .0001 0nx1 1 -0.05140 0.07028 -0.73 0.4883 185.99747nx2 1 0.58695 0.09462 6.20 0.0004 1.01891nx3 1 0.28685 0.10221 2.81 0.0263 186.11002n发现x1的系数为负,和现实经济意义不符,出现原因就是x1 和x3之间的线性相关.12补救措施n增加样本;岭回归或主分量回归;n至少去掉一个具有多重共线性的变量;对具有多重共线性的变量进行变换.n对所有变量做滞后差分

6、变换(一般是一阶差分),问题是损失观测值,可能有自相关.n采用人均形式的变量(例如在生产函数估计中)n在缺乏有效信息时,对系数关系进行限制,变为有约束回归(Klein,Goldberger,1955),可以降低样本方差和估计系数的标准差,但不一定是无偏的(除非这种限制是正确的).n对具有多重共线性的变量,设法找出其因果关系,并建立模型和原方程构成联立方程组.13岭回归n岭回归估计:nK=0,b(k)=b即为OLSE;nK的选取:n即使b(k)的均方误差比b的均方误差小.14岭迹图15岭回归结果Obs _MODEL_ _TYPE_ _DEPVAR_ _RIDGE_k _PCOMIT_ _RMSE

7、_ Intercept x1 x2 x3 y 1 MODEL1 PARMS y 0.48887 -10.1280 -0.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

8、.59886 0.144 1 6 MODEL1 RIDGEVIF y 0.02 2.858 0.96219 2.859 -1 7 MODEL1 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

9、0.04 0.58745 -8.5583 0.064 0.58591 0.116 -1 16主分量回归n主分量回归是将具有多重相关的变量集综合得出少数几个互不相关的主分量.n两步:(1)找出自变量集的主分量,建立y与互不相关的前几个主分量的回归式.(2)将回归式还原为原自变量结果.n详见,方开泰;17主分量回归结果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

10、1 0.25083 1.00085 0.25038 1 3 MODEL1 IPC y 1 0.55001 -9.1301 0.07278 0.60922 0.10626 14 MODEL1 IPCVIF y 2 0.24956 0.00095 0.24971-15 MODEL1 IPC y 2 1.05206 -7.7458 0.07381 0.08269 0.10735-118主分量回归结果n由输出结果看到在删去第三个主分量(pcomit=1)后的主分量回归方程:nY=-9.1301+0.07278x1+0.60922x2+0.10626x3;n该方程的系数都有意义,且回归系数的方差膨胀因子

11、均小于1.1;主分量回归方程的均方根误差(_RMSE=0.55)比普通OLS方程的均方根误差(_RMSE=0.48887)有所增大但不多。19Sas程序ndata ex01;ninput x1 x2 x3 y;nlabel x1=国内生产总值;nlabel x2=存储量;nlabel x3=消费量;nlabel y=进口总额;ncards;n149.3 4.2 108.1 15.9n161.2 4.1 114.8 16.4n171.5 3.1 123.2 19.0n175.5 3.1 126.9 19.1n180.8 1.1 132.1 18.8n190.7 2.2 137.7 20.4n20

12、2.1 2.1 146 22.7n212.4 5.6 154.1 26.5n226.1 5.0 162.3 28.1n231.9 5.1 164.3 27.6 n239.0 0.7 167.6 26.3n;nrun;nproc corr data=ex01;nvar x1-x3;nrun;n*岭回归*;nproc reg data=ex01 outest=ex012 graphics outvif;nmodel y=x1-x3/ridge=0.0 to 0.1 by 0.01;nplot/ridgeplot;nrun;nproc print data=ex012;run;n*主分量回归法*;n

13、proc reg data=ex01 outest=ex103;nmodel y=x1-x3/pcomit=1,2 outvif;*pcomit表示删去最后面的1或2个主分量,用前面m-1或 m-2各主分量进行回归*;nrun;nproc print data=ex103;run;20Sas程序n/*theil test*/;nproc reg data=ex01;nequation3:model y=x1 x2;nequation2:model y=x1 x3;nequation1:model y=x2 x3;nrun;/*r-.9473;r3s=0.9828*/;ndata theil;n

14、rsq=0.9919;r1s=0.9913;r2s=0.9473;r3s=0.9828;ntheil=rsq-(3*rsq-(r1s+r2s+r3s);put theil=;nrun;n/*辅助回归检验法*/;nproc reg data=ex01;nequation3:model x3=x1 x2;nequation2:model x2=x1 x3;nequation1:model x1=x2 x3;nrun;n/*FG test*/;nproc corr data=ex01 outp=corr nosimple;var x1-x3;run;nproc print data=corr;run

15、;ntitle 计算相关矩阵的行列式;nproc iml;nR=1.000 0.026 0.997,0.026 1 0.036,0.9152 0.6306 1;nd=det(R);nprint d;nrun;/*d=0.081371*/;ntitle 计算检验统计量及其p值;ndata fg;nn=11;p=3;d=0.081371;nfg=-(n-1-1/6*(2*p+5)*log(d);df=p(p-1)/2;np=1-probchi(fg,df);nput fg=p=;nrun;/*fg=20.488013401 p=0.0001344625,拒绝零假设*/;21异方差的检验和补救nnO

16、LSEunbiased,inefficient;t,Ftestinvalid;forecastaccuracydecreased.nIfthemodeliswell-fitted,thereshouldbenopatterntotheresidualsplottedagainstthefittedvalues.Ifthevarianceoftheresidualsisnon-constant,thentheresidualvarianceissaidtobeheteroscedastic.22异方差的检测nTherearegraphicalandnon-graphicalmethodsford

17、etectingheteroscedasticity.Acommonlyusedgraphicalmethodistoplottheresidualsversusfitted(predicted)values.nExample:grade:educatedyears;potexp:workingyears;exp2=potexp2;union:dummyvariable.23收入方程回归的结果n Dependent Variable:LNWAGE n Analysis of Variancen Sum of Meann Source DF Squares Square F Value Pr F

18、n Model 4 12.42236 3.10559 14.06|t|n Intercept 1 0.59511 0.28349 2.10 0.0384n GRADE 1 0.08354 0.02009 4.16 Fn Model 12 1.18881 0.09907 0.88 0.5731n Error 87 9.83078 0.11300nCorrected Total 99 11.01958n Root MSE 0.33615 R-Square 0.1079n Dependent Mean 0.20989 Adj R-Sq -0.0152n Coeff Var 160.15281n Pa

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

20、-3.34378E-7 0.00000151 -0.22 0.8256n exp3 1 0.00006170 0.00014192 0.43 0.6648n gx2 1 0.00011683 0.00011102 1.05 0.2955n gp 1 -0.00375 0.00494 -0.76 0.4498n gu 1 -0.05137 0.04430 -1.16 0.2494n pu 1 0.00193 0.06061 0.03 0.9746n eu 1 -0.00022185 0.00126 -0.18 0.8605n残差项平方对所有一阶,二阶及交叉项回归.n1.由左边的结果可知:n故同方

21、差的假设未被拒绝.n2.Procregdata=aa;nModely=x/spec;nRun;n可得到相同的结果。26布罗施-帕甘/戈弗雷检验怀特检验的特例(1)OLS残差额et和一个估计的干扰误差n(2)用OLS将对选中的解释变量进行回归,并计算解释平方和(ESS);n(3)在零假设下,有n(4)一个更简单且渐进等价的做法是直接利用残差平方对选中的解释变量进行回归.在零假设(同方差)下,27 Dependent Variable:rsqn Sum of MeanSource DF Squares Square F Value PrFModel 12 1.18881 0.09907 0.88

22、0.5731Error 87 9.83078 0.11300Corrected Total 99 11.01958 Root MSE 0.33615 R-Square 0.1079Dependent MeanDependent Mean 0.209890.20989 Adj R-Sq -0.0152BPGtestresults(1)28BPGtestresults(2)nDependent Variable:rsqadjustnAnalysis of Variancen Sum of Meann Source DF Squares Square F Value Pr FnModel 3 10.

23、7041510.70415 3.56805 1.43 0.2386nError 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.0129nCoeff Var 157.92443nESS=10.70415ESS=10.7041529BPGtestresults(3)n*ESS=5.35 FnModel 3 0.47160 0.15720 1.43 0.2386nError 96 10.5479810.54798

24、0.10987nRoot MSE 0.33147 R-Square 0.0428R-Square 0.042830戈德菲尔德-匡特(Goldfeld-Quandt)检验n按potexp的值将数据从小到大进行排列.n取前后个35个观测值分别回归.c=30;n回归的主要结果:nRSS1=6.39573;RSS2=7.2517;RSS2/RSS1=1.13;而;该比值不显著,不能拒绝同方差的原假设;n去掉的中间观测值的个数要适中,否则会降低功效,一般取观测值个数的1/3.31补救措施-已知方差的形式n1.广义最小二乘法(GLS);n请参考讲义中的例子;n2.模型变换法,适用于函数型异方差;已知方差的

25、函数形式;n3.加权最小二乘法(WLS);实质上是一种模型变换法;具体参见讲义中的例子;n采用面板数据,增加信息量.32未知方差的形式nFurnival(1961)提出了一种拟合指数进行不断的修正,最后找出最佳的权重(使得该指数值最小).33处理盲点-robustregressionn1.迭代加权最小二乘法(IRLS),Neter提出了2中加权函数,HuberandBisquare,但是不易操作.SASv8中常使用ProcNLIN迭代.n2.非参数回归.ProcLoess.n3.SASv9.0中有一个过程ProcrobustregnStata中有一个比较好的命令:rreg直接进行鲁棒回归(ro

26、bust),采用迭代过程.34序列相关性(serialcorrelation)nnOLSEunbiased,butinefficientanditsstandarderrorestimatorsareinvalid;nBLUEoftheGauss-MarkovTheoremnolongerholds.nThevarianceformulasfortheleastsquaresestimatorsareincorrect.nAR,MA,orARMAformsofserialcorrelation.nTaketheAR(1)forinstance:35Dw检验需要注意的地方n假定了残差是服从正态分

27、布,而且是同方差;自变量是外生的,如果包含了内生滞后变量,就需要用修正的dh检验(procautoreg).n只适用于一阶自相关,对高阶或非线性自相关不适用.n样本容量至少为15.36自相关检验的标准n德宾和沃森根据显著水平,n,k,确定了二个临界值du(上界),dl(下界);然后进行比较;n(1)ddu,不拒绝零假设;n(3)dlddu,无结论;n直观:;d2,负自相关;d=2,无自相关;37Eg:Icecreamdemand(Hildreth,Lu(1960)nCons:consumptionoficecreamperhead(pints);nIncome:averagefamilyinc

28、omeperweek($);nPrice:priceoficecream(perpint);nTemp:averagetemperature(inFahrenheit);nData:30four-weeklyobsfromMarch1951to11July1953;38残差的散点图39回归结果n Parameter Estimatesn Parameter StandardnVariable DF Estimate Error t Value Pr|t|nIntercept 1 0.19732 0.27022 0.73 0.4718nprice 1 -1.04441 0.83436 -1.25

29、 0.2218nincome 1 0.00331 0.00117 2.82 0.0090ntemp 1 0.00346 0.00044555 7.76 .0001n Durbin-Watson D 1.021Durbin-Watson D 1.021n Number of Observations 30n 1st Order Autocorrelation 0.330401.DWtestn查表可得:在0.05的显著水平上,dl=1.21(N=30,k=3);du=1.65;n直接在回归的语句中加上一个dw选项;nDw=1.021;n因此拒绝零假设,认为有自相关;且显著一阶正相关;n Param

30、eter Estimatesn Parameter StandardnVariable DF Estimate Error t Value Pr|t|nresid 1 0.384540.38454 0.17029 2.26 0.03190.031945补救方法n1.已知rho时,采用广义差分变换.n2.未知rho时,先求相关系数,然后进行广义差分.n求相关系数的方法有:n(1)Cochrane-Orcutt迭代方法;n(2)Hildreth-Lu.n(3)Durbin2step.46对严格外生回归元的序列相关的校正AR(1)模型-可行的广义最小二乘法(FGLS)n采用估计的相关系数值n回归方程

31、:nFGLS步骤:n1.yt对做xt1,xt2,xtk回归,得到残差t.n2.t=t-1+et,求出相关系数的估计值n3.对上面的方程进行回归.常见的标准误,t统计量和F统计量都是渐进正确的.采用相关系数估计值的代价是FGLS有限样本性质较差,可能不是无偏的(数据弱相关时),但仍然是一致的.n尽管FGLS不是无偏的,不是BLUE,但是当序列相关的AR(1)模型成立时,比OLS更渐进有效47区分科克伦-奥克特(Cochrane-Orcutt)和普莱斯-温斯登(Paris-Winsten)估计nCo估计省略了第一次的观测值,使用的是t=t-1+et滞后项系数估计值,而Pw估计方法使用了第一次的观测

32、值,见上面的回归式.n大体来说是否使用第一次的估计值并不会带来很大的差别,但是时间序列的样本很小,实际中还是有很大差别.n注意下面的估计结果中没有还原到原方程,还原时要写正确.n高阶序列相关的校正,类似于一阶的修正,广义的差分方法.48Sas程序ndata ice;ninput cons income price temp time;ncards;.;nproc reg data=ice;nmodel cons=price income temp/dw;noutput out=ice1 p=consp r=resid;nrun;nsymbol1 i=none v=dot c=blue h=.5

33、;nproc gplot data=ice1;nplot resid*time=1/vref=0;nrun;n/*BG test*/ndata tt1;nset ice1;nresid1=lag(resid);nrun;nproc reg data=tt1;nmodel resid=resid1/noint;nrun;/*rh0=0.40063,R-square=0.1541*/;ndata bgt;nbg=29*0.1541;nchisq=cinv(0.95,1);nif bgchisq then t=1;else t=0;nput t=;nrun;/*t=0*/;49Sas程序n高阶的BG

34、检验:n/*高阶BG test p=3*/;ndata tt2;nset ice1;nresid1=lag(resid);nresid2=lag(resid1);nresid3=lag(resid2);nrun;nproc reg data=tt2;nmodel resid=resid1 resid2 resid3/noint;nrun;/*R-square=0.1792*/;ndata bgt2;nbg=(29-3)*0.1792;nchisq=cinv(0.95,3);nif bgchisq then t=1;else t=0;nput t=chisq=bg=;nrun;/*t=0,无高阶

35、自相关*/;50Sas程序n/*yule-walker estimates*/;nproc autoreg data=ice;nmodel cons=price income temp/nlag=1 method=yw;nrun;n*COCHRANE-ORCUTT;nproc reg data=ice;nmodel cons=price income temp/dw;noutput out=tt p=chat r=res;nrun;nproc print data=tt;run;ndata tt;nset tt;nrelag=Lag(res);nrun;nproc print data=tt;

36、run;nproc reg data=tt outest=b1;nmodel res=relag/noint;nrun;/*可算出rh0=0.40063*/;ndata pp;nset tt;nc1=lag(cons);nt1=lag(temp);ni1=lag(income);np1=lag(price);nrun;nproc print data=pp;run;ndata pp1;nset pp;nif _n_=1 then delete;nc2=cons-0.40063*c1;nt2=temp-0.40063*t1;ni2=income-0.40063*i1;np2=price-0.40

37、063*p1;nrun;nproc print data=pp1;run;nproc reg data=pp1;nMODEL c2=t2 i2 p2/dw;nrun;n/*dw=1.541.65,因此不拒绝平稳性假设*/;51Sas程序n上页的科克伦-奥科特迭代只用了1次;n对小样本情况,迭代多次的仍然很难收敛,我做了三次迭代发现仍然不收敛;所以说多次迭代效果和一次的效果相差不大.从理论上来说两者的渐进性一样.n大样本情况只需几步就可收敛;n/*下面采用fgls进行估计校正*/;ndata fgls;nset tt1;nif _n_=1 then int=sqrt(1-0.40063*0.40

38、063);else int=1-0.40063;nif _n_=1 then cons1=cons*sqrt(1-0.40063*0.40063);else cons1=cons-0.40063*cons;nif _n_=1 then price1=price*sqrt(1-0.40063*0.40063);else price1=price-0.40063*price;nif _n_=1 then income1=income*sqrt(1-0.40063*0.40063);else income1=income-0.40063*income;nif _n_=1 then temp1=tem

39、p*sqrt(1-0.40063*0.40063);else temp1=temp-0.40063*temp;nrun;nproc reg data=fgls;nmodel cons1=int price1 income1 temp1/noint;nrun;52Sas程序nproc autoreg data=ice;nmodel cons=price income temp/nlag=1 dwprob archtest;nrun;n估计方法缺省为yule-walker估计;又称为两步完全变换法;已知自回归参数下的GLS估计;n其他方法:在model/method=ML;ULS;ITYW;n分别

40、为极大似然估计,无条件最小二乘估计,以及迭代yule-walker估计;自回归参数较大时ml方法uls(又称NLS)方法较好.n详见SAS/ETS中的autoreg过程.53Yuler-walkerestimatenThe AUTOREG Procedure Dependent Variable consn Ordinary Least Squares Estimatesn SSE 0.03527284 DFE 26n MSE 0.00136 Root MSE 0.03683n SBC -103.63408 AIC -109.23887n Regress R-Square 0.7190 Tot

41、al R-Square 0.7190n Durbin-Watson 1.0212 Pr DW 0.9997nNOTE:PrDW is the p-value forn testing negative autocorrelationn Standard Approxn Variable DF Estimate Error t Value Pr|t|n Intercept 1 0.1973 0.2702 0.73 0.4718n price 1 -1.0444 0.8344 -1.25 0.2218n income 1 0.003308 0.001171 2.82 0.0090n temp 1

42、0.003458 0.000446 7.76 Fn Model 3 0.04707 0.01569 15.41|t|n Intercept 1 0.09409 0.17358 0.54 0.5926n t2 1 0.00356 0.00055454 6.42 Fn Model 4 1.44032 0.36008 836.01|t|n int 1 0.03411 0.26299 0.13 0.8978n price1 1 -0.66901 0.78886 -0.85 0.4044n income1 1 0.00388 0.00113 3.43 0.0021n temp1 1 0.00365 0.

43、00042686 8.56 Q LM Pr LMn 1 0.4425 0.5059 0.1797 0.6716n 2 0.8322 0.6596 1.2446 0.5367n 3 1.2725 0.7357 1.6346 0.6516n 4 3.5292 0.4735 4.3974 0.3549n 5 3.7247 0.5897 4.4229 0.4903n 6 3.9320 0.6859 4.4893 0.6108n 7 4.2288 0.7531 4.5093 0.7196n 8 5.8344 0.6658 9.4542 0.3054n 9 6.7441 0.6637 10.3272 0.

44、3246n 10 7.7561 0.6526 10.5957 0.3899n 11 7.8443 0.7272 10.9131 0.4506n 12 7.9322 0.7904 12.4910 0.4071n从上面的p-value 可以看出不存在条件异方差;59其他有关时间序列的过程n分布滞后模型ProcPdlreg.n向量自回归Procvarmax;n时间序列建模ProcAriman时间序列预测Procforecast.nStata中的命令rreg(鲁棒回归);reg,robust给出来稳健的t值;newey和newey2给出来不同条件下的(包括面板数据,内生变量等)异方差自相关稳健估计(HAC)。60

展开阅读全文
相似文档                                   自信AI助手自信AI助手
猜你喜欢                                   自信AI导航自信AI导航
搜索标签

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服