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 04:05:38 -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/t1386839159mt8n86psjjp5rdb.htm/, Retrieved Tue, 07 Dec 2021 12:34:17 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=232225, Retrieved Tue, 07 Dec 2021 12:34:17 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact67
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2013-12-12 09:05:38] [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 time4 seconds
R Server'Sir Maurice George Kendall' @ kendall.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 & 'Sir Maurice George Kendall' @ kendall.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=232225&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]'Sir Maurice George Kendall' @ kendall.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=232225&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=232225&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'Sir Maurice George Kendall' @ kendall.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-------
66257259.5563160.4097419.98380.48750.80570.81560.8057
67324292.6369166.4243514.56660.39090.62350.65650.82
68404465.6019239.4689905.27440.39180.73610.70770.8912
69677568.5389279.74791155.45620.35860.70870.63650.8975
70858728.0047341.76051550.76690.37840.54840.54550.9004
71895622.1204284.51791360.31440.23440.26560.40670.8749
72664538.8482240.37131207.95370.3570.14840.41740.8473
73628553.4524243.01961260.43160.41810.37960.54460.8438
74308371.4029160.8164857.74920.39920.15050.62550.7689
75324303.565130.188707.83520.46050.49140.55890.7107
76248271.4484115.4738638.10350.45010.38940.39350.6703
77272201.474685.2081476.38690.30750.37010.53540.5354

\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 & 259.5563 & 160.4097 & 419.9838 & 0.4875 & 0.8057 & 0.8156 & 0.8057 \tabularnewline
67 & 324 & 292.6369 & 166.4243 & 514.5666 & 0.3909 & 0.6235 & 0.6565 & 0.82 \tabularnewline
68 & 404 & 465.6019 & 239.4689 & 905.2744 & 0.3918 & 0.7361 & 0.7077 & 0.8912 \tabularnewline
69 & 677 & 568.5389 & 279.7479 & 1155.4562 & 0.3586 & 0.7087 & 0.6365 & 0.8975 \tabularnewline
70 & 858 & 728.0047 & 341.7605 & 1550.7669 & 0.3784 & 0.5484 & 0.5455 & 0.9004 \tabularnewline
71 & 895 & 622.1204 & 284.5179 & 1360.3144 & 0.2344 & 0.2656 & 0.4067 & 0.8749 \tabularnewline
72 & 664 & 538.8482 & 240.3713 & 1207.9537 & 0.357 & 0.1484 & 0.4174 & 0.8473 \tabularnewline
73 & 628 & 553.4524 & 243.0196 & 1260.4316 & 0.4181 & 0.3796 & 0.5446 & 0.8438 \tabularnewline
74 & 308 & 371.4029 & 160.8164 & 857.7492 & 0.3992 & 0.1505 & 0.6255 & 0.7689 \tabularnewline
75 & 324 & 303.565 & 130.188 & 707.8352 & 0.4605 & 0.4914 & 0.5589 & 0.7107 \tabularnewline
76 & 248 & 271.4484 & 115.4738 & 638.1035 & 0.4501 & 0.3894 & 0.3935 & 0.6703 \tabularnewline
77 & 272 & 201.4746 & 85.2081 & 476.3869 & 0.3075 & 0.3701 & 0.5354 & 0.5354 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=232225&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]259.5563[/C][C]160.4097[/C][C]419.9838[/C][C]0.4875[/C][C]0.8057[/C][C]0.8156[/C][C]0.8057[/C][/ROW]
[ROW][C]67[/C][C]324[/C][C]292.6369[/C][C]166.4243[/C][C]514.5666[/C][C]0.3909[/C][C]0.6235[/C][C]0.6565[/C][C]0.82[/C][/ROW]
[ROW][C]68[/C][C]404[/C][C]465.6019[/C][C]239.4689[/C][C]905.2744[/C][C]0.3918[/C][C]0.7361[/C][C]0.7077[/C][C]0.8912[/C][/ROW]
[ROW][C]69[/C][C]677[/C][C]568.5389[/C][C]279.7479[/C][C]1155.4562[/C][C]0.3586[/C][C]0.7087[/C][C]0.6365[/C][C]0.8975[/C][/ROW]
[ROW][C]70[/C][C]858[/C][C]728.0047[/C][C]341.7605[/C][C]1550.7669[/C][C]0.3784[/C][C]0.5484[/C][C]0.5455[/C][C]0.9004[/C][/ROW]
[ROW][C]71[/C][C]895[/C][C]622.1204[/C][C]284.5179[/C][C]1360.3144[/C][C]0.2344[/C][C]0.2656[/C][C]0.4067[/C][C]0.8749[/C][/ROW]
[ROW][C]72[/C][C]664[/C][C]538.8482[/C][C]240.3713[/C][C]1207.9537[/C][C]0.357[/C][C]0.1484[/C][C]0.4174[/C][C]0.8473[/C][/ROW]
[ROW][C]73[/C][C]628[/C][C]553.4524[/C][C]243.0196[/C][C]1260.4316[/C][C]0.4181[/C][C]0.3796[/C][C]0.5446[/C][C]0.8438[/C][/ROW]
[ROW][C]74[/C][C]308[/C][C]371.4029[/C][C]160.8164[/C][C]857.7492[/C][C]0.3992[/C][C]0.1505[/C][C]0.6255[/C][C]0.7689[/C][/ROW]
[ROW][C]75[/C][C]324[/C][C]303.565[/C][C]130.188[/C][C]707.8352[/C][C]0.4605[/C][C]0.4914[/C][C]0.5589[/C][C]0.7107[/C][/ROW]
[ROW][C]76[/C][C]248[/C][C]271.4484[/C][C]115.4738[/C][C]638.1035[/C][C]0.4501[/C][C]0.3894[/C][C]0.3935[/C][C]0.6703[/C][/ROW]
[ROW][C]77[/C][C]272[/C][C]201.4746[/C][C]85.2081[/C][C]476.3869[/C][C]0.3075[/C][C]0.3701[/C][C]0.5354[/C][C]0.5354[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=232225&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=232225&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-------
66257259.5563160.4097419.98380.48750.80570.81560.8057
67324292.6369166.4243514.56660.39090.62350.65650.82
68404465.6019239.4689905.27440.39180.73610.70770.8912
69677568.5389279.74791155.45620.35860.70870.63650.8975
70858728.0047341.76051550.76690.37840.54840.54550.9004
71895622.1204284.51791360.31440.23440.26560.40670.8749
72664538.8482240.37131207.95370.3570.14840.41740.8473
73628553.4524243.01961260.43160.41810.37960.54460.8438
74308371.4029160.8164857.74920.39920.15050.62550.7689
75324303.565130.188707.83520.46050.49140.55890.7107
76248271.4484115.4738638.10350.45010.38940.39350.6703
77272201.474685.2081476.38690.30750.37010.53540.5354







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
660.3153-0.00990.00990.00996.534500-0.0210.021
670.38690.09680.05340.0558983.6422495.088322.25060.25730.1391
680.4818-0.15250.08640.08443794.79031594.98939.9373-0.50530.2612
690.52670.16020.10490.106911763.81824137.196364.3210.88970.4183
700.57660.15150.11420.118316898.77656689.512381.78941.06630.5479
710.60540.30490.1460.158574463.285117985.1411134.10872.23840.8297
720.63350.18850.1520.165615662.965917653.4018132.86611.02660.8578
730.65170.11870.14790.16075557.340916141.3942127.04880.61150.827
740.6681-0.20590.15430.16364019.931214794.565121.6329-0.52010.7929
750.67950.06310.14520.1537417.590613356.8675115.57190.16760.7304
760.6892-0.09450.14060.148549.826212192.591110.4201-0.19230.6815
770.69620.25930.15050.16044973.830711591.0277107.66160.57850.6729

\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.3153 & -0.0099 & 0.0099 & 0.0099 & 6.5345 & 0 & 0 & -0.021 & 0.021 \tabularnewline
67 & 0.3869 & 0.0968 & 0.0534 & 0.0558 & 983.6422 & 495.0883 & 22.2506 & 0.2573 & 0.1391 \tabularnewline
68 & 0.4818 & -0.1525 & 0.0864 & 0.0844 & 3794.7903 & 1594.989 & 39.9373 & -0.5053 & 0.2612 \tabularnewline
69 & 0.5267 & 0.1602 & 0.1049 & 0.1069 & 11763.8182 & 4137.1963 & 64.321 & 0.8897 & 0.4183 \tabularnewline
70 & 0.5766 & 0.1515 & 0.1142 & 0.1183 & 16898.7765 & 6689.5123 & 81.7894 & 1.0663 & 0.5479 \tabularnewline
71 & 0.6054 & 0.3049 & 0.146 & 0.1585 & 74463.2851 & 17985.1411 & 134.1087 & 2.2384 & 0.8297 \tabularnewline
72 & 0.6335 & 0.1885 & 0.152 & 0.1656 & 15662.9659 & 17653.4018 & 132.8661 & 1.0266 & 0.8578 \tabularnewline
73 & 0.6517 & 0.1187 & 0.1479 & 0.1607 & 5557.3409 & 16141.3942 & 127.0488 & 0.6115 & 0.827 \tabularnewline
74 & 0.6681 & -0.2059 & 0.1543 & 0.1636 & 4019.9312 & 14794.565 & 121.6329 & -0.5201 & 0.7929 \tabularnewline
75 & 0.6795 & 0.0631 & 0.1452 & 0.1537 & 417.5906 & 13356.8675 & 115.5719 & 0.1676 & 0.7304 \tabularnewline
76 & 0.6892 & -0.0945 & 0.1406 & 0.148 & 549.8262 & 12192.591 & 110.4201 & -0.1923 & 0.6815 \tabularnewline
77 & 0.6962 & 0.2593 & 0.1505 & 0.1604 & 4973.8307 & 11591.0277 & 107.6616 & 0.5785 & 0.6729 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=232225&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.3153[/C][C]-0.0099[/C][C]0.0099[/C][C]0.0099[/C][C]6.5345[/C][C]0[/C][C]0[/C][C]-0.021[/C][C]0.021[/C][/ROW]
[ROW][C]67[/C][C]0.3869[/C][C]0.0968[/C][C]0.0534[/C][C]0.0558[/C][C]983.6422[/C][C]495.0883[/C][C]22.2506[/C][C]0.2573[/C][C]0.1391[/C][/ROW]
[ROW][C]68[/C][C]0.4818[/C][C]-0.1525[/C][C]0.0864[/C][C]0.0844[/C][C]3794.7903[/C][C]1594.989[/C][C]39.9373[/C][C]-0.5053[/C][C]0.2612[/C][/ROW]
[ROW][C]69[/C][C]0.5267[/C][C]0.1602[/C][C]0.1049[/C][C]0.1069[/C][C]11763.8182[/C][C]4137.1963[/C][C]64.321[/C][C]0.8897[/C][C]0.4183[/C][/ROW]
[ROW][C]70[/C][C]0.5766[/C][C]0.1515[/C][C]0.1142[/C][C]0.1183[/C][C]16898.7765[/C][C]6689.5123[/C][C]81.7894[/C][C]1.0663[/C][C]0.5479[/C][/ROW]
[ROW][C]71[/C][C]0.6054[/C][C]0.3049[/C][C]0.146[/C][C]0.1585[/C][C]74463.2851[/C][C]17985.1411[/C][C]134.1087[/C][C]2.2384[/C][C]0.8297[/C][/ROW]
[ROW][C]72[/C][C]0.6335[/C][C]0.1885[/C][C]0.152[/C][C]0.1656[/C][C]15662.9659[/C][C]17653.4018[/C][C]132.8661[/C][C]1.0266[/C][C]0.8578[/C][/ROW]
[ROW][C]73[/C][C]0.6517[/C][C]0.1187[/C][C]0.1479[/C][C]0.1607[/C][C]5557.3409[/C][C]16141.3942[/C][C]127.0488[/C][C]0.6115[/C][C]0.827[/C][/ROW]
[ROW][C]74[/C][C]0.6681[/C][C]-0.2059[/C][C]0.1543[/C][C]0.1636[/C][C]4019.9312[/C][C]14794.565[/C][C]121.6329[/C][C]-0.5201[/C][C]0.7929[/C][/ROW]
[ROW][C]75[/C][C]0.6795[/C][C]0.0631[/C][C]0.1452[/C][C]0.1537[/C][C]417.5906[/C][C]13356.8675[/C][C]115.5719[/C][C]0.1676[/C][C]0.7304[/C][/ROW]
[ROW][C]76[/C][C]0.6892[/C][C]-0.0945[/C][C]0.1406[/C][C]0.148[/C][C]549.8262[/C][C]12192.591[/C][C]110.4201[/C][C]-0.1923[/C][C]0.6815[/C][/ROW]
[ROW][C]77[/C][C]0.6962[/C][C]0.2593[/C][C]0.1505[/C][C]0.1604[/C][C]4973.8307[/C][C]11591.0277[/C][C]107.6616[/C][C]0.5785[/C][C]0.6729[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=232225&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=232225&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.3153-0.00990.00990.00996.534500-0.0210.021
670.38690.09680.05340.0558983.6422495.088322.25060.25730.1391
680.4818-0.15250.08640.08443794.79031594.98939.9373-0.50530.2612
690.52670.16020.10490.106911763.81824137.196364.3210.88970.4183
700.57660.15150.11420.118316898.77656689.512381.78941.06630.5479
710.60540.30490.1460.158574463.285117985.1411134.10872.23840.8297
720.63350.18850.1520.165615662.965917653.4018132.86611.02660.8578
730.65170.11870.14790.16075557.340916141.3942127.04880.61150.827
740.6681-0.20590.15430.16364019.931214794.565121.6329-0.52010.7929
750.67950.06310.14520.1537417.590613356.8675115.57190.16760.7304
760.6892-0.09450.14060.148549.826212192.591110.4201-0.19230.6815
770.69620.25930.15050.16044973.830711591.0277107.66160.57850.6729



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