時間序列實驗報告 南郵_第1頁
時間序列實驗報告 南郵_第2頁
時間序列實驗報告 南郵_第3頁
時間序列實驗報告 南郵_第4頁
時間序列實驗報告 南郵_第5頁
已閱讀5頁,還剩7頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

實驗報告課程名稱:應(yīng)用時間序列分析實驗名稱:1、AR(p)模型的建立2、MA(2)模型的建立姓名:學(xué)號:專業(yè):2011/2012學(xué)年第二學(xué)期一、實驗名稱:AR(p)模型的建立實驗題目:設(shè)是均值為0,方差為4的白噪聲序列,AR(4)模型的自回歸系數(shù)為:,在計算機上模擬產(chǎn)生一個符合此模型的長為505的序列片斷用以上的前500個數(shù)據(jù)對時間序列進行建模用遞推預(yù)測法預(yù)測后5個數(shù)據(jù),與真實數(shù)據(jù)作比較,檢驗預(yù)測效果。解:(1)模擬產(chǎn)生的序列片段如下: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)自協(xié)方差函數(shù)的柱形圖和偏相關(guān)系數(shù)的柱形圖如下:自協(xié)方差函數(shù)的柱形圖偏相關(guān)系數(shù)的柱形圖自協(xié)方差函數(shù)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偏相關(guān)系數(shù)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結(jié)合圖可知,自協(xié)方差函數(shù)是拖尾的,而偏相關(guān)系數(shù)是四階截尾的可以建立AR(4)模型(3)根據(jù)Levinson遞推公式法:得估計。預(yù)測數(shù)據(jù):ans=1.0e-242*0.2044-0.06750.0223-0.00730.0024新數(shù)據(jù)ans=-3.1238-7.89824.67192.6848-4.3594通過比較發(fā)現(xiàn)雖然預(yù)測差距較大,但在實際情況中預(yù)測效果還是比較理想的。利用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(‘自協(xié)方差函數(shù)’)-------------------畫出自協(xié)方差函數(shù)的柱形圖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’)------------畫出偏相關(guān)系數(shù)的柱形圖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)模型的建立實驗題目:設(shè)是正態(tài)標(biāo)準(zhǔn)白噪聲序列,模型的滑動平均系數(shù)為,(1)在計算機上模擬產(chǎn)生一個符合此模型的長為205的序列片斷(2)用以上的前200個數(shù)據(jù)對時間序列進行建模(3)用遞推預(yù)測法預(yù)測后5個數(shù)據(jù),與真實數(shù)據(jù)作比較,檢驗預(yù)測效果。解:(1)模擬產(chǎn)生的序列片段如下: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)根據(jù)時間序列圖,可知該樣本具有平穩(wěn)性。時

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論