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, 12 Dec 2013 03:55:54 -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/12/t1386838570mjy6q8n9cynlm3l.htm/, Retrieved Tue, 07 Dec 2021 12:29:09 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=232221, Retrieved Tue, 07 Dec 2021 12:29:09 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact71
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2013-12-12 08:55:54] [9e6a405f514733ea23d87e4507d39d29] [Current]
Feedback Forum

Post a new message
Dataseries X:
164
96
73
49
39
59
169
169
210
278
298
245
200
188
90
79
78
91
167
169
289
247
275
203
223
104
107
85
75
99
135
211
335
488
326
346
261
224
141
148
145
223
272
445
560
612
467
404
518
404
300
210
196
186
247
343
464
680
711
610
513
292
273
322
189
257
324
404
677
858
895
664
628
308
324
248
272




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 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 & 5 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ wold.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=232221&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]5 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=232221&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=232221&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 time5 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[65])
53196-------
54186-------
55247-------
56343-------
57464-------
58680-------
59711-------
60610-------
61513-------
62292-------
63273-------
64322-------
65189-------
66257252.1072168.6425376.88030.46940.83920.85050.8392
67324409.6421261.8088640.95110.2340.90210.91590.9692
68404537.7032336.6974858.7080.20710.9040.88270.9834
69677761.3215469.63541234.1710.36330.93070.89110.9912
70858931.5542567.02831530.42330.40490.79760.79480.9925
71895850.2124510.97041414.68290.43820.48920.68560.9892
72664737.742437.89051242.92080.38740.27090.68990.9834
73628702.2996412.0881196.89180.38420.56030.77340.979
74308475.4009275.783819.50660.17020.19240.85190.9486
75324355.9765204.2075620.54170.40640.63890.73060.892
76248310.6836176.2819547.55650.3020.45610.46270.843
77272259.9173145.8996463.03780.45360.54580.75310.7531

\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[65]) \tabularnewline
53 & 196 & - & - & - & - & - & - & - \tabularnewline
54 & 186 & - & - & - & - & - & - & - \tabularnewline
55 & 247 & - & - & - & - & - & - & - \tabularnewline
56 & 343 & - & - & - & - & - & - & - \tabularnewline
57 & 464 & - & - & - & - & - & - & - \tabularnewline
58 & 680 & - & - & - & - & - & - & - \tabularnewline
59 & 711 & - & - & - & - & - & - & - \tabularnewline
60 & 610 & - & - & - & - & - & - & - \tabularnewline
61 & 513 & - & - & - & - & - & - & - \tabularnewline
62 & 292 & - & - & - & - & - & - & - \tabularnewline
63 & 273 & - & - & - & - & - & - & - \tabularnewline
64 & 322 & - & - & - & - & - & - & - \tabularnewline
65 & 189 & - & - & - & - & - & - & - \tabularnewline
66 & 257 & 252.1072 & 168.6425 & 376.8803 & 0.4694 & 0.8392 & 0.8505 & 0.8392 \tabularnewline
67 & 324 & 409.6421 & 261.8088 & 640.9511 & 0.234 & 0.9021 & 0.9159 & 0.9692 \tabularnewline
68 & 404 & 537.7032 & 336.6974 & 858.708 & 0.2071 & 0.904 & 0.8827 & 0.9834 \tabularnewline
69 & 677 & 761.3215 & 469.6354 & 1234.171 & 0.3633 & 0.9307 & 0.8911 & 0.9912 \tabularnewline
70 & 858 & 931.5542 & 567.0283 & 1530.4233 & 0.4049 & 0.7976 & 0.7948 & 0.9925 \tabularnewline
71 & 895 & 850.2124 & 510.9704 & 1414.6829 & 0.4382 & 0.4892 & 0.6856 & 0.9892 \tabularnewline
72 & 664 & 737.742 & 437.8905 & 1242.9208 & 0.3874 & 0.2709 & 0.6899 & 0.9834 \tabularnewline
73 & 628 & 702.2996 & 412.088 & 1196.8918 & 0.3842 & 0.5603 & 0.7734 & 0.979 \tabularnewline
74 & 308 & 475.4009 & 275.783 & 819.5066 & 0.1702 & 0.1924 & 0.8519 & 0.9486 \tabularnewline
75 & 324 & 355.9765 & 204.2075 & 620.5417 & 0.4064 & 0.6389 & 0.7306 & 0.892 \tabularnewline
76 & 248 & 310.6836 & 176.2819 & 547.5565 & 0.302 & 0.4561 & 0.4627 & 0.843 \tabularnewline
77 & 272 & 259.9173 & 145.8996 & 463.0378 & 0.4536 & 0.5458 & 0.7531 & 0.7531 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=232221&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[65])[/C][/ROW]
[ROW][C]53[/C][C]196[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]186[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]247[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]343[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]464[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]680[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]711[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]610[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]513[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]292[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]273[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]322[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]189[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]257[/C][C]252.1072[/C][C]168.6425[/C][C]376.8803[/C][C]0.4694[/C][C]0.8392[/C][C]0.8505[/C][C]0.8392[/C][/ROW]
[ROW][C]67[/C][C]324[/C][C]409.6421[/C][C]261.8088[/C][C]640.9511[/C][C]0.234[/C][C]0.9021[/C][C]0.9159[/C][C]0.9692[/C][/ROW]
[ROW][C]68[/C][C]404[/C][C]537.7032[/C][C]336.6974[/C][C]858.708[/C][C]0.2071[/C][C]0.904[/C][C]0.8827[/C][C]0.9834[/C][/ROW]
[ROW][C]69[/C][C]677[/C][C]761.3215[/C][C]469.6354[/C][C]1234.171[/C][C]0.3633[/C][C]0.9307[/C][C]0.8911[/C][C]0.9912[/C][/ROW]
[ROW][C]70[/C][C]858[/C][C]931.5542[/C][C]567.0283[/C][C]1530.4233[/C][C]0.4049[/C][C]0.7976[/C][C]0.7948[/C][C]0.9925[/C][/ROW]
[ROW][C]71[/C][C]895[/C][C]850.2124[/C][C]510.9704[/C][C]1414.6829[/C][C]0.4382[/C][C]0.4892[/C][C]0.6856[/C][C]0.9892[/C][/ROW]
[ROW][C]72[/C][C]664[/C][C]737.742[/C][C]437.8905[/C][C]1242.9208[/C][C]0.3874[/C][C]0.2709[/C][C]0.6899[/C][C]0.9834[/C][/ROW]
[ROW][C]73[/C][C]628[/C][C]702.2996[/C][C]412.088[/C][C]1196.8918[/C][C]0.3842[/C][C]0.5603[/C][C]0.7734[/C][C]0.979[/C][/ROW]
[ROW][C]74[/C][C]308[/C][C]475.4009[/C][C]275.783[/C][C]819.5066[/C][C]0.1702[/C][C]0.1924[/C][C]0.8519[/C][C]0.9486[/C][/ROW]
[ROW][C]75[/C][C]324[/C][C]355.9765[/C][C]204.2075[/C][C]620.5417[/C][C]0.4064[/C][C]0.6389[/C][C]0.7306[/C][C]0.892[/C][/ROW]
[ROW][C]76[/C][C]248[/C][C]310.6836[/C][C]176.2819[/C][C]547.5565[/C][C]0.302[/C][C]0.4561[/C][C]0.4627[/C][C]0.843[/C][/ROW]
[ROW][C]77[/C][C]272[/C][C]259.9173[/C][C]145.8996[/C][C]463.0378[/C][C]0.4536[/C][C]0.5458[/C][C]0.7531[/C][C]0.7531[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=232221&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=232221&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[65])
53196-------
54186-------
55247-------
56343-------
57464-------
58680-------
59711-------
60610-------
61513-------
62292-------
63273-------
64322-------
65189-------
66257252.1072168.6425376.88030.46940.83920.85050.8392
67324409.6421261.8088640.95110.2340.90210.91590.9692
68404537.7032336.6974858.7080.20710.9040.88270.9834
69677761.3215469.63541234.1710.36330.93070.89110.9912
70858931.5542567.02831530.42330.40490.79760.79480.9925
71895850.2124510.97041414.68290.43820.48920.68560.9892
72664737.742437.89051242.92080.38740.27090.68990.9834
73628702.2996412.0881196.89180.38420.56030.77340.979
74308475.4009275.783819.50660.17020.19240.85190.9486
75324355.9765204.2075620.54170.40640.63890.73060.892
76248310.6836176.2819547.55650.3020.45610.46270.843
77272259.9173145.8996463.03780.45360.54580.75310.7531







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
660.25250.0190.0190.019223.9395000.04010.0401
670.2881-0.26430.14170.12637334.56763679.253560.6569-0.70250.3713
680.3046-0.33090.20480.178917876.55238411.686591.7152-1.09670.6131
690.3169-0.12460.18470.16357110.11378086.293389.9238-0.69170.6328
700.328-0.08570.16490.14725410.22577551.079886.8969-0.60340.6269
710.33870.050.14580.13122005.92926626.88881.40570.36740.5836
720.3494-0.11110.14080.12755437.88296457.030180.3556-0.60490.5867
730.3593-0.11830.1380.12555520.43586339.955879.6238-0.60950.5895
740.3693-0.54350.18310.159128023.06178749.189893.5371-1.37320.6766
750.3792-0.09870.17460.15261022.49827976.520789.3114-0.26230.6352
760.389-0.25280.18170.15913929.22987608.585187.2272-0.51420.6242
770.39870.04440.17030.1496145.99126986.702383.58650.09910.5804

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
66 & 0.2525 & 0.019 & 0.019 & 0.0192 & 23.9395 & 0 & 0 & 0.0401 & 0.0401 \tabularnewline
67 & 0.2881 & -0.2643 & 0.1417 & 0.1263 & 7334.5676 & 3679.2535 & 60.6569 & -0.7025 & 0.3713 \tabularnewline
68 & 0.3046 & -0.3309 & 0.2048 & 0.1789 & 17876.5523 & 8411.6865 & 91.7152 & -1.0967 & 0.6131 \tabularnewline
69 & 0.3169 & -0.1246 & 0.1847 & 0.1635 & 7110.1137 & 8086.2933 & 89.9238 & -0.6917 & 0.6328 \tabularnewline
70 & 0.328 & -0.0857 & 0.1649 & 0.1472 & 5410.2257 & 7551.0798 & 86.8969 & -0.6034 & 0.6269 \tabularnewline
71 & 0.3387 & 0.05 & 0.1458 & 0.1312 & 2005.9292 & 6626.888 & 81.4057 & 0.3674 & 0.5836 \tabularnewline
72 & 0.3494 & -0.1111 & 0.1408 & 0.1275 & 5437.8829 & 6457.0301 & 80.3556 & -0.6049 & 0.5867 \tabularnewline
73 & 0.3593 & -0.1183 & 0.138 & 0.1255 & 5520.4358 & 6339.9558 & 79.6238 & -0.6095 & 0.5895 \tabularnewline
74 & 0.3693 & -0.5435 & 0.1831 & 0.1591 & 28023.0617 & 8749.1898 & 93.5371 & -1.3732 & 0.6766 \tabularnewline
75 & 0.3792 & -0.0987 & 0.1746 & 0.1526 & 1022.4982 & 7976.5207 & 89.3114 & -0.2623 & 0.6352 \tabularnewline
76 & 0.389 & -0.2528 & 0.1817 & 0.1591 & 3929.2298 & 7608.5851 & 87.2272 & -0.5142 & 0.6242 \tabularnewline
77 & 0.3987 & 0.0444 & 0.1703 & 0.1496 & 145.9912 & 6986.7023 & 83.5865 & 0.0991 & 0.5804 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=232221&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]66[/C][C]0.2525[/C][C]0.019[/C][C]0.019[/C][C]0.0192[/C][C]23.9395[/C][C]0[/C][C]0[/C][C]0.0401[/C][C]0.0401[/C][/ROW]
[ROW][C]67[/C][C]0.2881[/C][C]-0.2643[/C][C]0.1417[/C][C]0.1263[/C][C]7334.5676[/C][C]3679.2535[/C][C]60.6569[/C][C]-0.7025[/C][C]0.3713[/C][/ROW]
[ROW][C]68[/C][C]0.3046[/C][C]-0.3309[/C][C]0.2048[/C][C]0.1789[/C][C]17876.5523[/C][C]8411.6865[/C][C]91.7152[/C][C]-1.0967[/C][C]0.6131[/C][/ROW]
[ROW][C]69[/C][C]0.3169[/C][C]-0.1246[/C][C]0.1847[/C][C]0.1635[/C][C]7110.1137[/C][C]8086.2933[/C][C]89.9238[/C][C]-0.6917[/C][C]0.6328[/C][/ROW]
[ROW][C]70[/C][C]0.328[/C][C]-0.0857[/C][C]0.1649[/C][C]0.1472[/C][C]5410.2257[/C][C]7551.0798[/C][C]86.8969[/C][C]-0.6034[/C][C]0.6269[/C][/ROW]
[ROW][C]71[/C][C]0.3387[/C][C]0.05[/C][C]0.1458[/C][C]0.1312[/C][C]2005.9292[/C][C]6626.888[/C][C]81.4057[/C][C]0.3674[/C][C]0.5836[/C][/ROW]
[ROW][C]72[/C][C]0.3494[/C][C]-0.1111[/C][C]0.1408[/C][C]0.1275[/C][C]5437.8829[/C][C]6457.0301[/C][C]80.3556[/C][C]-0.6049[/C][C]0.5867[/C][/ROW]
[ROW][C]73[/C][C]0.3593[/C][C]-0.1183[/C][C]0.138[/C][C]0.1255[/C][C]5520.4358[/C][C]6339.9558[/C][C]79.6238[/C][C]-0.6095[/C][C]0.5895[/C][/ROW]
[ROW][C]74[/C][C]0.3693[/C][C]-0.5435[/C][C]0.1831[/C][C]0.1591[/C][C]28023.0617[/C][C]8749.1898[/C][C]93.5371[/C][C]-1.3732[/C][C]0.6766[/C][/ROW]
[ROW][C]75[/C][C]0.3792[/C][C]-0.0987[/C][C]0.1746[/C][C]0.1526[/C][C]1022.4982[/C][C]7976.5207[/C][C]89.3114[/C][C]-0.2623[/C][C]0.6352[/C][/ROW]
[ROW][C]76[/C][C]0.389[/C][C]-0.2528[/C][C]0.1817[/C][C]0.1591[/C][C]3929.2298[/C][C]7608.5851[/C][C]87.2272[/C][C]-0.5142[/C][C]0.6242[/C][/ROW]
[ROW][C]77[/C][C]0.3987[/C][C]0.0444[/C][C]0.1703[/C][C]0.1496[/C][C]145.9912[/C][C]6986.7023[/C][C]83.5865[/C][C]0.0991[/C][C]0.5804[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=232221&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=232221&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
660.25250.0190.0190.019223.9395000.04010.0401
670.2881-0.26430.14170.12637334.56763679.253560.6569-0.70250.3713
680.3046-0.33090.20480.178917876.55238411.686591.7152-1.09670.6131
690.3169-0.12460.18470.16357110.11378086.293389.9238-0.69170.6328
700.328-0.08570.16490.14725410.22577551.079886.8969-0.60340.6269
710.33870.050.14580.13122005.92926626.88881.40570.36740.5836
720.3494-0.11110.14080.12755437.88296457.030180.3556-0.60490.5867
730.3593-0.11830.1380.12555520.43586339.955879.6238-0.60950.5895
740.3693-0.54350.18310.159128023.06178749.189893.5371-1.37320.6766
750.3792-0.09870.17460.15261022.49827976.520789.3114-0.26230.6352
760.389-0.25280.18170.15913929.22987608.585187.2272-0.51420.6242
770.39870.04440.17030.1496145.99126986.702383.58650.09910.5804



Parameters (Session):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 1 ; 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,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')