Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationMon, 21 Jan 2008 12:08:53 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2008/Jan/21/t1200942209qf99pfone7fcdbp.htm/, Retrieved Wed, 15 May 2024 13:12:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=8041, Retrieved Wed, 15 May 2024 13:12:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsKlaas Van Pelt
Estimated Impact282
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Forecasting] [2008-01-21 19:08:53] [6abd901c2e17b7d5559c695bbff3d863] [Current]
Feedback Forum

Post a new message
Dataseries X:
37702
30364
32609
30212
29965
28352
25814
22414
20506
28806
22228
13971
36845
35338
35022
34777
26887
23970
22780
17351
21382
24561
17409
11514
31514
27071
29462
26105
22397
23843
21705
18089
20764
25316
17704
15548
28029
29383
36438
32034
22679
24319
18004
17537
20366
22782
19169
13807
29743
25591
29096
26482
22405
27044
17970
18730
19684
19785
18479
10698
31956
29506
34506
27165
26736
23691
18157
17328
18205
20995
17382
9367
31124
26551
30651
25859
25100
25778
20418
18688




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=8041&T=0

[TABLE]
[ROW][C]Summary of compuational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=8041&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=8041&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[68])
5618730-------
5719684-------
5819785-------
5918479-------
6010698-------
6131956-------
6229506-------
6334506-------
6427165-------
6526736-------
6623691-------
6718157-------
6817328-------
691820519770.946214701.593524840.2990.27240.82760.51340.8276
702099520072.486614917.196725227.77640.36290.76110.54350.8516
711738218562.623513322.805823802.44130.32940.18150.51250.6779
72936710979.30535656.301816302.30880.27640.00920.54120.0097
733112431161.082325757.246536564.91810.494610.38661
742655126179.2520694.755331663.74460.44720.03860.11720.9992
753065129623.239124059.254835187.22350.35870.86040.04271
762585924566.161318923.80730208.51560.32670.01730.18330.994
772510024411.769718692.119230131.42030.40680.310.21290.9924
782577825420.48419624.567931216.40.45190.54320.72070.9969
792041818134.146312262.955424005.33730.22290.00540.4970.6061
801868818067.371612121.858724012.88450.41890.21920.59630.5963

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast \tabularnewline
time & Y[t] & F[t] & 95% LB & 95% UB & p-value(H0: Y[t] = F[t]) & P(F[t]>Y[t-1]) & P(F[t]>Y[t-s]) & P(F[t]>Y[68]) \tabularnewline
56 & 18730 & - & - & - & - & - & - & - \tabularnewline
57 & 19684 & - & - & - & - & - & - & - \tabularnewline
58 & 19785 & - & - & - & - & - & - & - \tabularnewline
59 & 18479 & - & - & - & - & - & - & - \tabularnewline
60 & 10698 & - & - & - & - & - & - & - \tabularnewline
61 & 31956 & - & - & - & - & - & - & - \tabularnewline
62 & 29506 & - & - & - & - & - & - & - \tabularnewline
63 & 34506 & - & - & - & - & - & - & - \tabularnewline
64 & 27165 & - & - & - & - & - & - & - \tabularnewline
65 & 26736 & - & - & - & - & - & - & - \tabularnewline
66 & 23691 & - & - & - & - & - & - & - \tabularnewline
67 & 18157 & - & - & - & - & - & - & - \tabularnewline
68 & 17328 & - & - & - & - & - & - & - \tabularnewline
69 & 18205 & 19770.9462 & 14701.5935 & 24840.299 & 0.2724 & 0.8276 & 0.5134 & 0.8276 \tabularnewline
70 & 20995 & 20072.4866 & 14917.1967 & 25227.7764 & 0.3629 & 0.7611 & 0.5435 & 0.8516 \tabularnewline
71 & 17382 & 18562.6235 & 13322.8058 & 23802.4413 & 0.3294 & 0.1815 & 0.5125 & 0.6779 \tabularnewline
72 & 9367 & 10979.3053 & 5656.3018 & 16302.3088 & 0.2764 & 0.0092 & 0.5412 & 0.0097 \tabularnewline
73 & 31124 & 31161.0823 & 25757.2465 & 36564.9181 & 0.4946 & 1 & 0.3866 & 1 \tabularnewline
74 & 26551 & 26179.25 & 20694.7553 & 31663.7446 & 0.4472 & 0.0386 & 0.1172 & 0.9992 \tabularnewline
75 & 30651 & 29623.2391 & 24059.2548 & 35187.2235 & 0.3587 & 0.8604 & 0.0427 & 1 \tabularnewline
76 & 25859 & 24566.1613 & 18923.807 & 30208.5156 & 0.3267 & 0.0173 & 0.1833 & 0.994 \tabularnewline
77 & 25100 & 24411.7697 & 18692.1192 & 30131.4203 & 0.4068 & 0.31 & 0.2129 & 0.9924 \tabularnewline
78 & 25778 & 25420.484 & 19624.5679 & 31216.4 & 0.4519 & 0.5432 & 0.7207 & 0.9969 \tabularnewline
79 & 20418 & 18134.1463 & 12262.9554 & 24005.3373 & 0.2229 & 0.0054 & 0.497 & 0.6061 \tabularnewline
80 & 18688 & 18067.3716 & 12121.8587 & 24012.8845 & 0.4189 & 0.2192 & 0.5963 & 0.5963 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=8041&T=1

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast[/C][/ROW]
[ROW][C]time[/C][C]Y[t][/C][C]F[t][/C][C]95% LB[/C][C]95% UB[/C][C]p-value(H0: Y[t] = F[t])[/C][C]P(F[t]>Y[t-1])[/C][C]P(F[t]>Y[t-s])[/C][C]P(F[t]>Y[68])[/C][/ROW]
[ROW][C]56[/C][C]18730[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]19684[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]19785[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]18479[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]10698[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]31956[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]29506[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]34506[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]27165[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]26736[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]23691[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]18157[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]17328[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]18205[/C][C]19770.9462[/C][C]14701.5935[/C][C]24840.299[/C][C]0.2724[/C][C]0.8276[/C][C]0.5134[/C][C]0.8276[/C][/ROW]
[ROW][C]70[/C][C]20995[/C][C]20072.4866[/C][C]14917.1967[/C][C]25227.7764[/C][C]0.3629[/C][C]0.7611[/C][C]0.5435[/C][C]0.8516[/C][/ROW]
[ROW][C]71[/C][C]17382[/C][C]18562.6235[/C][C]13322.8058[/C][C]23802.4413[/C][C]0.3294[/C][C]0.1815[/C][C]0.5125[/C][C]0.6779[/C][/ROW]
[ROW][C]72[/C][C]9367[/C][C]10979.3053[/C][C]5656.3018[/C][C]16302.3088[/C][C]0.2764[/C][C]0.0092[/C][C]0.5412[/C][C]0.0097[/C][/ROW]
[ROW][C]73[/C][C]31124[/C][C]31161.0823[/C][C]25757.2465[/C][C]36564.9181[/C][C]0.4946[/C][C]1[/C][C]0.3866[/C][C]1[/C][/ROW]
[ROW][C]74[/C][C]26551[/C][C]26179.25[/C][C]20694.7553[/C][C]31663.7446[/C][C]0.4472[/C][C]0.0386[/C][C]0.1172[/C][C]0.9992[/C][/ROW]
[ROW][C]75[/C][C]30651[/C][C]29623.2391[/C][C]24059.2548[/C][C]35187.2235[/C][C]0.3587[/C][C]0.8604[/C][C]0.0427[/C][C]1[/C][/ROW]
[ROW][C]76[/C][C]25859[/C][C]24566.1613[/C][C]18923.807[/C][C]30208.5156[/C][C]0.3267[/C][C]0.0173[/C][C]0.1833[/C][C]0.994[/C][/ROW]
[ROW][C]77[/C][C]25100[/C][C]24411.7697[/C][C]18692.1192[/C][C]30131.4203[/C][C]0.4068[/C][C]0.31[/C][C]0.2129[/C][C]0.9924[/C][/ROW]
[ROW][C]78[/C][C]25778[/C][C]25420.484[/C][C]19624.5679[/C][C]31216.4[/C][C]0.4519[/C][C]0.5432[/C][C]0.7207[/C][C]0.9969[/C][/ROW]
[ROW][C]79[/C][C]20418[/C][C]18134.1463[/C][C]12262.9554[/C][C]24005.3373[/C][C]0.2229[/C][C]0.0054[/C][C]0.497[/C][C]0.6061[/C][/ROW]
[ROW][C]80[/C][C]18688[/C][C]18067.3716[/C][C]12121.8587[/C][C]24012.8845[/C][C]0.4189[/C][C]0.2192[/C][C]0.5963[/C][C]0.5963[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=8041&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=8041&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[68])
5618730-------
5719684-------
5819785-------
5918479-------
6010698-------
6131956-------
6229506-------
6334506-------
6427165-------
6526736-------
6623691-------
6718157-------
6817328-------
691820519770.946214701.593524840.2990.27240.82760.51340.8276
702099520072.486614917.196725227.77640.36290.76110.54350.8516
711738218562.623513322.805823802.44130.32940.18150.51250.6779
72936710979.30535656.301816302.30880.27640.00920.54120.0097
733112431161.082325757.246536564.91810.494610.38661
742655126179.2520694.755331663.74460.44720.03860.11720.9992
753065129623.239124059.254835187.22350.35870.86040.04271
762585924566.161318923.80730208.51560.32670.01730.18330.994
772510024411.769718692.119230131.42030.40680.310.21290.9924
782577825420.48419624.567931216.40.45190.54320.72070.9969
792041818134.146312262.955424005.33730.22290.00540.4970.6061
801868818067.371612121.858724012.88450.41890.21920.59630.5963







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
690.1308-0.07920.00662452187.5737204348.9645452.0497
700.1310.0460.0038851031.047270919.2539266.3067
710.144-0.06360.00531393871.9644116155.997340.8167
720.2474-0.14680.01222599528.4149216627.3679465.4325
730.0885-0.00121e-041375.0972114.591410.7047
740.10690.01420.0012138198.076711516.5064107.315
750.09580.03470.00291056292.41988024.3682296.689
760.11720.05260.00441671431.8946139285.9912373.2104
770.11950.02820.0023473660.899439471.7416198.675
780.11630.01410.0012127817.715210651.4763103.206
790.16520.12590.01055215987.5263434665.6272659.2918
800.16790.03440.0029385179.587532098.299179.16

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
69 & 0.1308 & -0.0792 & 0.0066 & 2452187.5737 & 204348.9645 & 452.0497 \tabularnewline
70 & 0.131 & 0.046 & 0.0038 & 851031.0472 & 70919.2539 & 266.3067 \tabularnewline
71 & 0.144 & -0.0636 & 0.0053 & 1393871.9644 & 116155.997 & 340.8167 \tabularnewline
72 & 0.2474 & -0.1468 & 0.0122 & 2599528.4149 & 216627.3679 & 465.4325 \tabularnewline
73 & 0.0885 & -0.0012 & 1e-04 & 1375.0972 & 114.5914 & 10.7047 \tabularnewline
74 & 0.1069 & 0.0142 & 0.0012 & 138198.0767 & 11516.5064 & 107.315 \tabularnewline
75 & 0.0958 & 0.0347 & 0.0029 & 1056292.419 & 88024.3682 & 296.689 \tabularnewline
76 & 0.1172 & 0.0526 & 0.0044 & 1671431.8946 & 139285.9912 & 373.2104 \tabularnewline
77 & 0.1195 & 0.0282 & 0.0023 & 473660.8994 & 39471.7416 & 198.675 \tabularnewline
78 & 0.1163 & 0.0141 & 0.0012 & 127817.7152 & 10651.4763 & 103.206 \tabularnewline
79 & 0.1652 & 0.1259 & 0.0105 & 5215987.5263 & 434665.6272 & 659.2918 \tabularnewline
80 & 0.1679 & 0.0344 & 0.0029 & 385179.5875 & 32098.299 & 179.16 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=8041&T=2

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast Performance[/C][/ROW]
[ROW][C]time[/C][C]% S.E.[/C][C]PE[/C][C]MAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]69[/C][C]0.1308[/C][C]-0.0792[/C][C]0.0066[/C][C]2452187.5737[/C][C]204348.9645[/C][C]452.0497[/C][/ROW]
[ROW][C]70[/C][C]0.131[/C][C]0.046[/C][C]0.0038[/C][C]851031.0472[/C][C]70919.2539[/C][C]266.3067[/C][/ROW]
[ROW][C]71[/C][C]0.144[/C][C]-0.0636[/C][C]0.0053[/C][C]1393871.9644[/C][C]116155.997[/C][C]340.8167[/C][/ROW]
[ROW][C]72[/C][C]0.2474[/C][C]-0.1468[/C][C]0.0122[/C][C]2599528.4149[/C][C]216627.3679[/C][C]465.4325[/C][/ROW]
[ROW][C]73[/C][C]0.0885[/C][C]-0.0012[/C][C]1e-04[/C][C]1375.0972[/C][C]114.5914[/C][C]10.7047[/C][/ROW]
[ROW][C]74[/C][C]0.1069[/C][C]0.0142[/C][C]0.0012[/C][C]138198.0767[/C][C]11516.5064[/C][C]107.315[/C][/ROW]
[ROW][C]75[/C][C]0.0958[/C][C]0.0347[/C][C]0.0029[/C][C]1056292.419[/C][C]88024.3682[/C][C]296.689[/C][/ROW]
[ROW][C]76[/C][C]0.1172[/C][C]0.0526[/C][C]0.0044[/C][C]1671431.8946[/C][C]139285.9912[/C][C]373.2104[/C][/ROW]
[ROW][C]77[/C][C]0.1195[/C][C]0.0282[/C][C]0.0023[/C][C]473660.8994[/C][C]39471.7416[/C][C]198.675[/C][/ROW]
[ROW][C]78[/C][C]0.1163[/C][C]0.0141[/C][C]0.0012[/C][C]127817.7152[/C][C]10651.4763[/C][C]103.206[/C][/ROW]
[ROW][C]79[/C][C]0.1652[/C][C]0.1259[/C][C]0.0105[/C][C]5215987.5263[/C][C]434665.6272[/C][C]659.2918[/C][/ROW]
[ROW][C]80[/C][C]0.1679[/C][C]0.0344[/C][C]0.0029[/C][C]385179.5875[/C][C]32098.299[/C][C]179.16[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=8041&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=8041&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
690.1308-0.07920.00662452187.5737204348.9645452.0497
700.1310.0460.0038851031.047270919.2539266.3067
710.144-0.06360.00531393871.9644116155.997340.8167
720.2474-0.14680.01222599528.4149216627.3679465.4325
730.0885-0.00121e-041375.0972114.591410.7047
740.10690.01420.0012138198.076711516.5064107.315
750.09580.03470.00291056292.41988024.3682296.689
760.11720.05260.00441671431.8946139285.9912373.2104
770.11950.02820.0023473660.899439471.7416198.675
780.11630.01410.0012127817.715210651.4763103.206
790.16520.12590.01055215987.5263434665.6272659.2918
800.16790.03440.0029385179.587532098.299179.16



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par1 <- as.numeric(par1) #cut off periods
par2 <- as.numeric(par2) #lambda
par3 <- as.numeric(par3) #degree of non-seasonal differencing
par4 <- as.numeric(par4) #degree of seasonal differencing
par5 <- as.numeric(par5) #seasonal period
par6 <- as.numeric(par6) #p
par7 <- as.numeric(par7) #q
par8 <- as.numeric(par8) #P
par9 <- as.numeric(par9) #Q
if (par10 == 'TRUE') par10 <- TRUE
if (par10 == 'FALSE') par10 <- FALSE
if (par2 == 0) x <- log(x)
if (par2 != 0) x <- x^par2
lx <- length(x)
first <- lx - 2*par1
nx <- lx - par1
nx1 <- nx + 1
fx <- lx - nx
if (fx < 1) {
fx <- par5
nx1 <- lx + fx - 1
first <- lx - 2*fx
}
first <- 1
if (fx < 3) fx <- round(lx/10,0)
(arima.out <- arima(x[1:nx], order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5), include.mean=par10, method='ML'))
(forecast <- predict(arima.out,fx))
(lb <- forecast$pred - 1.96 * forecast$se)
(ub <- forecast$pred + 1.96 * forecast$se)
if (par2 == 0) {
x <- exp(x)
forecast$pred <- exp(forecast$pred)
lb <- exp(lb)
ub <- exp(ub)
}
if (par2 != 0) {
x <- x^(1/par2)
forecast$pred <- forecast$pred^(1/par2)
lb <- lb^(1/par2)
ub <- ub^(1/par2)
}
if (par2 < 0) {
olb <- lb
lb <- ub
ub <- olb
}
(actandfor <- c(x[1:nx], forecast$pred))
(perc.se <- (ub-forecast$pred)/1.96/forecast$pred)
bitmap(file='test1.png')
opar <- par(mar=c(4,4,2,2),las=1)
ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub))
plot(x,ylim=ylim,type='n',xlim=c(first,lx))
usr <- par('usr')
rect(usr[1],usr[3],nx+1,usr[4],border=NA,col='lemonchiffon')
rect(nx1,usr[3],usr[2],usr[4],border=NA,col='lavender')
abline(h= (-3:3)*2 , col ='gray', lty =3)
polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = 'orange', lty=2,border=NA)
lines(nx1:lx, lb , lty=2)
lines(nx1:lx, ub , lty=2)
lines(x, lwd=2)
lines(nx1:lx, forecast$pred , lwd=2 , col ='white')
box()
par(opar)
dev.off()
prob.dec <- array(NA, dim=fx)
prob.sdec <- array(NA, dim=fx)
prob.ldec <- array(NA, dim=fx)
prob.pval <- array(NA, dim=fx)
perf.pe <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / forecast$pred[i]
perf.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD)
prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD)
prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD)
prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD)
}
perf.mape = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
bitmap(file='test2.png')
plot(forecast$pred, pch=19, type='b',main='ARIMA Extrapolation Forecast', ylab='Forecast and 95% CI', xlab='time',ylim=c(min(lb),max(ub)))
dum <- forecast$pred
dum[1:12] <- x[(nx+1):lx]
lines(dum, lty=1)
lines(ub,lty=3)
lines(lb,lty=3)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast',9,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'Y[t]',1,header=TRUE)
a<-table.element(a,'F[t]',1,header=TRUE)
a<-table.element(a,'95% LB',1,header=TRUE)
a<-table.element(a,'95% UB',1,header=TRUE)
a<-table.element(a,'p-value
(H0: Y[t] = F[t])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-1])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-s])',1,header=TRUE)
mylab <- paste('P(F[t]>Y[',nx,sep='')
mylab <- paste(mylab,'])',sep='')
a<-table.element(a,mylab,1,header=TRUE)
a<-table.row.end(a)
for (i in (nx-par5):nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.row.end(a)
}
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(x[nx+i],4))
a<-table.element(a,round(forecast$pred[i],4))
a<-table.element(a,round(lb[i],4))
a<-table.element(a,round(ub[i],4))
a<-table.element(a,round((1-prob.pval[i]),4))
a<-table.element(a,round((1-prob.dec[i]),4))
a<-table.element(a,round((1-prob.sdec[i]),4))
a<-table.element(a,round((1-prob.ldec[i]),4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast Performance',7,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'% S.E.',1,header=TRUE)
a<-table.element(a,'PE',1,header=TRUE)
a<-table.element(a,'MAPE',1,header=TRUE)
a<-table.element(a,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',1,header=TRUE)
a<-table.row.end(a)
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(perc.se[i],4))
a<-table.element(a,round(perf.pe[i],4))
a<-table.element(a,round(perf.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')