lec213经典教材《金融时间序列分析》RueyS.Tsay英文第三版高清教材以及最新2013年高清讲义_第1页
lec213经典教材《金融时间序列分析》RueyS.Tsay英文第三版高清教材以及最新2013年高清讲义_第2页
lec213经典教材《金融时间序列分析》RueyS.Tsay英文第三版高清教材以及最新2013年高清讲义_第3页
lec213经典教材《金融时间序列分析》RueyS.Tsay英文第三版高清教材以及最新2013年高清讲义_第4页
lec213经典教材《金融时间序列分析》RueyS.Tsay英文第三版高清教材以及最新2013年高清讲义_第5页
已阅读5页,还剩22页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、 # LectureNotesofBus41202(Spring2013)AnalysisofFinancialTimeSeriesRueyS.TsaySimpleARmodels:(Regressionwithlaggedvariables.)Motivatingexample:ThegrowthrateofU.S.quarterlyrealGNPfrom1947to1991.Recallthatthemodeldiscussedbeforeisrt=0.005+0.35r/_i+0.18心_20.14几_3+%aa=0.01.ThisiscalledanAR(3)modelbecauset

2、hegrowthrate门dependsonthegrowthratesofthepastthreequarters.Howdowespecifythismodelfromthedata?Isitadequateforthedata?Whataretheimplicationsofthemodel?Thesearethequestionsweshalladdressinthislecture.Anotherexample:U.S.monthlyunemploymentrate.AR(1)model:Form:几=+01门_1+%where0and机arerealnumbers,whichare

3、referredtoasparameters(tobeestimatedfromthedatainanapplication).Forexample,rt=0.005+0.2n_i+atStationarity:necessaryandsufficientcondition|0i|2.Stochasticbusinesscycle:if+4020,then几showschar-ncteristicsofbusinesscycleswithaveragelength.27Twherethecosineinverseisstatedinradian.Ifwedenotethesolutionsof

4、thepolynomialasbi,wherei=/T5thenwehave0i=2aand02=(以+以)sothat27TInRorS-Plus,onecanobtain/a2+b2usingthecommandMod.Forecasts:SimilartoAR(1)modelsSimulationinR:Usethecommandarima.simyl=arimasim(model=list(ar=c(13,一.4),1000)y2=arimasim(model=list(ar=c(8,一.7),1000)ChecktheACFandPACFoftheabovetwosimulateds

5、eries.Discussion:(Referenceonly)AnAR(2)modelcanbewrittenasanAR(1)modelifoneexpandsthedimension.Specifically,wehave4=0i(n_i“)+血(几2“)+心rt-i=rt-i4(anidentity.)Now,puttingthetwoequationstogether,wehave几一“.n-i一“010210rt-i-“atThisisa2-dimensionalAR(1)model.SeveralpropertiesoftheAR(2)modelcanbeobtainedfrom

6、theexpandedAR(1)model.BuildinganARmodelOrderspecificationPartialACF:(naive,buteffective)UseconsecutivefittingsSeeText(p.40)fordetailsKeyfeature:PACFcutsoffatlagpforanAR(p)model.Illustration:SeethePACFoftheU.S.quarterlygrowthrateofGNP.Akaikeinformationcriterion2/4W)=ln()+foranAR()model,where进istheMLE

7、ofresidualvariance.FindtheARorderwithminimumAICfor60,P.BICcriterion:BIC)=ln&)+辔1Series:dgnpcooCMoLLonames(ml)1rder116Hn.used1111series*11ar11order.max”frequency11Hvar.pred1x-mean11aic11Hpartialacf11resid11methodcallasy.var.coefplot(ml$resid,type=;1;)%Plotresidualsofthefittedmodel(notshown)Box.test(m

8、l$resid,lag=10,type=;Ljungy)%ModelcheckingBox-Ljungtestdata:ml$residX-squared=7.0808,df=10,p-value=0.7178m2=arima(x,order=c(3,0,0)%Anotherapproachwithordergiven.m2Call:Coefficients:arlar2ar3034800.1793-0.1423s.e.0.07450.077800745arima(x=x,order=c(3,0,0)intercept%Fittedmodelis0.0077%y(t)=0.348y(t-1)+

9、0.179y(t-2)0.0012%-0142y(t-3)+a(t),%wherey(t)=x(t)-0.0077sigma*2estimatedas9427e-05:loglikelihood=565.84,aic=-1121.68names(m2)1Hcoef”sigma2var.coef11maskloglik11aic117,armaresiduals11call11series11code11Hn.condH13modelBoxtest(m2$residuals,lag=10,type=Ljung)Box-Ljungtestdata:m2$residualsX-squared=7.0

10、169,df=10,p-value=0.7239plot(m2$residuals,type=J1J)%Residualplottsdiag(m2)%obtain3plotsofmodelchecking(notshowninhandout)pl=c(l,-m2$coef1:3)%Furtheranalysisofthefittedmodelroots=polyroot(pl)roots11.590253+1.063882e+00i-1.920152-3530887e-17i1.590253-1.063882e+00iMod(roots)11.9133081.9201521.913308k=2

11、*pi/acos(1.590253/1.913308)k110.65638predict(m2,8)%Predictionl-stepto8-stepahead$predTimeSeries:Start=177End=184Frequency=110.0012362540.0045555190.0074549060.00795851850.0081814420.0079368450.0078200460.007703826$seTimeSeries:Start=177End=184Frequency=110.0097093220.0102805100.0106863050.0106889945

12、0.0106897330.0106947710.0106955110.010696190Anotherexample:IVIonthlyUSunemploymentTatefromJanuary1948toFebruary2013.Demonstration:inclass,includingtheRscriptsfore,foreplot:andbacktest.require(quantmod)getSymbols(NRATE,src=,FREDu)rate=as.numeric(UNRATE$UNRATE)unrate=ts(rate,frequency=12,start=c(1948,

13、1)plot(unrate)head(UNRATE)UNRATE1948-01-013.41948-02-013.81948-06-013.6acf(rate)acf(diff(rate)par(mfcol=c(2,l)acf(rate)acf(diff(rate)ml=ar(diff(rate),method=Hmleu)varp:redHpartialacfncallx.mean11aic11resid11method11asy.var.coef11names(ml)1,ordernar6Hnused11order.max111series1frequencyml$order112ml=a

14、rima(rate,order=c(12,1,0)mlCall:Coefficients:arlar2ar3ar4ar5ar6ar7ar8ar90.02330.21940.15310.08890.1239-0.0059-0.02490.0166-0.0014s.e.0.03560.03560.03630.03690.03700.0373003730.03710.03700)arima(x=rate,order=c(12,1,arlOarilarl2-0.09550.0350-0.12820.03650.03570.0358sigma*2estimatedas0.03778:loglikelih

15、ood=17075,aic=-3155tsdiag(ml,gof=24)m2=arima(rate,order=c(2,1,1),seasonal=list(order=c(l,0,1),period=12)m2Call:arima(x=rate,order=c(2,1,1),seasonal=list(order=c(l,0,1),period=12)Coefficients:sigma*2estimatedas0.0363:loglikelihood=185.07,aic=-358.13tsdiag(m2,gof=24)#useforecastoriginatt=770.arlar20.5

16、9820.2300s.e.0.06250.0391malsarismal-0.59020.5515-0.81350.05770.07100.0521source(fore.R11)fore(ml,rate,770,12)TimeSeries:Start=771End=782Frequency=118.2155248.1151508.0808518.0106707.9903777.9635257.9560297.95121897.9905477.9899618.0290948.041167TimeSeries:Start=771End=782Frequency=110.19522650.2793

17、9620.37015620.46097550.55196690.64942920.741492780.83073920.91916381.00459921.08094941.1574140rate771:78218.28.18.28.28.28.17.87.97.87.87.97.7p2=fore(m2,rate,770,12)source(foreplot.R)foreplot(p2,rate,770,750)%Noshowninthehandoutsource(backtest.R)backtest(ml,rate,760,1)1HRMSEofout-of-sampleforecasts1

18、110.1288231111Meanabsoluteerrorofout-of-sampleforecasts1110.1029483backtest(m2,rate,760,1)1HRMSEofout-of-sampleforecasts1110.1156268111Meanabsoluteerrorofout-of-sampleforecasts10.09050361Moving-average(MA)modelModelwithfinitememory!SomedailystockreturnshaveminorserialcorrelationsandcanbemodeledasMAo

19、rARmodels.MA(1)modelForm:rt=“+9at_iStationarity:alwaysstationary.Mean(orexpectation):E(心)=“Variance:Var(n)=(1+的代.Autocovariance:Lag1:Cov(几”_i)=一吠Lag0:Cov(n,=0for1.Thus,rtisnotrelatedto化_2,几一3:ACF:pi=磊,pg=0for1.Finitememory!MA(1)modelsdonotrememberwhathappentwotimeperiodsago.Forecast(atorigint=n):14

20、1-stepahead:rn,(l)=“一Oan.Why?Becauseattimen,anisknown,butan+iisnot.1-stepaheadforecasterror:en(l)=aniwithvarianceMulti-stepahead:=“for01.Thus,foranMA(1)model,themulti-stepaheadforecastsarejustthemeanoftheseries.Why?Becausethemodelhasmemoryof1timeperiod.Multi-stepaheadforecasterror:Varianceofmulti-st

21、epaheadforecasterror:(1+02)必=varianceofn.Invertibility:Concept:rtisaproperlinearcombinationofatandthepastobservationsn_i?心_2,.Whyisitimportant?Itprovidesasimplewaytoobtaintheshockat,Foraninvertiblemodel,thedependenceofrton化_0convergestozeroas0increases.Condition:62.Forecastsgothethemeanafter2periods

22、.BuildinganMAmodelSpecification:UsesampleACFSampleACFsareallsmallafterlagqforanMA(g)series.(SeetestofACF.)Constantterm?Checkthesamplemean.Estimation:usemaximumlikelihoodmethodConditional:Assumeat=0for0Exact:Treata/with1,butpi=01-况/Var(77)丰0i.ThisisthedifferencebetweenAR(1)andARMA(1,1)models.PACF:doe

23、snotcutoffatfinitelags.BuildinganARMA(1,1)modelSpecification:useEACForAICWhatisEACF?Howtouseit?Seetext.Estimation:cond.orexnctlikelihoodmethodModelchecking:asbeforeForecast:MA(1)affectsthe1-stepaheadforecast.OthersaresimilartothoseofAR(1)models.Threemodelrepresentations:ARMAform:compact.,usefulinest

24、imationandforecastingARrepresentation:(bylongdivision)rt=(/)()+at+7Tin_i+7T2心_2+Ittellshowrtdependsonitspastvalues.MArepresentation:(bylongdivision)rt=/i+at+妙g_i+妙2他_2TIttellshowrtdependsonthepastshocks.Forastationaryseries,血convergestozeroasiToo.Thus,theeffectofanyshockistransitory.TheMArepresentat

25、ionisparticularlyusefulincomputingvariancesofforecasterrors.Fora-st.epaheadforecast,theforecasterrorisen()=an+e+血+仇_1術+1ThevarianceofforecasterrorisVar%(0)=(1+悄卜诡_1)龙.Unit-rootNonstationarityRandomwalkFormpt=pt-i+atUnitroot?ItisanAR(1)modelwithcoefficient0i=1.Nonstationary:Why?Becausethevarianceof几d

26、ivergestoinfinityastincreases.Strongmemory:sampleACFapproaches1foranyfinitelag.RepeatedsubstitutionshowsTOC o 1-5 h zooooPt=工=工i=0i=0where册=1foralli.Thus,血doesnotconvergetozero.Theeffectofanyshockispermanent.RandomwalkwithdriftForm:pt=M+Pt-i+g“丰0.HasaunitrootNonstationarvzStrongmemoryHasatimetrendwi

27、thslopeWhy?differencing1stdifference:rt=PtPt-iIfptisthelogprice,thenthe1stdifferenceissimplythelogreturn.Typically,1stdifferencemeansthechange:or*incre-mentoftheoriginalseries.Seasonaldifference:yt=Pt.Pt-s.wheresistheperiodicity,e.g.s=4forquarterlyseriesands=12formonthlyseries.Ifptdenotesquarterlyea

28、rnings,thenytisthechangeinearningfromthesamequarteroneyearbefore.MeaningoftheconstantterminamodelMAmodel:meanARmodel:relatedtomean1stdifferenced:timeslope,etc.PracticalimplicationinfinancialtimeseriesExample:MonthlylogreturnsofGeneralElectrics(GE)from1926to1999(74years)Samplemean:1.04%,std(/z)=0.26V

29、erysignificant!isabout12.45%ayear$1investmentinthebeginningof1926isworthannualcompoundedpayment:$5907quarterlycompoundedpayment:$8720monthlycompoundedpayment:$9570Continuouslycompounded?Unit-roottestLetptbethelogpriceofanasset.Totestthatptisnotpredictable(i.e.hasaunitroot),twomodelsarecommonlyemploy

30、ed:Pt=01仇1+etPt=00+血仇_1+勺Thehypothesisofinterestis耳:0i=1vsHa:0ida=read.table(rq-gdpc96.txt,header=T)gdp=log(da,4)adfTest(gdp,lag=4,type=c(11cH)#AssumeanAR(4)modelfortheseriesTitle:AugmentedDickey-FullerTestTestResults:PARAMETER:LagOrder:4STATISTIC:Dickey-Fuller:-1.7433PVALUE:0.4076#cannotrejectthenu

31、llhypothesisofaunitroot*Amorecarefulanalysisx=diff(gdp)ord=ar(x)#identifyanARmodelforthedifferencedseriesordCall:ar(x=x)Coefficients:1230.34290.1238-0.1226Orderselected3sigma*2estimatedas8.522e-05#AnAR(3)forthedifferenceddataisconfirmed#OurpreviousanalysisisjustifiedDiscussion:ThecommandarimaonR.Dealingwiththeconstantterm.Ifthereisanydifferencing,noconstantisused.Thesubcommandinclude.mean=Tinthearimacommand.Fixingsomeparameters.Usesubcommandfixedinarima.Useunemploymentrateseriesasanexample.RDemonstration:Handlingoutliersrl=ml

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论