您好,欢迎访问三七文档
贝叶斯空间计量模型一、采用贝叶斯空间计量模型的原因残差项可能存在异方差,而ML估计方法的前提是同方差,因此,当残差项存在异方差时,采用ML方法估计出的参数结果不具备稳健性。二、贝叶斯空间计量模型的估计方法(一)待估参数对于空间计量模型(以空间自回归模型为例)Wyy假设残差项是异方差的,即),,(),0(~212nvvvdiagVVN上述模型需要估计的参数有:nvvv21共计n+2个参数,存在自由度问题,难以进行参数检验。为此根据大数定律,增加了新的假设:vi服从自由度为r的卡方分布。如此以来,待估参数将减少为3个。(二)参数估计方法采用MCMC(MarkovChainMonteCarlo)参数估计思想,具体的抽样方法选择吉布斯抽样方法(Gibbssamplingapproach)在随意给定待估参数一个初始值之后,开始生成参数的新数值,并根据新数值生成其他参数的新数值,如此往复,对每一个待估参数,将得到一组生成的数值,根据该组数值,计算其均值,即为待估参数的贝叶斯估计值。三、贝叶斯空间计量模型的类型空间自回归模型far_g()空间滞后模型(空间回归自回归混合模型)sar_g()空间误差模型sem_g()广义空间模型(空间自相关模型)sac_g()四、贝叶斯空间模型与普通空间模型的选择标准首先按照参数显著性,以及极大似然值,确定普通空间计量模型的具体类型,之后对于该确定的类型,再判断是否需要进一步采用贝叶斯估计方法。标准一:对普通空间计量模型的残差项做图,观察参数项是否是正态分布,若非正态分布,则考虑使用贝叶斯方法估计。技巧:r=30的贝叶斯估计等价于普通空间计量模型估计,此时可以做出v的分布图,观察其是否基本等于1,若否,则应采用贝叶斯估计方法。标准二:若按标准一发现存在异方差,采用贝叶斯估计后,如果参数结果与普通空间计量方法存在较大差异,则说明采用贝叶斯估计是必要的。例1:选举投票率普通SAR与贝叶斯SAR对比:loadelect.dat;loadford.dat;y=elect(:,7)./elect(:,8);x1=elect(:,9)./elect(:,8);x2=elect(:,10)./elect(:,8);x3=elect(:,11)./elect(:,8);w=sparse(ford(:,1),ford(:,2),ford(:,3));x=[ones(3107,1)x1x2x3];res1=sar(y,x,w);res2=sar_g(y,x,w,2100,100);Vnames=strvcat(‘voter’,’const’,‘educ’,‘home’,‘income’);prt(res1);prt(res2);SpatialautoregressiveModelEstimatesDependentVariable=voterR-squared=0.4605Rbar-squared=0.4600sigma^2=0.0041Nobs,Nvars=3107,4log-likelihood=5091.6196#ofiterations=11minandmaxrho=-1.0000,1.0000totaltimeinsecs=1.0530timeforlndet=0.2330timefort-stats=0.0220timeforx-impacts=0.7380#drawsx-impacts=1000PaceandBarry,1999MClndetapproximationusedorderforMCappr=50iterforMCappr=30VariableCoefficientAsymptott-statz-probabilityconst-0.100304-8.4062990.000000educ0.33570421.9010990.000000home0.75406028.2122110.000000income-0.008135-8.5352120.000000rho0.527962335.7243590.000000检验是否存在异方差---------是否存在遗漏变量:贝叶斯----------对列向量做柱状图。bar(res.vmean);BayesianspatialautoregressivemodelHeteroscedasticmodelDependentVariable=voterR-squared=0.4425Rbar-squared=0.4419meanofsigedraws=0.0023sige,epe/(n-k)=0.0065r-value=4Nobs,Nvars=3107,4ndraws,nomit=2100,100totaltimeinsecs=20.6420timeforlndet=0.2370timeforsampling=19.2790PaceandBarry,1999MClndetapproximationusedorderforMCappr=50iterforMCappr=30minandmaxrho=-1.0000,1.0000PosteriorEstimatesVariableCoefficientStdDeviationp-levelconst-0.1078630.0127290.000000educ0.3484160.0180720.000000home0.7277990.0264160.000000income-0.0096030.0010500.000000rho0.5610540.0133130.000000对遗漏变量的测量:loadelect.dat;lat=elect(:,5);lon=elect(:,6);[lonsli]=sort(lon);lats=lat(li,1);elects=elect(li,:);y=elects(:,7)./elects(:,8);x1=elects(:,9)./elects(:,8);x2=elecrs(:,10)./elects(:,8);x2=elects(:,10)./elects(:,8);x3=elects(:,11)./elects(:,8);x=[ones(3107,1)x1x2x3];[w1ww2]=xy2cont(lons,lats);vnames=strvcat('voters','const','educ','home','income');res=sar(y,x,w,2100,100);res=sar_g(y,x,w,2100,100);prt(res,vnames);BayesianspatialautoregressivemodelHeteroscedasticmodelDependentVariable=votersR-squared=0.4402Rbar-squared=0.4396meanofsigedraws=0.0022sige,epe/(n-k)=0.0065r-value=4Nobs,Nvars=3107,4ndraws,nomit=2100,100totaltimeinsecs=20.3230timeforlndet=0.2460timeforsampling=18.9770PaceandBarry,1999MClndetapproximationusedorderforMCappr=50iterforMCappr=30minandmaxrho=-1.0000,1.0000***************************************************************PosteriorEstimatesVariableCoefficientStdDeviationp-levelconst-0.1331820.0126330.000000educ0.3006530.0179860.000000home0.7252020.0259440.000000income-0.0082190.0010090.000000rho0.6284070.0141160.000000例2:elect数据2个权重矩阵-----W1W2W2=slag(W1,2)bressar(sem/sac)_gSAR(2个)SEM(2个)SAC(4个)普通*贝叶斯共计16个模型(注:可对变量统一取对数)
本文标题:贝叶斯空间计量模型
链接地址:https://www.777doc.com/doc-2034604 .html