![时间序列实验报告 南邮_第1页](http://file4.renrendoc.com/view/2c4ea4276a9e714f6377f48629870877/2c4ea4276a9e714f6377f486298708771.gif)
![时间序列实验报告 南邮_第2页](http://file4.renrendoc.com/view/2c4ea4276a9e714f6377f48629870877/2c4ea4276a9e714f6377f486298708772.gif)
![时间序列实验报告 南邮_第3页](http://file4.renrendoc.com/view/2c4ea4276a9e714f6377f48629870877/2c4ea4276a9e714f6377f486298708773.gif)
![时间序列实验报告 南邮_第4页](http://file4.renrendoc.com/view/2c4ea4276a9e714f6377f48629870877/2c4ea4276a9e714f6377f486298708774.gif)
![时间序列实验报告 南邮_第5页](http://file4.renrendoc.com/view/2c4ea4276a9e714f6377f48629870877/2c4ea4276a9e714f6377f486298708775.gif)
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
实验报告课程名称:应用时间序列分析实验名称:1、AR(p)模型的建立2、MA(2)模型的建立姓名:学号:专业:2011/2012学年第二学期一、实验名称:AR(p)模型的建立实验题目:设是均值为0,方差为4的白噪声序列,AR(4)模型的自回归系数为:,在计算机上模拟产生一个符合此模型的长为505的序列片断用以上的前500个数据对时间序列进行建模用递推预测法预测后5个数据,与真实数据作比较,检验预测效果。解:(1)模拟产生的序列片段如下:y=Columns1through8-3.0115-0.4913-1.36873.11011.9303-5.45050.97132.2109Columns9through16-1.2292-1.59101.66082.3495-2.3499-0.2582-1.44640.9370Columns17through245.0390-3.2327-4.24444.79893.2164-8.22902.91360.1697Columns25through32-1.07832.07070.7740-6.82256.39785.7760-5.9233-0.8295Columns33through400.66661.2286-0.1926-0.3677-2.09925.48240.1906-6.8613Columns41through485.2866-0.4314-2.80517.0118-3.7868-6.485410.6271-1.0108Columns49through56-10.08624.60205.1677-2.3879-3.29160.52802.3153-2.7350Columns57through64-2.95713.0543-1.98080.28933.6138-7.3608-1.16609.5504Columns65through72-3.1104-9.21252.79094.35321.1851-7.1267-1.02648.5112Columns73through80-0.2044-5.1959-3.70695.28163.7306-6.2134-3.87497.8110Columns81through882.0997-4.5645-2.14722.6052-0.43490.59191.2679-0.0857Columns89through96-3.66640.21537.1634-6.27170.10406.8105-8.3276-0.4350Columns97through1043.6186-4.27755.2114-3.4466-0.61991.6929-4.00367.6894Columns105through112-2.6102-7.90896.30561.5315-3.95792.4816-4.5898-1.1868Columns113through1207.8002-0.6759-3.2535-2.75810.11269.4258-6.8551-4.2839Columns121through12810.5221-3.0099-1.9472-2.7494-1.909811.2869-4.9504-5.2373Columns129through1366.7684-0.5676-3.5597-0.2689-1.19331.81161.7438-0.2612Columns137through144-2.83633.1383-0.0308-2.56481.4620-0.28873.2397-5.9515Columns145through152-1.47523.95842.2703-1.78070.4023-1.4120-0.20760.5407Columns153through1601.55260.7051-4.0550-2.66986.01362.7703-4.25950.7071Columns161through1682.5372-3.01202.18581.8995-6.63246.82561.0549-5.9479Columns169through1760.95313.02582.9257-5.2861-0.78423.37801.0210-0.3349Columns177through184-3.84460.49655.7991-0.3215-6.89741.70245.6270-1.9008Columns185through192-1.4881-0.86963.03140.5860-5.78264.38885.7783-5.1955Columns193through200-1.38781.7243-2.52225.2636-2.6575-7.12608.49683.6154Columns201through208-7.17513.71952.7619-8.36874.24914.1151-7.35723.6860Columns209through216-2.0531-0.06316.3721-2.7227-3.19044.1804-1.75820.6708Columns217through2243.2699-8.48867.21086.0303-10.7265-0.714510.1001-4.0922Columns225through232-1.6599-0.04062.8558-2.3197-0.45880.02163.3968-2.6884Columns233through240-0.6342-1.62861.05073.3779-3.5150-0.82423.6008-4.7464Columns241through2485.10262.0630-5.50933.86581.0882-6.16582.81004.0318Columns249through256-3.6046-4.19181.02263.22290.0375-2.95413.00860.2380Columns257through264-3.74922.53311.7747-5.37035.46083.4905-7.3279-2.6620Columns265through2729.4319-0.8458-4.5714-2.96923.40433.8051-6.04002.1726Columns273through2804.5037-5.53714.4343-3.51781.09136.3165-7.85750.5403Columns281through2889.0514-6.0723-4.89205.0654-1.38751.1500-0.4290-3.5838Columns289through2964.7410-3.0700-2.59416.3313-5.36190.58792.0697-2.0324Columns297through3041.7856-0.8449-1.22725.7955-5.2438-2.81395.0147-1.0879Columns305through312-2.63801.22830.36452.2275-3.3424-4.20516.23241.0154Columns313through320-8.57285.76684.1540-8.16740.73646.0714-0.99970.6739Columns321through328-4.11213.03692.7603-1.82560.7510-4.54421.81145.4674Columns329through336-2.9812-2.95911.60941.0632-2.64801.0914-0.0546-1.8429Columns337through3445.3746-0.7979-1.88550.6210-4.47165.72304.3358-5.3402Columns345through352-4.81186.96751.7789-1.3200-1.5859-4.32625.56750.3256Columns353through360-0.3572-2.5902-4.34499.63402.5981-12.94121.882412.2863Columns361through368-9.14521.00353.7852-3.0002-0.14020.7155-3.97017.2786Columns369through376-0.9130-8.46425.18226.4002-7.5651-4.11124.3005-0.2634Columns377through3842.1669-5.1498-0.61803.34352.3200-4.24601.1908-2.3843Columns385through3922.84236.0873-10.19283.20302.2334-6.48924.46145.0492Columns393through400-11.08291.790011.6900-10.6026-1.43975.2062-0.88024.5367Columns401through408-3.4989-4.38103.2413-0.2933-2.98891.76593.38960.6292Columns409through416-8.61565.99605.1603-6.9035-2.08696.9094-3.45481.0683Columns417through4241.5681-6.92156.17613.2325-6.3756-1.49095.3916-2.8793Columns425through4320.22891.9325-1.79211.89342.3294-8.54922.66629.0353Columns433through440-8.81931.96454.0842-9.07932.93522.1271-4.30144.4163Columns441through448-1.5371-1.43913.5964-2.7223-4.06103.35791.4479-3.3166Columns449through4563.2111-2.76350.55017.0086-7.04711.38506.0075-3.2775Columns457through464-5.29746.81693.2370-9.5313-0.57019.6021-1.3397-4.9063Columns465through4721.94401.60103.1436-5.3105-2.55334.2755-2.1573-2.4211Columns473through4806.5430-4.8326-2.09248.8315-7.73341.85655.4822-4.2892Columns481through488-0.56925.5068-5.45960.42701.1964-1.14141.70670.2516Columns489through496-1.14553.8274-5.5062-2.86228.81321.3864-12.08907.4490Columns497through5040.1772-2.80131.8506-0.6116-2.18046.6749-6.5396-1.3930Columns505through51010.2065-3.1238-7.89824.67192.6848-4.3594(2)自协方差函数的柱形图和偏相关系数的柱形图如下:自协方差函数的柱形图偏相关系数的柱形图自协方差函数r为r=Columns1through820.0513-6.6164-11.10179.5431-0.2496-2.06292.4396-4.8641Columns9through162.63553.9648-5.42920.77902.2003-1.75971.7278-1.4072Columns17through24-1.35353.5581-1.7129-1.93272.4862-0.1686-0.8467-0.0134Columns25through300.25090.4141-0.3106-0.28250.16850.0729偏相关系数b为b=Columns1through8-0.3300-0.7435-0.2206-0.5679-0.02390.0030-0.07220.0207Columns9through16-0.03140.02180.0637-0.03420.01240.0260-0.00550.0191Columns17through240.04530.0092-0.0204-0.08440.00640.0022-0.02700.0762Columns25through30-0.02630.04860.01700.01670.01170结合图可知,自协方差函数是拖尾的,而偏相关系数是四阶截尾的可以建立AR(4)模型(3)根据Levinson递推公式法:得估计。预测数据:ans=1.0e-242*0.2044-0.06750.0223-0.00730.0024新数据ans=-3.1238-7.89824.67192.6848-4.3594通过比较发现虽然预测差距较大,但在实际情况中预测效果还是比较理想的。利用MATLAB软件编程的代码如下:a1=-0.9;a2=-1.4;a3=-0.7;a4=-0.6;x(1)=0;x(2)=0;x(3)=0;x(4)=0;r=zeros(1,30);fori=5:610x(i)=a1*x(i-1)+a2*x(i-2)+a3*x(i-3)+a4*x(i-4)+unifrnd(-4,4);endfori=1:510y(i)=x(i+100);endybar=mean(y);fori=1:30forj=1:500-ir(i)=r(i)+(y(j)-ybar)*(y(j+i-1)-ybar);endendr=r/500;bar(r,'r')%title(‘自协方差函数’)-------------------画出自协方差函数的柱形图b=zeros(1,30);forn=1:29gamma=zeros(n,n);v=zeros(n,1);fori=1:nv(i)=r(i+1);forj=1:ngamma(i,j)=r(abs(i-j)+1);endenda=inv(gamma)*v;t=0;fork=1:nt=t+a(k)*r(k+1);endsigma(n)=r(1)-t;b(n)=a(n);endbar(b,'b')axis([1,30,-1,1])%title(‘PCF’)------------画出偏相关系数的柱形图fori=1:12bic(i)=log(sigma(i))+i*log(500)/500;aic(i)=log(sigma(i))+2*i/500;endsi=zeros(1,29);A=zeros(29);si(1)=r(1);a(1,1)=r(2)/si(1);fork=2:29nu=0;de=0;si(k)=si(k-1)*(1-a(k-1,k-1));forj=1:k-1nu=nu+r(k-j+1)*a(k-1,j);de=de+r(j+1)*a(k-1,j);endnu=r(k+1)-nu;de=r(1)-de;a(k,k)=nu/de;forj=1:k-1a(k,j)=a(k-1,j)-a(k,k)*a(k-1,k-j);endendfori=1:29c(i)=a(i,i);endcfori=1:496e(i)=y(i+4)-a(4,1)*y(i+3)-a(4,2)*y(i+2)-a(4,3)*y(i+1)-a(4,4)*y(i);endebar=mean(e);sd=495*std(e);p=zeros(1,495);fori=1:495forj=1:496-ip(i)=p(i)+(e(j)-ebar)*(e(j+i-1)-ebar);endp=p/sd;endpp=pp*495;zz(1)=x(101);fori=2:510zz(i)=c(1)*zz(i-1);endzz(506:510)y(506:510)二、实验名称:MA(2)模型的建立实验题目:设是正态标准白噪声序列,模型的滑动平均系数为,(1)在计算机上模拟产生一个符合此模型的长为205的序列片断(2)用以上的前200个数据对时间序列进行建模(3)用递推预测法预测后5个数据,与真实数据作比较,检验预测效果。解:(1)模拟产生的序列片段如下:x=Columns1through8000.8937-1.0692-1.24052.1677-0.47390.0886Columns9through161.2618-0.0702-0.05160.9826-1.21023.1267-2.02741.8741Columns17through240.8872-0.55760.6813-0.72390.7706-2.16721.82140.1299Columns25through32-1.21692.55660.1585-1.76500.57020.3030-1.87921.3908Columns33through400.05430.70141.44430.36161.7366-1.47691.6848-1.0635Columns41through48-1.51581.1961-2.45342.3093-2.54732.1427-0.7455-0.6622Columns49through56-1.39440.6682-2.63211.2362-0.67091.8274-0.13730.2609Columns57through641.2574-1.75250.9375-0.80730.0169-0.35481.3048-2.8399Columns65through722.5027-0.82060.46740.78060.21811.09250.1529-0.1131Columns73through800.2265-0.2423-1.56860.5132-0.85560.05761.3263-1.0629Columns81through881.95920.11920.8903-1.00181.5866-0.6610-1.00260.1051Columns89through960.8011-1.41351.3046-0.2699-0.3953-0.07290.3268-1.6708Columns97through1041.7475-0.6733-0.59960.7120-1.6411-1.62161.5312-2.8544Columns105through1121.4242-0.37880.1174-0.8391-0.2681-0.5173-1.6633-0.5597Columns113through1201.2622-1.7239-0.12770.8048-2.0324-0.6361-0.23380.0936Columns121through128-0.70041.3010-1.50270.8124-0.8518-1.3923-0.71950.8740Columns129through136-1.61270.05981.2401-0.7937-0.52632.1700-1.35182.3126Columns137through1440.3834-0.30390.03020.2564-1.2708-0.68120.80170.5146Columns145through152-1.14810.6526-0.10550.1778-1.4802-0.13030.0195-0.9052Columns153through1600.4367-0.96570.6146-0.79150.09311.2549-1.68040.2273Columns161through1680.8947-2.24410.9913-1.34240.9770-0.2805-0.1590-1.4969Columns169through1761.3326-0.06610.0685-1.03401.7435-1.8387-0.6348-1.0796Columns177through1840.3197-1.56420.5601-0.7331-0.17950.39640.12771.9153Columns185through192-2.19421.48900.6744-1.8571-0.33010.92900.2883-0.0759Columns193through2002.6784-0.24583.0289-1.18440.51090.28120.4577-2.0633Columns201through2082.2825-1.87461.4341-1.92371.2335-2.90270.8957-0.7460Columns209through210-1.00321.8019(2)根据时间序列图,可知该样本具有平稳性。时
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 河南省周口市川汇区18中市级名校2024-2025学年初三下学期“在线模拟考试”(第一次月考)生物试题含解析
- 后勤副经理岗位说明书
- 河南省永州市新田县第一中学2025年高三下五校联考物理试题含解析
- 河南省信阳市2024年四下数学期末学业质量监测模拟试题含解析
- 分子间作用力 同步练习 高二下学期化学鲁科版(2019)选择性必修2
- 河南省新乡市2024届数学三下期末学业质量监测模拟试题含解析
- DB4117T 412-2024 火炬松松梢螟防治技术规程
- 国潮风年终总结
- 中等职业技术学校实习实训管理制度
- 2024拍摄服务委托合同书协议
- 数学与地理的结合课件
- 《西游记》中的艺术形象及其塑造
- 美术新课标解读 课件
- 细木工板产品质量
- 中风的护理查房图
- 2022年二级建造师继续教育-市政工程专业知识单选
- 二极管及应用-PN结的形成及特性(电子技术课件)
- 我的心爱之物听课评课稿
- 《全的针灸方法》课件
- 癫痫发作严重程度量表
- 仪 器 设 备 购 置 申 请 表
评论
0/150
提交评论