Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 10 Dec 2009 08:50:22 -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/2009/Dec/10/t12604602667vsh7pbreomq8pe.htm/, Retrieved Fri, 26 Apr 2024 21:52:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65508, Retrieved Fri, 26 Apr 2024 21:52:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact155
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-06 10:44:58] [1e83ffa964db6f7ea6ccc4e7b5acbbff]
- R PD    [ARIMA Forecasting] [] [2009-12-10 15:50:22] [6dfcce621b31349cab7f0d189e6f8a9d] [Current]
Feedback Forum

Post a new message
Dataseries X:
116222
110924
103753
99983
93302
91496
119321
139261
133739
123913
113438
109416
109406
105645
101328
97686
93093
91382
122257
139183
139887
131822
116805
113706
113012
110452
107005
102841
98173
98181
137277
147579
146571
138920
130340
128140
127059
122860
117702
113537
108366
111078
150739
159129
157928
147768
137507
136919
136151
133001
125554
119647
114158
116193
152803
161761
160942
149470
139208
134588
130322
126611
122401
117352
112135
112879
148729
157230
157221
146681
136524
132111




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65508&T=0

[TABLE]
[ROW][C]Summary of computational 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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65508&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65508&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 computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







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[60])
48136919-------
49136151-------
50133001-------
51125554-------
52119647-------
53114158-------
54116193-------
55152803-------
56161761-------
57160942-------
58149470-------
59139208-------
60134588-------
61130322133820128656.5945138983.40550.09210.38530.18810.3853
62126611130670123367.8419137972.15810.1380.53720.26580.1465
63122401123223114279.7193132166.28070.42850.22890.30470.0064
64117352117316106989.1889127642.81110.49730.16720.32915e-04
65112135111827100281.2742123372.72580.47920.17410.34621e-04
66112879113862101214.2911126509.70890.43950.60550.3597e-04
67148729150472136810.913164133.0870.401310.3690.9887
68157230159430144825.6837174034.31630.38390.92450.37720.9996
69157221158611143120.7834174101.21660.43020.56940.3840.9988
70146681147139130810.878163467.1220.47810.11310.38980.934
71136524136877119751.9212154002.07880.48390.13090.39480.6033
72132111132257114370.4385150143.56150.49360.320.39920.3992

\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[60]) \tabularnewline
48 & 136919 & - & - & - & - & - & - & - \tabularnewline
49 & 136151 & - & - & - & - & - & - & - \tabularnewline
50 & 133001 & - & - & - & - & - & - & - \tabularnewline
51 & 125554 & - & - & - & - & - & - & - \tabularnewline
52 & 119647 & - & - & - & - & - & - & - \tabularnewline
53 & 114158 & - & - & - & - & - & - & - \tabularnewline
54 & 116193 & - & - & - & - & - & - & - \tabularnewline
55 & 152803 & - & - & - & - & - & - & - \tabularnewline
56 & 161761 & - & - & - & - & - & - & - \tabularnewline
57 & 160942 & - & - & - & - & - & - & - \tabularnewline
58 & 149470 & - & - & - & - & - & - & - \tabularnewline
59 & 139208 & - & - & - & - & - & - & - \tabularnewline
60 & 134588 & - & - & - & - & - & - & - \tabularnewline
61 & 130322 & 133820 & 128656.5945 & 138983.4055 & 0.0921 & 0.3853 & 0.1881 & 0.3853 \tabularnewline
62 & 126611 & 130670 & 123367.8419 & 137972.1581 & 0.138 & 0.5372 & 0.2658 & 0.1465 \tabularnewline
63 & 122401 & 123223 & 114279.7193 & 132166.2807 & 0.4285 & 0.2289 & 0.3047 & 0.0064 \tabularnewline
64 & 117352 & 117316 & 106989.1889 & 127642.8111 & 0.4973 & 0.1672 & 0.3291 & 5e-04 \tabularnewline
65 & 112135 & 111827 & 100281.2742 & 123372.7258 & 0.4792 & 0.1741 & 0.3462 & 1e-04 \tabularnewline
66 & 112879 & 113862 & 101214.2911 & 126509.7089 & 0.4395 & 0.6055 & 0.359 & 7e-04 \tabularnewline
67 & 148729 & 150472 & 136810.913 & 164133.087 & 0.4013 & 1 & 0.369 & 0.9887 \tabularnewline
68 & 157230 & 159430 & 144825.6837 & 174034.3163 & 0.3839 & 0.9245 & 0.3772 & 0.9996 \tabularnewline
69 & 157221 & 158611 & 143120.7834 & 174101.2166 & 0.4302 & 0.5694 & 0.384 & 0.9988 \tabularnewline
70 & 146681 & 147139 & 130810.878 & 163467.122 & 0.4781 & 0.1131 & 0.3898 & 0.934 \tabularnewline
71 & 136524 & 136877 & 119751.9212 & 154002.0788 & 0.4839 & 0.1309 & 0.3948 & 0.6033 \tabularnewline
72 & 132111 & 132257 & 114370.4385 & 150143.5615 & 0.4936 & 0.32 & 0.3992 & 0.3992 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65508&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[60])[/C][/ROW]
[ROW][C]48[/C][C]136919[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]136151[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]133001[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]125554[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]119647[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]114158[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]116193[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]152803[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]161761[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]160942[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]149470[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]139208[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]134588[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]130322[/C][C]133820[/C][C]128656.5945[/C][C]138983.4055[/C][C]0.0921[/C][C]0.3853[/C][C]0.1881[/C][C]0.3853[/C][/ROW]
[ROW][C]62[/C][C]126611[/C][C]130670[/C][C]123367.8419[/C][C]137972.1581[/C][C]0.138[/C][C]0.5372[/C][C]0.2658[/C][C]0.1465[/C][/ROW]
[ROW][C]63[/C][C]122401[/C][C]123223[/C][C]114279.7193[/C][C]132166.2807[/C][C]0.4285[/C][C]0.2289[/C][C]0.3047[/C][C]0.0064[/C][/ROW]
[ROW][C]64[/C][C]117352[/C][C]117316[/C][C]106989.1889[/C][C]127642.8111[/C][C]0.4973[/C][C]0.1672[/C][C]0.3291[/C][C]5e-04[/C][/ROW]
[ROW][C]65[/C][C]112135[/C][C]111827[/C][C]100281.2742[/C][C]123372.7258[/C][C]0.4792[/C][C]0.1741[/C][C]0.3462[/C][C]1e-04[/C][/ROW]
[ROW][C]66[/C][C]112879[/C][C]113862[/C][C]101214.2911[/C][C]126509.7089[/C][C]0.4395[/C][C]0.6055[/C][C]0.359[/C][C]7e-04[/C][/ROW]
[ROW][C]67[/C][C]148729[/C][C]150472[/C][C]136810.913[/C][C]164133.087[/C][C]0.4013[/C][C]1[/C][C]0.369[/C][C]0.9887[/C][/ROW]
[ROW][C]68[/C][C]157230[/C][C]159430[/C][C]144825.6837[/C][C]174034.3163[/C][C]0.3839[/C][C]0.9245[/C][C]0.3772[/C][C]0.9996[/C][/ROW]
[ROW][C]69[/C][C]157221[/C][C]158611[/C][C]143120.7834[/C][C]174101.2166[/C][C]0.4302[/C][C]0.5694[/C][C]0.384[/C][C]0.9988[/C][/ROW]
[ROW][C]70[/C][C]146681[/C][C]147139[/C][C]130810.878[/C][C]163467.122[/C][C]0.4781[/C][C]0.1131[/C][C]0.3898[/C][C]0.934[/C][/ROW]
[ROW][C]71[/C][C]136524[/C][C]136877[/C][C]119751.9212[/C][C]154002.0788[/C][C]0.4839[/C][C]0.1309[/C][C]0.3948[/C][C]0.6033[/C][/ROW]
[ROW][C]72[/C][C]132111[/C][C]132257[/C][C]114370.4385[/C][C]150143.5615[/C][C]0.4936[/C][C]0.32[/C][C]0.3992[/C][C]0.3992[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65508&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65508&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[60])
48136919-------
49136151-------
50133001-------
51125554-------
52119647-------
53114158-------
54116193-------
55152803-------
56161761-------
57160942-------
58149470-------
59139208-------
60134588-------
61130322133820128656.5945138983.40550.09210.38530.18810.3853
62126611130670123367.8419137972.15810.1380.53720.26580.1465
63122401123223114279.7193132166.28070.42850.22890.30470.0064
64117352117316106989.1889127642.81110.49730.16720.32915e-04
65112135111827100281.2742123372.72580.47920.17410.34621e-04
66112879113862101214.2911126509.70890.43950.60550.3597e-04
67148729150472136810.913164133.0870.401310.3690.9887
68157230159430144825.6837174034.31630.38390.92450.37720.9996
69157221158611143120.7834174101.21660.43020.56940.3840.9988
70146681147139130810.878163467.1220.47810.11310.38980.934
71136524136877119751.9212154002.07880.48390.13090.39480.6033
72132111132257114370.4385150143.56150.49360.320.39920.3992







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0197-0.026101223600400
620.0285-0.03110.02861647548114355742.53788.8973
630.037-0.00670.021367568497957233129.812
640.04493e-040.01612967347116.252710.5564
650.05270.00280.0134948645896665.82428.3051
660.0567-0.00860.01269662895074936.33332252.7619
670.0463-0.01160.012530380494783952.42862187.2248
680.0467-0.01380.012648400004790958.3752188.8258
690.0498-0.00880.012219321004473307.44442115.0195
700.0566-0.00310.01132097644046953.12011.704
710.0638-0.00260.01051246093690376.36361921.0352
720.069-0.00110.0097213163384621.33331839.734

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0197 & -0.0261 & 0 & 12236004 & 0 & 0 \tabularnewline
62 & 0.0285 & -0.0311 & 0.0286 & 16475481 & 14355742.5 & 3788.8973 \tabularnewline
63 & 0.037 & -0.0067 & 0.0213 & 675684 & 9795723 & 3129.812 \tabularnewline
64 & 0.0449 & 3e-04 & 0.016 & 1296 & 7347116.25 & 2710.5564 \tabularnewline
65 & 0.0527 & 0.0028 & 0.0134 & 94864 & 5896665.8 & 2428.3051 \tabularnewline
66 & 0.0567 & -0.0086 & 0.0126 & 966289 & 5074936.3333 & 2252.7619 \tabularnewline
67 & 0.0463 & -0.0116 & 0.0125 & 3038049 & 4783952.4286 & 2187.2248 \tabularnewline
68 & 0.0467 & -0.0138 & 0.0126 & 4840000 & 4790958.375 & 2188.8258 \tabularnewline
69 & 0.0498 & -0.0088 & 0.0122 & 1932100 & 4473307.4444 & 2115.0195 \tabularnewline
70 & 0.0566 & -0.0031 & 0.0113 & 209764 & 4046953.1 & 2011.704 \tabularnewline
71 & 0.0638 & -0.0026 & 0.0105 & 124609 & 3690376.3636 & 1921.0352 \tabularnewline
72 & 0.069 & -0.0011 & 0.0097 & 21316 & 3384621.3333 & 1839.734 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65508&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]61[/C][C]0.0197[/C][C]-0.0261[/C][C]0[/C][C]12236004[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]62[/C][C]0.0285[/C][C]-0.0311[/C][C]0.0286[/C][C]16475481[/C][C]14355742.5[/C][C]3788.8973[/C][/ROW]
[ROW][C]63[/C][C]0.037[/C][C]-0.0067[/C][C]0.0213[/C][C]675684[/C][C]9795723[/C][C]3129.812[/C][/ROW]
[ROW][C]64[/C][C]0.0449[/C][C]3e-04[/C][C]0.016[/C][C]1296[/C][C]7347116.25[/C][C]2710.5564[/C][/ROW]
[ROW][C]65[/C][C]0.0527[/C][C]0.0028[/C][C]0.0134[/C][C]94864[/C][C]5896665.8[/C][C]2428.3051[/C][/ROW]
[ROW][C]66[/C][C]0.0567[/C][C]-0.0086[/C][C]0.0126[/C][C]966289[/C][C]5074936.3333[/C][C]2252.7619[/C][/ROW]
[ROW][C]67[/C][C]0.0463[/C][C]-0.0116[/C][C]0.0125[/C][C]3038049[/C][C]4783952.4286[/C][C]2187.2248[/C][/ROW]
[ROW][C]68[/C][C]0.0467[/C][C]-0.0138[/C][C]0.0126[/C][C]4840000[/C][C]4790958.375[/C][C]2188.8258[/C][/ROW]
[ROW][C]69[/C][C]0.0498[/C][C]-0.0088[/C][C]0.0122[/C][C]1932100[/C][C]4473307.4444[/C][C]2115.0195[/C][/ROW]
[ROW][C]70[/C][C]0.0566[/C][C]-0.0031[/C][C]0.0113[/C][C]209764[/C][C]4046953.1[/C][C]2011.704[/C][/ROW]
[ROW][C]71[/C][C]0.0638[/C][C]-0.0026[/C][C]0.0105[/C][C]124609[/C][C]3690376.3636[/C][C]1921.0352[/C][/ROW]
[ROW][C]72[/C][C]0.069[/C][C]-0.0011[/C][C]0.0097[/C][C]21316[/C][C]3384621.3333[/C][C]1839.734[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65508&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65508&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
610.0197-0.026101223600400
620.0285-0.03110.02861647548114355742.53788.8973
630.037-0.00670.021367568497957233129.812
640.04493e-040.01612967347116.252710.5564
650.05270.00280.0134948645896665.82428.3051
660.0567-0.00860.01269662895074936.33332252.7619
670.0463-0.01160.012530380494783952.42862187.2248
680.0467-0.01380.012648400004790958.3752188.8258
690.0498-0.00880.012219321004473307.44442115.0195
700.0566-0.00310.01132097644046953.12011.704
710.0638-0.00260.01051246093690376.36361921.0352
720.069-0.00110.0097213163384621.33331839.734



Parameters (Session):
par1 = FALSE ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; 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,par1))
(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.mape1 <- array(0, dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- 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.se[i] = (x[nx+i] - forecast$pred[i])^2
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[1] = abs(perf.pe[1])
perf.mse[1] = abs(perf.se[1])
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
}
perf.rmse = sqrt(perf.mse1)
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:par1] <- 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.mape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[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')