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 computationTue, 03 Dec 2013 11:21:16 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2013/Dec/03/t13860878199u4bjqygzo54pzk.htm/, Retrieved Fri, 19 Apr 2024 10:18:26 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=230361, Retrieved Fri, 19 Apr 2024 10:18:26 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact50
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2013-12-03 16:21:16] [ca0374cc2e3cbab06789b6eb5e649ce0] [Current]
Feedback Forum

Post a new message
Dataseries X:
37
30
47
35
30
43
82
40
47
19
52
136
80
42
54
66
81
63
137
72
107
58
36
52
79
77
54
84
48
96
83
66
61
53
30
74
69
59
42
65
70
100
63
105
82
81
75
102
121
98
76
77
63
37
35
23
40
29
37
51
20
28
13
22
25
13
16
13
16
17
9
17
25
14
8
7
10
7
10
3




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net

\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 & 4 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230361&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]4 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ wold.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230361&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230361&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 time4 seconds
R Server'Herman Ole Andreas Wold' @ wold.wessa.net







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])
5623-------
5740-------
5829-------
5937-------
6051-------
6120-------
6228-------
6313-------
6422-------
6525-------
6613-------
6716-------
6813-------
691616.4372-31.013563.8880.49280.55650.16520.5565
701716.4372-34.226267.10070.49130.50670.31350.5529
71916.4372-37.247170.12160.3930.49180.22640.5499
721716.4372-40.106872.98130.49220.60170.11540.5474
732516.4372-42.828675.70310.38850.49260.45310.5453
741416.4372-45.430878.30530.46920.39310.35710.5434
75816.4372-47.927980.80240.39860.52960.54170.5417
76716.4372-50.331783.20620.39090.59780.43510.5402
771016.4372-52.651985.52640.42750.60550.4040.5388
78716.4372-54.896787.77120.39770.57020.53760.5376
791016.4372-57.072989.94740.43190.59930.50470.5365
80316.4372-59.186692.06110.36380.56630.53550.5355

\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 & 23 & - & - & - & - & - & - & - \tabularnewline
57 & 40 & - & - & - & - & - & - & - \tabularnewline
58 & 29 & - & - & - & - & - & - & - \tabularnewline
59 & 37 & - & - & - & - & - & - & - \tabularnewline
60 & 51 & - & - & - & - & - & - & - \tabularnewline
61 & 20 & - & - & - & - & - & - & - \tabularnewline
62 & 28 & - & - & - & - & - & - & - \tabularnewline
63 & 13 & - & - & - & - & - & - & - \tabularnewline
64 & 22 & - & - & - & - & - & - & - \tabularnewline
65 & 25 & - & - & - & - & - & - & - \tabularnewline
66 & 13 & - & - & - & - & - & - & - \tabularnewline
67 & 16 & - & - & - & - & - & - & - \tabularnewline
68 & 13 & - & - & - & - & - & - & - \tabularnewline
69 & 16 & 16.4372 & -31.0135 & 63.888 & 0.4928 & 0.5565 & 0.1652 & 0.5565 \tabularnewline
70 & 17 & 16.4372 & -34.2262 & 67.1007 & 0.4913 & 0.5067 & 0.3135 & 0.5529 \tabularnewline
71 & 9 & 16.4372 & -37.2471 & 70.1216 & 0.393 & 0.4918 & 0.2264 & 0.5499 \tabularnewline
72 & 17 & 16.4372 & -40.1068 & 72.9813 & 0.4922 & 0.6017 & 0.1154 & 0.5474 \tabularnewline
73 & 25 & 16.4372 & -42.8286 & 75.7031 & 0.3885 & 0.4926 & 0.4531 & 0.5453 \tabularnewline
74 & 14 & 16.4372 & -45.4308 & 78.3053 & 0.4692 & 0.3931 & 0.3571 & 0.5434 \tabularnewline
75 & 8 & 16.4372 & -47.9279 & 80.8024 & 0.3986 & 0.5296 & 0.5417 & 0.5417 \tabularnewline
76 & 7 & 16.4372 & -50.3317 & 83.2062 & 0.3909 & 0.5978 & 0.4351 & 0.5402 \tabularnewline
77 & 10 & 16.4372 & -52.6519 & 85.5264 & 0.4275 & 0.6055 & 0.404 & 0.5388 \tabularnewline
78 & 7 & 16.4372 & -54.8967 & 87.7712 & 0.3977 & 0.5702 & 0.5376 & 0.5376 \tabularnewline
79 & 10 & 16.4372 & -57.0729 & 89.9474 & 0.4319 & 0.5993 & 0.5047 & 0.5365 \tabularnewline
80 & 3 & 16.4372 & -59.1866 & 92.0611 & 0.3638 & 0.5663 & 0.5355 & 0.5355 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230361&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]23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]40[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]20[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]28[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]25[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]16[/C][C]16.4372[/C][C]-31.0135[/C][C]63.888[/C][C]0.4928[/C][C]0.5565[/C][C]0.1652[/C][C]0.5565[/C][/ROW]
[ROW][C]70[/C][C]17[/C][C]16.4372[/C][C]-34.2262[/C][C]67.1007[/C][C]0.4913[/C][C]0.5067[/C][C]0.3135[/C][C]0.5529[/C][/ROW]
[ROW][C]71[/C][C]9[/C][C]16.4372[/C][C]-37.2471[/C][C]70.1216[/C][C]0.393[/C][C]0.4918[/C][C]0.2264[/C][C]0.5499[/C][/ROW]
[ROW][C]72[/C][C]17[/C][C]16.4372[/C][C]-40.1068[/C][C]72.9813[/C][C]0.4922[/C][C]0.6017[/C][C]0.1154[/C][C]0.5474[/C][/ROW]
[ROW][C]73[/C][C]25[/C][C]16.4372[/C][C]-42.8286[/C][C]75.7031[/C][C]0.3885[/C][C]0.4926[/C][C]0.4531[/C][C]0.5453[/C][/ROW]
[ROW][C]74[/C][C]14[/C][C]16.4372[/C][C]-45.4308[/C][C]78.3053[/C][C]0.4692[/C][C]0.3931[/C][C]0.3571[/C][C]0.5434[/C][/ROW]
[ROW][C]75[/C][C]8[/C][C]16.4372[/C][C]-47.9279[/C][C]80.8024[/C][C]0.3986[/C][C]0.5296[/C][C]0.5417[/C][C]0.5417[/C][/ROW]
[ROW][C]76[/C][C]7[/C][C]16.4372[/C][C]-50.3317[/C][C]83.2062[/C][C]0.3909[/C][C]0.5978[/C][C]0.4351[/C][C]0.5402[/C][/ROW]
[ROW][C]77[/C][C]10[/C][C]16.4372[/C][C]-52.6519[/C][C]85.5264[/C][C]0.4275[/C][C]0.6055[/C][C]0.404[/C][C]0.5388[/C][/ROW]
[ROW][C]78[/C][C]7[/C][C]16.4372[/C][C]-54.8967[/C][C]87.7712[/C][C]0.3977[/C][C]0.5702[/C][C]0.5376[/C][C]0.5376[/C][/ROW]
[ROW][C]79[/C][C]10[/C][C]16.4372[/C][C]-57.0729[/C][C]89.9474[/C][C]0.4319[/C][C]0.5993[/C][C]0.5047[/C][C]0.5365[/C][/ROW]
[ROW][C]80[/C][C]3[/C][C]16.4372[/C][C]-59.1866[/C][C]92.0611[/C][C]0.3638[/C][C]0.5663[/C][C]0.5355[/C][C]0.5355[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230361&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230361&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])
5623-------
5740-------
5829-------
5937-------
6051-------
6120-------
6228-------
6313-------
6422-------
6525-------
6613-------
6716-------
6813-------
691616.4372-31.013563.8880.49280.55650.16520.5565
701716.4372-34.226267.10070.49130.50670.31350.5529
71916.4372-37.247170.12160.3930.49180.22640.5499
721716.4372-40.106872.98130.49220.60170.11540.5474
732516.4372-42.828675.70310.38850.49260.45310.5453
741416.4372-45.430878.30530.46920.39310.35710.5434
75816.4372-47.927980.80240.39860.52960.54170.5417
76716.4372-50.331783.20620.39090.59780.43510.5402
771016.4372-52.651985.52640.42750.60550.4040.5388
78716.4372-54.896787.77120.39770.57020.53760.5376
791016.4372-57.072989.94740.43190.59930.50470.5365
80316.4372-59.186692.06110.36380.56630.53550.5355







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
691.4728-0.02730.02730.0270.191200-0.08150.0815
701.57260.03310.03020.03030.31670.25390.50390.10490.0932
711.6663-0.82640.29560.215155.312718.60684.3136-1.38660.5243
721.75510.03310.230.16980.316714.03433.74620.10490.4195
731.83960.34250.25250.218573.320725.89165.08841.59640.6549
741.9204-0.17410.23940.20875.940222.56644.7504-0.45440.6215
751.9979-1.05470.35590.277671.187229.51225.4325-1.5730.7574
762.0725-1.34820.47990.343589.061736.95596.0791-1.75950.8827
772.1445-0.64370.49810.359541.438237.45396.12-1.20020.9179
782.2142-1.34820.58310.404189.061742.61476.528-1.75951.0021
792.2817-0.64370.58860.411641.438242.50776.5198-1.20021.0201
802.3473-4.47910.91280.4925180.559754.01217.3493-2.50521.1439

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
69 & 1.4728 & -0.0273 & 0.0273 & 0.027 & 0.1912 & 0 & 0 & -0.0815 & 0.0815 \tabularnewline
70 & 1.5726 & 0.0331 & 0.0302 & 0.0303 & 0.3167 & 0.2539 & 0.5039 & 0.1049 & 0.0932 \tabularnewline
71 & 1.6663 & -0.8264 & 0.2956 & 0.2151 & 55.3127 & 18.6068 & 4.3136 & -1.3866 & 0.5243 \tabularnewline
72 & 1.7551 & 0.0331 & 0.23 & 0.1698 & 0.3167 & 14.0343 & 3.7462 & 0.1049 & 0.4195 \tabularnewline
73 & 1.8396 & 0.3425 & 0.2525 & 0.2185 & 73.3207 & 25.8916 & 5.0884 & 1.5964 & 0.6549 \tabularnewline
74 & 1.9204 & -0.1741 & 0.2394 & 0.2087 & 5.9402 & 22.5664 & 4.7504 & -0.4544 & 0.6215 \tabularnewline
75 & 1.9979 & -1.0547 & 0.3559 & 0.2776 & 71.1872 & 29.5122 & 5.4325 & -1.573 & 0.7574 \tabularnewline
76 & 2.0725 & -1.3482 & 0.4799 & 0.3435 & 89.0617 & 36.9559 & 6.0791 & -1.7595 & 0.8827 \tabularnewline
77 & 2.1445 & -0.6437 & 0.4981 & 0.3595 & 41.4382 & 37.4539 & 6.12 & -1.2002 & 0.9179 \tabularnewline
78 & 2.2142 & -1.3482 & 0.5831 & 0.4041 & 89.0617 & 42.6147 & 6.528 & -1.7595 & 1.0021 \tabularnewline
79 & 2.2817 & -0.6437 & 0.5886 & 0.4116 & 41.4382 & 42.5077 & 6.5198 & -1.2002 & 1.0201 \tabularnewline
80 & 2.3473 & -4.4791 & 0.9128 & 0.4925 & 180.5597 & 54.0121 & 7.3493 & -2.5052 & 1.1439 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=230361&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]69[/C][C]1.4728[/C][C]-0.0273[/C][C]0.0273[/C][C]0.027[/C][C]0.1912[/C][C]0[/C][C]0[/C][C]-0.0815[/C][C]0.0815[/C][/ROW]
[ROW][C]70[/C][C]1.5726[/C][C]0.0331[/C][C]0.0302[/C][C]0.0303[/C][C]0.3167[/C][C]0.2539[/C][C]0.5039[/C][C]0.1049[/C][C]0.0932[/C][/ROW]
[ROW][C]71[/C][C]1.6663[/C][C]-0.8264[/C][C]0.2956[/C][C]0.2151[/C][C]55.3127[/C][C]18.6068[/C][C]4.3136[/C][C]-1.3866[/C][C]0.5243[/C][/ROW]
[ROW][C]72[/C][C]1.7551[/C][C]0.0331[/C][C]0.23[/C][C]0.1698[/C][C]0.3167[/C][C]14.0343[/C][C]3.7462[/C][C]0.1049[/C][C]0.4195[/C][/ROW]
[ROW][C]73[/C][C]1.8396[/C][C]0.3425[/C][C]0.2525[/C][C]0.2185[/C][C]73.3207[/C][C]25.8916[/C][C]5.0884[/C][C]1.5964[/C][C]0.6549[/C][/ROW]
[ROW][C]74[/C][C]1.9204[/C][C]-0.1741[/C][C]0.2394[/C][C]0.2087[/C][C]5.9402[/C][C]22.5664[/C][C]4.7504[/C][C]-0.4544[/C][C]0.6215[/C][/ROW]
[ROW][C]75[/C][C]1.9979[/C][C]-1.0547[/C][C]0.3559[/C][C]0.2776[/C][C]71.1872[/C][C]29.5122[/C][C]5.4325[/C][C]-1.573[/C][C]0.7574[/C][/ROW]
[ROW][C]76[/C][C]2.0725[/C][C]-1.3482[/C][C]0.4799[/C][C]0.3435[/C][C]89.0617[/C][C]36.9559[/C][C]6.0791[/C][C]-1.7595[/C][C]0.8827[/C][/ROW]
[ROW][C]77[/C][C]2.1445[/C][C]-0.6437[/C][C]0.4981[/C][C]0.3595[/C][C]41.4382[/C][C]37.4539[/C][C]6.12[/C][C]-1.2002[/C][C]0.9179[/C][/ROW]
[ROW][C]78[/C][C]2.2142[/C][C]-1.3482[/C][C]0.5831[/C][C]0.4041[/C][C]89.0617[/C][C]42.6147[/C][C]6.528[/C][C]-1.7595[/C][C]1.0021[/C][/ROW]
[ROW][C]79[/C][C]2.2817[/C][C]-0.6437[/C][C]0.5886[/C][C]0.4116[/C][C]41.4382[/C][C]42.5077[/C][C]6.5198[/C][C]-1.2002[/C][C]1.0201[/C][/ROW]
[ROW][C]80[/C][C]2.3473[/C][C]-4.4791[/C][C]0.9128[/C][C]0.4925[/C][C]180.5597[/C][C]54.0121[/C][C]7.3493[/C][C]-2.5052[/C][C]1.1439[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=230361&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=230361&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
691.4728-0.02730.02730.0270.191200-0.08150.0815
701.57260.03310.03020.03030.31670.25390.50390.10490.0932
711.6663-0.82640.29560.215155.312718.60684.3136-1.38660.5243
721.75510.03310.230.16980.316714.03433.74620.10490.4195
731.83960.34250.25250.218573.320725.89165.08841.59640.6549
741.9204-0.17410.23940.20875.940222.56644.7504-0.45440.6215
751.9979-1.05470.35590.277671.187229.51225.4325-1.5730.7574
762.0725-1.34820.47990.343589.061736.95596.0791-1.75950.8827
772.1445-0.64370.49810.359541.438237.45396.12-1.20020.9179
782.2142-1.34820.58310.404189.061742.61476.528-1.75951.0021
792.2817-0.64370.58860.411641.438242.50776.5198-1.20021.0201
802.3473-4.47910.91280.4925180.559754.01217.3493-2.50521.1439



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 1 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '0'
par7 <- '1'
par6 <- '0'
par5 <- '12'
par4 <- '0'
par3 <- '1'
par2 <- '1'
par1 <- '0'
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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')