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 computationFri, 23 Dec 2016 15:11:47 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/23/t14825023322sltfo0hbpsw065.htm/, Retrieved Wed, 08 May 2024 02:44:36 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302962, Retrieved Wed, 08 May 2024 02:44:36 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact88
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [ACF1] [2016-12-22 17:08:50] [267314984f6394bb93cd815224aa34ba]
- RM D    [ARIMA Forecasting] [ARIMAF2] [2016-12-23 14:11:47] [636d0f72197ac5e1dae4a755427db02a] [Current]
Feedback Forum

Post a new message
Dataseries X:
3120
3360
3540
2700
2580
3480
3240
4440
3000
3720
1620
3360
3180
2100
3000
2520
2160
1980
4020
3480
2750
2640
3420
2640
2520
2040
2820
1860
3780
2520
2580
2880
2100
3060
2100
3720
2940
2820
4980
2400
2940
2640
2340
1680
4140
2640
3600
3240
3120
2460
2940

































































































Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
R Framework error message & 
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
\tabularnewline \hline \end{tabular} %Source: https://freestatistics.org/blog/index.php?pk=302962&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [ROW]R Framework error message[/C][C]
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.
[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=302962&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302962&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center
R Framework error message
Warning: there are blank lines in the 'Data' field.
Please, use NA for missing data - blank lines are simply
 deleted and are NOT treated as missing values.







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[39])
272820-------
281860-------
293780-------
302520-------
312580-------
322880-------
332100-------
343060-------
352100-------
363720-------
372940-------
382820-------
394980-------
4024004764.89812788.18176741.61450.00950.41560.9980.4156
4129404559.08711823.29497294.87930.1230.9390.71160.3815
4226404362.16571082.01837642.31320.15170.80230.86450.356
4323404173.75464.6557882.84510.16630.79120.80020.335
4416803993.4726-68.79418055.73930.13220.78750.70440.317
4541403820.9819-539.5988181.56190.4430.83210.78040.3012
4626403655.9417-960.86838272.75160.33310.41860.59990.287
4736003498.03-1341.4738337.5330.48350.63590.71440.2742
4832403346.9391-1687.80598381.6840.48340.46080.44230.2625
4931203202.3742-2004.69598409.44430.48760.49440.53930.2517
5024603064.0536-2295.92128424.02830.41260.49180.53560.2418
5129402931.7074-2564.528427.93480.49880.56680.23260.2326

\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[39]) \tabularnewline
27 & 2820 & - & - & - & - & - & - & - \tabularnewline
28 & 1860 & - & - & - & - & - & - & - \tabularnewline
29 & 3780 & - & - & - & - & - & - & - \tabularnewline
30 & 2520 & - & - & - & - & - & - & - \tabularnewline
31 & 2580 & - & - & - & - & - & - & - \tabularnewline
32 & 2880 & - & - & - & - & - & - & - \tabularnewline
33 & 2100 & - & - & - & - & - & - & - \tabularnewline
34 & 3060 & - & - & - & - & - & - & - \tabularnewline
35 & 2100 & - & - & - & - & - & - & - \tabularnewline
36 & 3720 & - & - & - & - & - & - & - \tabularnewline
37 & 2940 & - & - & - & - & - & - & - \tabularnewline
38 & 2820 & - & - & - & - & - & - & - \tabularnewline
39 & 4980 & - & - & - & - & - & - & - \tabularnewline
40 & 2400 & 4764.8981 & 2788.1817 & 6741.6145 & 0.0095 & 0.4156 & 0.998 & 0.4156 \tabularnewline
41 & 2940 & 4559.0871 & 1823.2949 & 7294.8793 & 0.123 & 0.939 & 0.7116 & 0.3815 \tabularnewline
42 & 2640 & 4362.1657 & 1082.0183 & 7642.3132 & 0.1517 & 0.8023 & 0.8645 & 0.356 \tabularnewline
43 & 2340 & 4173.75 & 464.655 & 7882.8451 & 0.1663 & 0.7912 & 0.8002 & 0.335 \tabularnewline
44 & 1680 & 3993.4726 & -68.7941 & 8055.7393 & 0.1322 & 0.7875 & 0.7044 & 0.317 \tabularnewline
45 & 4140 & 3820.9819 & -539.598 & 8181.5619 & 0.443 & 0.8321 & 0.7804 & 0.3012 \tabularnewline
46 & 2640 & 3655.9417 & -960.8683 & 8272.7516 & 0.3331 & 0.4186 & 0.5999 & 0.287 \tabularnewline
47 & 3600 & 3498.03 & -1341.473 & 8337.533 & 0.4835 & 0.6359 & 0.7144 & 0.2742 \tabularnewline
48 & 3240 & 3346.9391 & -1687.8059 & 8381.684 & 0.4834 & 0.4608 & 0.4423 & 0.2625 \tabularnewline
49 & 3120 & 3202.3742 & -2004.6959 & 8409.4443 & 0.4876 & 0.4944 & 0.5393 & 0.2517 \tabularnewline
50 & 2460 & 3064.0536 & -2295.9212 & 8424.0283 & 0.4126 & 0.4918 & 0.5356 & 0.2418 \tabularnewline
51 & 2940 & 2931.7074 & -2564.52 & 8427.9348 & 0.4988 & 0.5668 & 0.2326 & 0.2326 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302962&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[39])[/C][/ROW]
[ROW][C]27[/C][C]2820[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]28[/C][C]1860[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]29[/C][C]3780[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]30[/C][C]2520[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]31[/C][C]2580[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]32[/C][C]2880[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]2100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]3060[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]2100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]3720[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2940[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2820[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]4980[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]2400[/C][C]4764.8981[/C][C]2788.1817[/C][C]6741.6145[/C][C]0.0095[/C][C]0.4156[/C][C]0.998[/C][C]0.4156[/C][/ROW]
[ROW][C]41[/C][C]2940[/C][C]4559.0871[/C][C]1823.2949[/C][C]7294.8793[/C][C]0.123[/C][C]0.939[/C][C]0.7116[/C][C]0.3815[/C][/ROW]
[ROW][C]42[/C][C]2640[/C][C]4362.1657[/C][C]1082.0183[/C][C]7642.3132[/C][C]0.1517[/C][C]0.8023[/C][C]0.8645[/C][C]0.356[/C][/ROW]
[ROW][C]43[/C][C]2340[/C][C]4173.75[/C][C]464.655[/C][C]7882.8451[/C][C]0.1663[/C][C]0.7912[/C][C]0.8002[/C][C]0.335[/C][/ROW]
[ROW][C]44[/C][C]1680[/C][C]3993.4726[/C][C]-68.7941[/C][C]8055.7393[/C][C]0.1322[/C][C]0.7875[/C][C]0.7044[/C][C]0.317[/C][/ROW]
[ROW][C]45[/C][C]4140[/C][C]3820.9819[/C][C]-539.598[/C][C]8181.5619[/C][C]0.443[/C][C]0.8321[/C][C]0.7804[/C][C]0.3012[/C][/ROW]
[ROW][C]46[/C][C]2640[/C][C]3655.9417[/C][C]-960.8683[/C][C]8272.7516[/C][C]0.3331[/C][C]0.4186[/C][C]0.5999[/C][C]0.287[/C][/ROW]
[ROW][C]47[/C][C]3600[/C][C]3498.03[/C][C]-1341.473[/C][C]8337.533[/C][C]0.4835[/C][C]0.6359[/C][C]0.7144[/C][C]0.2742[/C][/ROW]
[ROW][C]48[/C][C]3240[/C][C]3346.9391[/C][C]-1687.8059[/C][C]8381.684[/C][C]0.4834[/C][C]0.4608[/C][C]0.4423[/C][C]0.2625[/C][/ROW]
[ROW][C]49[/C][C]3120[/C][C]3202.3742[/C][C]-2004.6959[/C][C]8409.4443[/C][C]0.4876[/C][C]0.4944[/C][C]0.5393[/C][C]0.2517[/C][/ROW]
[ROW][C]50[/C][C]2460[/C][C]3064.0536[/C][C]-2295.9212[/C][C]8424.0283[/C][C]0.4126[/C][C]0.4918[/C][C]0.5356[/C][C]0.2418[/C][/ROW]
[ROW][C]51[/C][C]2940[/C][C]2931.7074[/C][C]-2564.52[/C][C]8427.9348[/C][C]0.4988[/C][C]0.5668[/C][C]0.2326[/C][C]0.2326[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302962&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302962&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[39])
272820-------
281860-------
293780-------
302520-------
312580-------
322880-------
332100-------
343060-------
352100-------
363720-------
372940-------
382820-------
394980-------
4024004764.89812788.18176741.61450.00950.41560.9980.4156
4129404559.08711823.29497294.87930.1230.9390.71160.3815
4226404362.16571082.01837642.31320.15170.80230.86450.356
4323404173.75464.6557882.84510.16630.79120.80020.335
4416803993.4726-68.79418055.73930.13220.78750.70440.317
4541403820.9819-539.5988181.56190.4430.83210.78040.3012
4626403655.9417-960.86838272.75160.33310.41860.59990.287
4736003498.03-1341.4738337.5330.48350.63590.71440.2742
4832403346.9391-1687.80598381.6840.48340.46080.44230.2625
4931203202.3742-2004.69598409.44430.48760.49440.53930.2517
5024603064.0536-2295.92128424.02830.41260.49180.53560.2418
5129402931.7074-2564.528427.93480.49880.56680.23260.2326







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
400.2117-0.98540.98540.66015592742.964500-3.11923.1192
410.3062-0.55070.7680.5462621443.05484107093.00972026.5964-2.13552.6273
420.3836-0.65230.72950.52792965854.86663726680.29531930.4612-2.27142.5087
430.4534-0.78370.7430.53673362639.23523635670.03031906.7433-2.41862.4862
440.519-1.37710.86980.59255352155.53533978967.13131994.7349-3.05132.5992
450.58230.07710.73770.5071101772.52783332768.03071825.5870.42082.2361
460.6443-0.38480.68730.48081032137.473004106.5221733.2359-1.342.1081
470.70590.02830.60490.424310397.87862629892.94161621.69450.13451.8614
480.7675-0.0330.54140.380711435.96222338953.27721529.3637-0.1411.6703
490.8296-0.02640.48990.34536785.50892105736.50041451.1156-0.10861.5141
500.8925-0.24560.46770.3338364880.69711947476.88191395.5203-0.79671.4489
510.95650.00280.42890.306268.7671785192.87231336.11110.01091.3291

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
40 & 0.2117 & -0.9854 & 0.9854 & 0.6601 & 5592742.9645 & 0 & 0 & -3.1192 & 3.1192 \tabularnewline
41 & 0.3062 & -0.5507 & 0.768 & 0.546 & 2621443.0548 & 4107093.0097 & 2026.5964 & -2.1355 & 2.6273 \tabularnewline
42 & 0.3836 & -0.6523 & 0.7295 & 0.5279 & 2965854.8666 & 3726680.2953 & 1930.4612 & -2.2714 & 2.5087 \tabularnewline
43 & 0.4534 & -0.7837 & 0.743 & 0.5367 & 3362639.2352 & 3635670.0303 & 1906.7433 & -2.4186 & 2.4862 \tabularnewline
44 & 0.519 & -1.3771 & 0.8698 & 0.5925 & 5352155.5353 & 3978967.1313 & 1994.7349 & -3.0513 & 2.5992 \tabularnewline
45 & 0.5823 & 0.0771 & 0.7377 & 0.5071 & 101772.5278 & 3332768.0307 & 1825.587 & 0.4208 & 2.2361 \tabularnewline
46 & 0.6443 & -0.3848 & 0.6873 & 0.4808 & 1032137.47 & 3004106.522 & 1733.2359 & -1.34 & 2.1081 \tabularnewline
47 & 0.7059 & 0.0283 & 0.6049 & 0.4243 & 10397.8786 & 2629892.9416 & 1621.6945 & 0.1345 & 1.8614 \tabularnewline
48 & 0.7675 & -0.033 & 0.5414 & 0.3807 & 11435.9622 & 2338953.2772 & 1529.3637 & -0.141 & 1.6703 \tabularnewline
49 & 0.8296 & -0.0264 & 0.4899 & 0.3453 & 6785.5089 & 2105736.5004 & 1451.1156 & -0.1086 & 1.5141 \tabularnewline
50 & 0.8925 & -0.2456 & 0.4677 & 0.3338 & 364880.6971 & 1947476.8819 & 1395.5203 & -0.7967 & 1.4489 \tabularnewline
51 & 0.9565 & 0.0028 & 0.4289 & 0.3062 & 68.767 & 1785192.8723 & 1336.1111 & 0.0109 & 1.3291 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302962&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]40[/C][C]0.2117[/C][C]-0.9854[/C][C]0.9854[/C][C]0.6601[/C][C]5592742.9645[/C][C]0[/C][C]0[/C][C]-3.1192[/C][C]3.1192[/C][/ROW]
[ROW][C]41[/C][C]0.3062[/C][C]-0.5507[/C][C]0.768[/C][C]0.546[/C][C]2621443.0548[/C][C]4107093.0097[/C][C]2026.5964[/C][C]-2.1355[/C][C]2.6273[/C][/ROW]
[ROW][C]42[/C][C]0.3836[/C][C]-0.6523[/C][C]0.7295[/C][C]0.5279[/C][C]2965854.8666[/C][C]3726680.2953[/C][C]1930.4612[/C][C]-2.2714[/C][C]2.5087[/C][/ROW]
[ROW][C]43[/C][C]0.4534[/C][C]-0.7837[/C][C]0.743[/C][C]0.5367[/C][C]3362639.2352[/C][C]3635670.0303[/C][C]1906.7433[/C][C]-2.4186[/C][C]2.4862[/C][/ROW]
[ROW][C]44[/C][C]0.519[/C][C]-1.3771[/C][C]0.8698[/C][C]0.5925[/C][C]5352155.5353[/C][C]3978967.1313[/C][C]1994.7349[/C][C]-3.0513[/C][C]2.5992[/C][/ROW]
[ROW][C]45[/C][C]0.5823[/C][C]0.0771[/C][C]0.7377[/C][C]0.5071[/C][C]101772.5278[/C][C]3332768.0307[/C][C]1825.587[/C][C]0.4208[/C][C]2.2361[/C][/ROW]
[ROW][C]46[/C][C]0.6443[/C][C]-0.3848[/C][C]0.6873[/C][C]0.4808[/C][C]1032137.47[/C][C]3004106.522[/C][C]1733.2359[/C][C]-1.34[/C][C]2.1081[/C][/ROW]
[ROW][C]47[/C][C]0.7059[/C][C]0.0283[/C][C]0.6049[/C][C]0.4243[/C][C]10397.8786[/C][C]2629892.9416[/C][C]1621.6945[/C][C]0.1345[/C][C]1.8614[/C][/ROW]
[ROW][C]48[/C][C]0.7675[/C][C]-0.033[/C][C]0.5414[/C][C]0.3807[/C][C]11435.9622[/C][C]2338953.2772[/C][C]1529.3637[/C][C]-0.141[/C][C]1.6703[/C][/ROW]
[ROW][C]49[/C][C]0.8296[/C][C]-0.0264[/C][C]0.4899[/C][C]0.3453[/C][C]6785.5089[/C][C]2105736.5004[/C][C]1451.1156[/C][C]-0.1086[/C][C]1.5141[/C][/ROW]
[ROW][C]50[/C][C]0.8925[/C][C]-0.2456[/C][C]0.4677[/C][C]0.3338[/C][C]364880.6971[/C][C]1947476.8819[/C][C]1395.5203[/C][C]-0.7967[/C][C]1.4489[/C][/ROW]
[ROW][C]51[/C][C]0.9565[/C][C]0.0028[/C][C]0.4289[/C][C]0.3062[/C][C]68.767[/C][C]1785192.8723[/C][C]1336.1111[/C][C]0.0109[/C][C]1.3291[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302962&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302962&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
400.2117-0.98540.98540.66015592742.964500-3.11923.1192
410.3062-0.55070.7680.5462621443.05484107093.00972026.5964-2.13552.6273
420.3836-0.65230.72950.52792965854.86663726680.29531930.4612-2.27142.5087
430.4534-0.78370.7430.53673362639.23523635670.03031906.7433-2.41862.4862
440.519-1.37710.86980.59255352155.53533978967.13131994.7349-3.05132.5992
450.58230.07710.73770.5071101772.52783332768.03071825.5870.42082.2361
460.6443-0.38480.68730.48081032137.473004106.5221733.2359-1.342.1081
470.70590.02830.60490.424310397.87862629892.94161621.69450.13451.8614
480.7675-0.0330.54140.380711435.96222338953.27721529.3637-0.1411.6703
490.8296-0.02640.48990.34536785.50892105736.50041451.1156-0.10861.5141
500.8925-0.24560.46770.3338364880.69711947476.88191395.5203-0.79671.4489
510.95650.00280.42890.306268.7671785192.87231336.11110.01091.3291



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