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, 21 Dec 2017 17:39:13 +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/2017/Dec/21/t1513874374szv6c2x5tehyob4.htm/, Retrieved Tue, 14 May 2024 17:40:41 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=310670, Retrieved Tue, 14 May 2024 17:40:41 +0000
QR Codes:

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

Post a new message
Dataseries X:
67
61
113
61
43
105
63
64
69
60
59
71
66
65
76
64
41
106
52
62
49
106
75
54
63
48
64
65
69
31
51
52
78
72
80
53
69
61
52
82
100
73
71
62
80
85
65
59
78
92
89
82
83
79
80
50
40
58
56
52
55
59
45
77
48
46
41
35
47
47
26
39
33
40
43
41
24
41
25
22
36
24
27
36
27
27
39
35
29
28
29
23
27
36
35
30
19
22
23
21
34
32
24
22
17
26
19




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

\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
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310670&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] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=310670&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310670&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







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[95])
8327-------
8436-------
8527-------
8627-------
8739-------
8835-------
8929-------
9028-------
9129-------
9223-------
9327-------
9436-------
9535-------
963030.806220.580748.74950.46490.32340.28520.3234
971930.806220.342349.4940.10780.53370.65510.33
982230.806220.114150.23120.18710.88320.64950.3361
992330.806219.895450.96190.22390.80410.21280.3417
1002130.806219.685351.6870.17870.76810.34690.3469
1013430.806219.483252.40720.3860.81320.56510.3518
1023230.806219.288453.12310.45820.38950.59730.3563
1032430.806219.100553.83530.28120.45950.56110.3606
1042230.806218.918954.54420.23360.71290.74040.3646
1051730.806218.743155.25030.13410.75990.61990.3683
1062630.806218.57355.9540.3540.8590.34280.3719
1071930.806218.40856.65570.18530.64220.37520.3752

\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[95]) \tabularnewline
83 & 27 & - & - & - & - & - & - & - \tabularnewline
84 & 36 & - & - & - & - & - & - & - \tabularnewline
85 & 27 & - & - & - & - & - & - & - \tabularnewline
86 & 27 & - & - & - & - & - & - & - \tabularnewline
87 & 39 & - & - & - & - & - & - & - \tabularnewline
88 & 35 & - & - & - & - & - & - & - \tabularnewline
89 & 29 & - & - & - & - & - & - & - \tabularnewline
90 & 28 & - & - & - & - & - & - & - \tabularnewline
91 & 29 & - & - & - & - & - & - & - \tabularnewline
92 & 23 & - & - & - & - & - & - & - \tabularnewline
93 & 27 & - & - & - & - & - & - & - \tabularnewline
94 & 36 & - & - & - & - & - & - & - \tabularnewline
95 & 35 & - & - & - & - & - & - & - \tabularnewline
96 & 30 & 30.8062 & 20.5807 & 48.7495 & 0.4649 & 0.3234 & 0.2852 & 0.3234 \tabularnewline
97 & 19 & 30.8062 & 20.3423 & 49.494 & 0.1078 & 0.5337 & 0.6551 & 0.33 \tabularnewline
98 & 22 & 30.8062 & 20.1141 & 50.2312 & 0.1871 & 0.8832 & 0.6495 & 0.3361 \tabularnewline
99 & 23 & 30.8062 & 19.8954 & 50.9619 & 0.2239 & 0.8041 & 0.2128 & 0.3417 \tabularnewline
100 & 21 & 30.8062 & 19.6853 & 51.687 & 0.1787 & 0.7681 & 0.3469 & 0.3469 \tabularnewline
101 & 34 & 30.8062 & 19.4832 & 52.4072 & 0.386 & 0.8132 & 0.5651 & 0.3518 \tabularnewline
102 & 32 & 30.8062 & 19.2884 & 53.1231 & 0.4582 & 0.3895 & 0.5973 & 0.3563 \tabularnewline
103 & 24 & 30.8062 & 19.1005 & 53.8353 & 0.2812 & 0.4595 & 0.5611 & 0.3606 \tabularnewline
104 & 22 & 30.8062 & 18.9189 & 54.5442 & 0.2336 & 0.7129 & 0.7404 & 0.3646 \tabularnewline
105 & 17 & 30.8062 & 18.7431 & 55.2503 & 0.1341 & 0.7599 & 0.6199 & 0.3683 \tabularnewline
106 & 26 & 30.8062 & 18.573 & 55.954 & 0.354 & 0.859 & 0.3428 & 0.3719 \tabularnewline
107 & 19 & 30.8062 & 18.408 & 56.6557 & 0.1853 & 0.6422 & 0.3752 & 0.3752 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310670&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[95])[/C][/ROW]
[ROW][C]83[/C][C]27[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]36[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]27[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]27[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]39[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]35[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]28[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]27[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]36[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]35[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]30[/C][C]30.8062[/C][C]20.5807[/C][C]48.7495[/C][C]0.4649[/C][C]0.3234[/C][C]0.2852[/C][C]0.3234[/C][/ROW]
[ROW][C]97[/C][C]19[/C][C]30.8062[/C][C]20.3423[/C][C]49.494[/C][C]0.1078[/C][C]0.5337[/C][C]0.6551[/C][C]0.33[/C][/ROW]
[ROW][C]98[/C][C]22[/C][C]30.8062[/C][C]20.1141[/C][C]50.2312[/C][C]0.1871[/C][C]0.8832[/C][C]0.6495[/C][C]0.3361[/C][/ROW]
[ROW][C]99[/C][C]23[/C][C]30.8062[/C][C]19.8954[/C][C]50.9619[/C][C]0.2239[/C][C]0.8041[/C][C]0.2128[/C][C]0.3417[/C][/ROW]
[ROW][C]100[/C][C]21[/C][C]30.8062[/C][C]19.6853[/C][C]51.687[/C][C]0.1787[/C][C]0.7681[/C][C]0.3469[/C][C]0.3469[/C][/ROW]
[ROW][C]101[/C][C]34[/C][C]30.8062[/C][C]19.4832[/C][C]52.4072[/C][C]0.386[/C][C]0.8132[/C][C]0.5651[/C][C]0.3518[/C][/ROW]
[ROW][C]102[/C][C]32[/C][C]30.8062[/C][C]19.2884[/C][C]53.1231[/C][C]0.4582[/C][C]0.3895[/C][C]0.5973[/C][C]0.3563[/C][/ROW]
[ROW][C]103[/C][C]24[/C][C]30.8062[/C][C]19.1005[/C][C]53.8353[/C][C]0.2812[/C][C]0.4595[/C][C]0.5611[/C][C]0.3606[/C][/ROW]
[ROW][C]104[/C][C]22[/C][C]30.8062[/C][C]18.9189[/C][C]54.5442[/C][C]0.2336[/C][C]0.7129[/C][C]0.7404[/C][C]0.3646[/C][/ROW]
[ROW][C]105[/C][C]17[/C][C]30.8062[/C][C]18.7431[/C][C]55.2503[/C][C]0.1341[/C][C]0.7599[/C][C]0.6199[/C][C]0.3683[/C][/ROW]
[ROW][C]106[/C][C]26[/C][C]30.8062[/C][C]18.573[/C][C]55.954[/C][C]0.354[/C][C]0.859[/C][C]0.3428[/C][C]0.3719[/C][/ROW]
[ROW][C]107[/C][C]19[/C][C]30.8062[/C][C]18.408[/C][C]56.6557[/C][C]0.1853[/C][C]0.6422[/C][C]0.3752[/C][C]0.3752[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310670&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310670&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[95])
8327-------
8436-------
8527-------
8627-------
8739-------
8835-------
8929-------
9028-------
9129-------
9223-------
9327-------
9436-------
9535-------
963030.806220.580748.74950.46490.32340.28520.3234
971930.806220.342349.4940.10780.53370.65510.33
982230.806220.114150.23120.18710.88320.64950.3361
992330.806219.895450.96190.22390.80410.21280.3417
1002130.806219.685351.6870.17870.76810.34690.3469
1013430.806219.483252.40720.3860.81320.56510.3518
1023230.806219.288453.12310.45820.38950.59730.3563
1032430.806219.100553.83530.28120.45950.56110.3606
1042230.806218.918954.54420.23360.71290.74040.3646
1051730.806218.743155.25030.13410.75990.61990.3683
1062630.806218.57355.9540.3540.8590.34280.3719
1071930.806218.40856.65570.18530.64220.37520.3752







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
960.2972-0.02690.02690.02650.6500-0.14080.1408
970.3095-0.62140.32410.2503139.386870.01848.3677-2.06141.1011
980.3217-0.40030.34950.27877.549572.52888.5164-1.53761.2466
990.3338-0.33940.3470.281160.937169.63098.3445-1.3631.2757
1000.3458-0.4670.3710.300696.16274.93718.6566-1.71221.363
1010.35770.09390.32480.266910.200264.14768.00920.55761.2288
1020.36960.03730.28370.23421.425155.18727.42880.20841.083
1030.3814-0.28360.28370.23646.324654.07947.3539-1.18841.0962
1040.3931-0.40030.29670.246877.549556.68727.5291-1.53761.1452
1050.4048-0.81210.34820.2799190.611770.07978.3714-2.41061.2718
1060.4165-0.18490.33340.269823.099865.80888.1123-0.83921.2324
1070.4281-0.62140.35740.2869139.386871.94038.4818-2.06141.3015

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
96 & 0.2972 & -0.0269 & 0.0269 & 0.0265 & 0.65 & 0 & 0 & -0.1408 & 0.1408 \tabularnewline
97 & 0.3095 & -0.6214 & 0.3241 & 0.2503 & 139.3868 & 70.0184 & 8.3677 & -2.0614 & 1.1011 \tabularnewline
98 & 0.3217 & -0.4003 & 0.3495 & 0.278 & 77.5495 & 72.5288 & 8.5164 & -1.5376 & 1.2466 \tabularnewline
99 & 0.3338 & -0.3394 & 0.347 & 0.2811 & 60.9371 & 69.6309 & 8.3445 & -1.363 & 1.2757 \tabularnewline
100 & 0.3458 & -0.467 & 0.371 & 0.3006 & 96.162 & 74.9371 & 8.6566 & -1.7122 & 1.363 \tabularnewline
101 & 0.3577 & 0.0939 & 0.3248 & 0.2669 & 10.2002 & 64.1476 & 8.0092 & 0.5576 & 1.2288 \tabularnewline
102 & 0.3696 & 0.0373 & 0.2837 & 0.2342 & 1.4251 & 55.1872 & 7.4288 & 0.2084 & 1.083 \tabularnewline
103 & 0.3814 & -0.2836 & 0.2837 & 0.236 & 46.3246 & 54.0794 & 7.3539 & -1.1884 & 1.0962 \tabularnewline
104 & 0.3931 & -0.4003 & 0.2967 & 0.2468 & 77.5495 & 56.6872 & 7.5291 & -1.5376 & 1.1452 \tabularnewline
105 & 0.4048 & -0.8121 & 0.3482 & 0.2799 & 190.6117 & 70.0797 & 8.3714 & -2.4106 & 1.2718 \tabularnewline
106 & 0.4165 & -0.1849 & 0.3334 & 0.2698 & 23.0998 & 65.8088 & 8.1123 & -0.8392 & 1.2324 \tabularnewline
107 & 0.4281 & -0.6214 & 0.3574 & 0.2869 & 139.3868 & 71.9403 & 8.4818 & -2.0614 & 1.3015 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=310670&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]96[/C][C]0.2972[/C][C]-0.0269[/C][C]0.0269[/C][C]0.0265[/C][C]0.65[/C][C]0[/C][C]0[/C][C]-0.1408[/C][C]0.1408[/C][/ROW]
[ROW][C]97[/C][C]0.3095[/C][C]-0.6214[/C][C]0.3241[/C][C]0.2503[/C][C]139.3868[/C][C]70.0184[/C][C]8.3677[/C][C]-2.0614[/C][C]1.1011[/C][/ROW]
[ROW][C]98[/C][C]0.3217[/C][C]-0.4003[/C][C]0.3495[/C][C]0.278[/C][C]77.5495[/C][C]72.5288[/C][C]8.5164[/C][C]-1.5376[/C][C]1.2466[/C][/ROW]
[ROW][C]99[/C][C]0.3338[/C][C]-0.3394[/C][C]0.347[/C][C]0.2811[/C][C]60.9371[/C][C]69.6309[/C][C]8.3445[/C][C]-1.363[/C][C]1.2757[/C][/ROW]
[ROW][C]100[/C][C]0.3458[/C][C]-0.467[/C][C]0.371[/C][C]0.3006[/C][C]96.162[/C][C]74.9371[/C][C]8.6566[/C][C]-1.7122[/C][C]1.363[/C][/ROW]
[ROW][C]101[/C][C]0.3577[/C][C]0.0939[/C][C]0.3248[/C][C]0.2669[/C][C]10.2002[/C][C]64.1476[/C][C]8.0092[/C][C]0.5576[/C][C]1.2288[/C][/ROW]
[ROW][C]102[/C][C]0.3696[/C][C]0.0373[/C][C]0.2837[/C][C]0.2342[/C][C]1.4251[/C][C]55.1872[/C][C]7.4288[/C][C]0.2084[/C][C]1.083[/C][/ROW]
[ROW][C]103[/C][C]0.3814[/C][C]-0.2836[/C][C]0.2837[/C][C]0.236[/C][C]46.3246[/C][C]54.0794[/C][C]7.3539[/C][C]-1.1884[/C][C]1.0962[/C][/ROW]
[ROW][C]104[/C][C]0.3931[/C][C]-0.4003[/C][C]0.2967[/C][C]0.2468[/C][C]77.5495[/C][C]56.6872[/C][C]7.5291[/C][C]-1.5376[/C][C]1.1452[/C][/ROW]
[ROW][C]105[/C][C]0.4048[/C][C]-0.8121[/C][C]0.3482[/C][C]0.2799[/C][C]190.6117[/C][C]70.0797[/C][C]8.3714[/C][C]-2.4106[/C][C]1.2718[/C][/ROW]
[ROW][C]106[/C][C]0.4165[/C][C]-0.1849[/C][C]0.3334[/C][C]0.2698[/C][C]23.0998[/C][C]65.8088[/C][C]8.1123[/C][C]-0.8392[/C][C]1.2324[/C][/ROW]
[ROW][C]107[/C][C]0.4281[/C][C]-0.6214[/C][C]0.3574[/C][C]0.2869[/C][C]139.3868[/C][C]71.9403[/C][C]8.4818[/C][C]-2.0614[/C][C]1.3015[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=310670&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=310670&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
960.2972-0.02690.02690.02650.6500-0.14080.1408
970.3095-0.62140.32410.2503139.386870.01848.3677-2.06141.1011
980.3217-0.40030.34950.27877.549572.52888.5164-1.53761.2466
990.3338-0.33940.3470.281160.937169.63098.3445-1.3631.2757
1000.3458-0.4670.3710.300696.16274.93718.6566-1.71221.363
1010.35770.09390.32480.266910.200264.14768.00920.55761.2288
1020.36960.03730.28370.23421.425155.18727.42880.20841.083
1030.3814-0.28360.28370.23646.324654.07947.3539-1.18841.0962
1040.3931-0.40030.29670.246877.549556.68727.5291-1.53761.1452
1050.4048-0.81210.34820.2799190.611770.07978.3714-2.41061.2718
1060.4165-0.18490.33340.269823.099865.80888.1123-0.83921.2324
1070.4281-0.62140.35740.2869139.386871.94038.4818-2.06141.3015



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