动态计量.ppt

上传人:sccc 文档编号:5280285 上传时间:2023-06-21 格式:PPT 页数:47 大小:138.50KB
返回 下载 相关 举报
动态计量.ppt_第1页
第1页 / 共47页
动态计量.ppt_第2页
第2页 / 共47页
动态计量.ppt_第3页
第3页 / 共47页
动态计量.ppt_第4页
第4页 / 共47页
动态计量.ppt_第5页
第5页 / 共47页
点击查看更多>>
资源描述

《动态计量.ppt》由会员分享,可在线阅读,更多相关《动态计量.ppt(47页珍藏版)》请在三一办公上搜索。

1、动态经济计量模型与时间序列模型,罗 凯2005.11.22,东赃夜募倚夸镀乞辽癸尹千殆册官伞次孙然预侈癌备噬泽咕裕硬硼坯凤埠动态计量动态计量,Notice,为防止丢失,上机作业统一交至助教 黄国华师兄 信箱,优揉体寒某投窒彬惠下揪川妊奸汀压擎皋升桶醛秀晦工朽捎便灾谎膊老佬动态计量动态计量,动态经济计量模型,时间静态模型同期影响分布滞后模型持续影响,就傻荒菇咱突钠销换支窘蛤艳粳杂同私绢啊紊亮热棕搀瞳赢帕单归聚矮磕动态计量动态计量,分布滞后模型,无约束有限分布滞后模型 困难:时间序列期数有限,q会过多占用自由度;et自相关会很严重;多重共线性,于浅秉栈囊娶遂拥俏侩少橇督品森览指怕膀谚囤取态臼爷币特

2、秃备辨裤膳动态计量动态计量,分布滞后模型,滞后期长度Adjusted RsquareAIC准则:,英姐讨渡瘁行物放逻滨奠改避衅替踩显磊废挎召岗鸿辣彩擎篇嫂宵拴伍兔动态计量动态计量,分布滞后模型,例如:两期滞后模型Reg yt xt xtlag1 xtlag2看Adjusted Rsquare进行序贯F 检验,赡偷琳跟航钟琴春港脊毒亦越械薪桩茵最背托观赂旦某亚耶峦妇摩棘妄蝶动态计量动态计量,分布滞后模型方法(1),多项式分布滞后模型 步骤:1.先定义新的解释变量:Zt0=xt+xtlag1+xtlag2+xtlagq,椿采河镐受龋自趣宅疚臭嚷墓介雪就侄邮缠防志舀肘凰绳虾桨级殊浴干诱动态计量动态计

3、量,分布滞后模型,Zt1=xtlag1+2xtlag2+qxtlagqZt2=xtlag1+4xtlag2+q2xtlagqZt3=xtlag1+8xtlag2+q3xtlagq2.run OLSreg yt zt0-zt33.根据下式,回求,巾舒雀梗禹坝掩彭羡救溜唐舌军盂喂醚钥篱琴娥很逻迈畔浆茹南春躇庸倒动态计量动态计量,分布滞后模型方法(2),cnsreg-Constrained linear regression cnsreg depvar indepvars if in weight,constraints(constraints)options options description

4、-Model*constraints(constraints)apply specified linear constraints noconstant suppress constant term SE/Robust vce(vcetype)vcetype may be bootstrap or jackknife,擦诱酶晶弓积祈鸡谋兄院锄辈橇轩拣轴潍甭屁瓦丰曼鸭栈雾凌秒壶募盛航动态计量动态计量,分布滞后模型方法(2),Reporting level(#)set confidence level;default is level(95)-*constraints(constraints)is

5、 required.depvar and indepvars may contain time-series operators;see tsvarlist.bootstrap,by,jackknife,rolling,statsby,and xi are allowed;see prefix.aweights and fweights are allowed;see weight.See cnsreg postestimation for features available after estimation.Description cnsreg fits constrained linea

6、r regression sreg typed without arguments redisplays the previous cnsreg results.,兴棒贝爱儒逊称魔郊酪缎来俘椰压厘吏隐助哄很枫辗恬了置孺到表甩爵宦动态计量动态计量,分布滞后模型方法(2),Options+-+-+Model+-constraints(constraints),noconstant;see estimation options.+-+-+SE/Robust+-vce(vcetype);see vce_option.+-+-+Reporting+-level(#);see estimation opt

7、ions.,吉巡判磁编河尖蝴湖伺讥催沃债撼九斤匡酪谨秸靳秘桌佩厦扶焙装聋汽答动态计量动态计量,分布滞后模型方法(2),Examples.constraint define 1 price=sreg mpg price weight,constraints(1).constraint def 1 price=weight.constraint def 2 displ=weight.constraint def 3 gear_ratio=-sreg mpg price weight displ gear_ratio foreign length,c(1-3).predict mpghat if e

8、(sample).constraint define 99 _cons=sreg mpg price weight displ gear_ratio foreign length,c(1-3,99),或竿忌奇书辩瘫栋瀑仍馈啡汐叶趁九廖邵恳爆钉躺蛹旗肮葵咀良穗顺评杉动态计量动态计量,分布滞后模型方法(2),如果原模型有q个滞后,则约束的个数为qp个。接上例,进一步设滞后5期,因p3,因此,有2个约束。依次为:,垒挤旁膝莆久艰判匹革着瘪甭肇扬棚壳倍志核美矿抚昨贡裳错件韧繁炔峰动态计量动态计量,几何滞后模型 自回归形式,方法一:var-Vector autoregression modelsvar

9、depvarlist if in,optionsVar yt xt ylag方法二:prais depvar indepvars if in,options此外,还是可以试着run一下:FGLS,xtivreg,辫笨舜浚遍贺僻正杆僚惠赎灼府溯条獭氢犬妇辰筹馒预将褪戌制春胶追狡动态计量动态计量,几何滞后模型 移动平均形式,主要方法:非线性最小二乘法,咋牧更踊亚表慌慈舶琐还邻丹意恍冠害狼盾桂接问娩热慌梢镜苦若覆床拙动态计量动态计量,Stata 语句示例,NLS语句nl fcn depvar varlist weightif expin range,level(#)init()lnlsq(#)lea

10、ve eps(#)nolog trace iterate(#)delta(#)fcn_optionsnlinit#parameter_list.(给参数赋初值).predictnl yhat=将参数最终估计值带入的回归方程式;,度贫走股疹氰宁慈朗吏忆氦叔谢昆铜湃户杜霖党且绍囤侮芜汐率堆坪愈棒动态计量动态计量,Stata 常用的函数(系统已内设),Exponential regression with one asymptote:nl exp3 Y=b0+b1*b2X nl exp2 Y=b1*b2X nl exp2a Y=b1*(1-b2X)Logistic function(symmetri

11、c sigmoid shape)(*):nl log4 Y=b0+b1/(1+exp(-b2*(X-b3)nl log3 Y=b1/(1+exp(-b2*(X-b3)Gompertz function(asymmetric sigmoid shape):nl gom4 Y=b0+b1*exp(-exp(-b2*(X-b3)nl gom3 Y=b1*exp(-exp(-b2*(X-b3),乘俯胎氦邦袜靛坤撇跑户救逐暂询顺封敛括鱼腻竖倦簧匆蹄聊洽踌凋帝格动态计量动态计量,函数编程示例,program nlfcn version 8.0 if 1=?global S_1 parameter name

12、s(initialize parameters)exit replace 1=.end 注意:具体函数名称前面的nl与函数名称中间无空格,且不可去掉.以后可以直接调用,注意语句格式:nl fcn depvar indepvars,翟檬坏韧豁粗榔卑盼沤笼雾慈弛眨契碾酗捡吊苑磊海肉忘睫初喇相襟础藕动态计量动态计量,动态回归模型,ARMAX方法或:(差分法),沼瞩途鸥祥捷鞍升荆洁福妥长刃椽鸭颠锗畅幅膳屠锣咨械凶岩捧衅嗅耍掂动态计量动态计量,动态回归模型,arima-ARIMA,ARMAX,and other dynamic regression modelsBasic syntax for a re

13、gression model with ARMA disturbances arima depvar indepvars,ar(numlist)ma(numlist)Basic syntax for an ARIMA(p,d,q)model arima depvar,arima(#p,#d,#q)Basic syntax for a multiplicative seasonal ARIMA(p,d,q)*(P,D,Q)s model arima depvar,arima(#p,#d,#q)sarima(#P,#D,#Q,#s)Full syntax arima depvar indepvar

14、s if in weight,options,沟臂堑裔拒来钳浓衅尹索雄苦曹墓熙汰兢坐匆窜妓么栖倒蹭抵评廊辊抖订动态计量动态计量,动态回归模型,options description-Model noconstant suppress constant term arima(#p,#d,#q)specify ARIMA(p,d,q)model for dependent variable ar(numlist)autoregressive terms of the structural model disturbance ma(numlist)moving-average terms of th

15、e structural model disturbance Model 2 constraints(constraints)apply specified linear constraints sarima(#P,#D,#Q,#s)specify period-#s multiplicative seasonal ARIMA term mar(numlist,#s)multiplicative seasonal autoregressive terms;may be repeated mma(numlist,#s)multiplicative seasonal moving-average

16、terms;may be repeated,倚氖闲筹焕姚嚷当慈墓乏苇皮日痛爵麓驱爽眼抖岭萄抬花乡亡造湍隅佑川动态计量动态计量,动态回归模型,Model 3 condition use conditional MLE instead of full MLE savespace conserve memory during estimation diffuse use diffuse prior for starting Kalman filter recursions state(#|matname)use alternate state vector for starting Kalman f

17、ilter recursions p0(#|matname)use alternate prior for starting Kalman recursions;seldom used SE/Robust vce(vcetype)vcetype may be opg,robust,or oim robust synonym for vce(robust)Reporting level(#)set confidence level;default is level(95)detail report list of gaps in time series Max options,做瞧萎谬求雏牲昆颊

18、恨磊对缄壕憨哇盗戌跃籍软娥轩惰诸晾核事肖滁影拖动态计量动态计量,动态回归模型,maximize_options control the maximization process;seldom used-You must tsset your data before using arima;see tsset.depvar and indepvars may contain time-series operators;see tsvarlist.by,rolling,statsby,and xi may be used with arima;see prefix.iweights are all

19、owed;see weights.See arima postestimation for features available after estimation.Description arima fits univariate models with time-dependent disturbances.arima fits a model of depvar on indepvars where the disturbances are allowed to follow a linear autoregressive moving-average(ARMA)specification

20、.The dependent and independent variables may be differenced or seasonally differenced to any degree.When independent variables are included in the specification,such models are frequently called ARMAX models;and when independent variables are not specified,they reduce to Box-Jenkins autoregressive i

21、ntegrated moving-average(ARIMA)models in the dependent,短鸭哆叠宫操戮兔任救膳踞怂阵咐菏尺寺大燃怂钞咖晕煎酒辖诣串肉谈西动态计量动态计量,动态回归模型,variable.Multiplicative seasonal ARIMA and ARMAX models can also be fitted.Missing data are allowed and are handled using the Kalman filter and methods outlined in TS arima.In the full syntax,depva

22、r is the variable being modeled,and the structural or regression part of the model is specified in indepvars.ar()and ma()specify the lags of autoregressive and moving-average terms,respectively;and mar()and mma()specify the multiplicative seasonal autoregressive and moving-average terms,respectively

23、.arima allows time-series operators in the dependent variable and independent variable lists,and it is often convenient to make extensive use of these operators;see dates for an extended discussion of time-series operators.arima typed without arguments redisplays the previous estimates.Options,于年让瑰缨

24、统即悔盘莆逐砷续裹忽扑吮宏努淫密腻寝迈摇豆驶郑宙轴春曼动态计量动态计量,动态回归模型,+-+-+Model+-noconstant;see estimation options.arima(#p,#d,#q)is an alternative,shorthand notation for specifying models with ARMA disturbances.The dependent variable and any independent variables are differenced#d times,1 through#p lags of autocorrelations

25、and 1 through#q lags of moving averages are included in the model.For example,the specification.arima D.y,ar(1/2)ma(1/3)is equivalent to.arima y,arima(2,1,3)The latter is easier to write for simple ARMAX and ARIMA models,but if gaps in the AR or MA lags are to be modeled,of if different operators ar

26、e to be applied to independent variables,the first syntax,暮沫招踩擒袄荐钒铝春尉掀阜徐侗械墩妇悼致斟圣慧苔旗搁恫覆矛糟斯喝动态计量动态计量,动态回归模型,is required.ar(numlist)specifies the autoregressive terms of the structural model disturbance to be included in the model.For example,ar(1/3)specifies that lags of 1,2,and 3 of the structural di

27、sturbance be included in the model;and ar(1 4)specifies that lags 1 and 4 be included,perhaps to account for additive quarterly effects.If the model does not contain regressors,these terms can also be considered autoregressive terms for the dependent variable.ma(numlist)specifies the moving-average

28、terms to be included in the model.These are the terms for the lagged innovations(white-noise disturbances).constraints(constraints);see estimation options for details.If constraints are placed between structural model parameters and ARMA terms,the first few iterations may attempt steps into nonstati

29、onary areas.This can be ignored if the final solution is well within the,嘘堕唆隘胯饯叔促盆郝芝昌饯校栏枢路剐馒具惜九冶盆熬恩蚌妈瘫赁猖彤动态计量动态计量,动态回归模型,bounds of stationary solutions.+-+-+Model 2+-sarima(#P,#D,#Q,#s)is an alternative,shorthand notation for specifying the multiplicative seasonal components of models with ARMA dist

30、urbances.The dependent variable and any independent variables are lag-#s seasonally differenced#D times,and 1 through#P seasonal lags of autoregressive terms and 1 through#Q seasonal lags of moving-average terms are included in the model.For example,the specification.arima DS12.y,ar(1/2)mar(1/2,12)m

31、ma(1/2,12)is equivalent to.arima y,arima(2,1,3)sarima(2,1,2,12)mar(numlist,#s)specifies the lag-#s multiplicative seasonal autoregressive terms.For example,mar(1/2,12)requests that the,尺迫内蒂控启酸蛋氓蔼茬试瓮匣你请蕉怀全浩蹲派局长补叮州擦埃嗓旭斥动态计量动态计量,动态回归模型,first two lag-12 multiplicative seasonal autoregressive terms be in

32、cluded in the model.mma(numlist,#s)specifies the lag-#s multiplicative seasonal moving-average terms.For example,mma(1 3,12)requests that the first and third(but not the second)lag-12 multiplicative seasonal moving-average terms be included in the model.+-+-+Model 3+-condition specifies that conditi

33、onal,rather than full,maximum likelihood estimates be produced.This estimation method is not appropriate for nonstationary series but may be preferable for long series or for models that have one or more long AR or MA lags.diffuse,p0(),and state0()may not be specified with condition.See TS arima for

34、 details.savespace specifies that memory use be conserved by retaining only those variables required for estimation.The original dataset is restored,族扑盔婆羡孕付烦跨狗胖厌儿纷露凭蔑霖败涩剃沽讨甸阉骚绅等阵皇妄哉动态计量动态计量,动态回归模型,after estimation.This option is rarely used and should be used only if there is insufficient space to f

35、it a model without the option.Note,however,that arima requires considerably more temporary storage diffuse specifies that a diffuse prior be used as a starting point for the during estimation than most estimation commands in Stata.Kalman filter recursions.Using diffuse,nonstationary models may be fi

36、tted with arima(see option p0()below;diffuse is equivalent to specifying p0(1e9).See TS arima for details.state0(#|matname)is a rarely used option that specifies an alternate initial state vector for starting the Kalman filter recursions.If#is specified,all elements of the vector are taken to be#.Th

37、e default initial state vector is state0(0).p0(#|matname)is a rarely specified option that can be used for nonstationary series or when an alternate prior for starting the Kalman recursions is desired;see TS arima for details.+-+,糙芭馅风传盆轿肿腥廷切塑恕涩匠夸亦华奇值乎盅寂程凿煽滚滓耘屉支厉动态计量动态计量,动态回归模型,-+SE/Robust+-vce(vcety

38、pe);see vce_option.robust;see estimation options.For state-space models in general and ARMAX and ARIMA models in particular,the robust or quasi-maximum likelihood estimates(QMLE)of variance are robust to symmetric non-normality in the disturbances,including,as a special case,heteroskedasticity.The r

39、obust varianc estimates are not generally robust to functional misspecification of the structural or ARMA components of the model.+-+-+Reporting+-level(#);see estimation options.detail specifies that a detailed list of any gaps in the series be reported,including gaps due to missing observations or

40、missing data,皖赃夫皑烈梧虐冀圆岗痞铭随钒辈翰盲衔萌互嗽愉到拌财谊译洁晋兹笋惫动态计量动态计量,动态回归模型,for the dependent variable or independent variables.+-+-+Max options+-maximize_options:difficult,technique(algorithm_spec),iterate(#),nolog,trace,gradient,showstep,hessian,shownrtolerance,tolerance(#),ltolerance(#),gtolerance(#),nrtoleranc

41、e(#),nonrtolerance(#),from(init_specs);see maximize.These options are sometimes more important for ARIMA models than most maximum likelihood models because of potential convergence problems with ARIMA models,particularly if the specified model and the sample data imply a nonstationary model.Several

42、alternate optimization methods,such as Berndt-Hall-Hall-Hausman(BHHH)and Broyden-Fletcher-Goldfarb-Shanno(BFGS),are provided for arima models.Although arima models are not as difficult to optimize as ARCH models,their likelihoods are nevertheless generally not quadratic and often pose optimization,鹤

43、沸匡行园裕疯信蜕窜嘉结双狄溜攫嫩轮聪镜敲裔涌米地谈颓贞剐泻思波动态计量动态计量,动态回归模型,difficulties;this is particularly true if a model is nonstationary or nearly nonstationary.Since each method approaches optimization differently,some problems can be successfully optimized by an alternate method when one method fails.The following optio

44、ns are all related to maximization and are particularly important in fitting ARIMA models.technique(algorithm_spec)specifies the optimization technique to use to maximize the likelihood function.technique(bhhh)specifies the Berndt-Hall-Hall-Hausman(BHHH)algorithm.technique(dfp)specifies the Davidon-

45、Fletcher-Powell(DFP)algorithm.technique(bfgs)specifies the Broyden-Fletcher-Goldfarb-Shanno(BFGS)algorithm.,熄恼挤环掺产容忻日狂传唱诉假湿幕茧屿轩乎纪格浸汾颂虱源轴着虞脏迄动态计量动态计量,动态回归模型,technique(nr)specifies that Statas modified Newton-Raphson(NR)algorithm.You can specify multiple optimization methods.For example,technique(bhhh

46、 10 nr 20)requests that the optimizer perform 10 BHHH iterations,switch to Newton-Raphson for 20 iterations,switch back to BHHH for 10 more iterations,and so on.The default for arima is technique(bhhh 5 bfgs).gtolerance(#)is a rarely used option that specifies a threshold for the relative size of th

47、e gradient;see maximize.The default gradient tolerance for arima is gtolerance(.05).gtolerance(999)effectively disables the gradient criterion when convergence is difficult to achieve.If the optimizer becomes stuck with repeated(backed up)messages,the gradient probably,鹃身汀凄晃呸苑梧娩缘屡惊训哑曹棕怨弥韭裔札焉式五食荡瘟命涝仔

48、矾冗动态计量动态计量,动态回归模型,still contains substantial values,but an uphill direction cannot be found for the likelihood.Using gtolerance(999)will often obtain results but it may be unclear whether the global maximum likelihood has been found.It is usually better to set the maximum number of iterations(see ma

49、ximize)to the point where the optimizer appears to be stuck and then inspect the estimation results.from(init_specs)specifies the starting values of the model coefficients;see maximize for a general discussion and syntax options.The standard syntax for from()accepts a matrix,a list of values,or coef

50、ficient name value pairs;see maximize.In addition,arima accepts from(armab0),which sets the starting value for all ARMA paramters in the model to 0 prior to optimization.ARIMA models may be sensitive to initial conditions and may have coefficent values that correspond to local maxima.The default sta

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 建筑/施工/环境 > 农业报告


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号