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 computationWed, 21 Dec 2016 23:02:44 +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/21/t1482357772pbpo9ogjdilgvfh.htm/, Retrieved Mon, 06 May 2024 20:13:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302515, Retrieved Mon, 06 May 2024 20:13:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact70
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-21 22:02:44] [672675941468e072e71d9fb024f2b817] [Current]
Feedback Forum

Post a new message
Dataseries X:
1932.8
1861.4
2170.2
1999.6
2225.5
2195.7
2713.1
2412
2568.3
2623.7
3185.5
2722.6
3046.3
2854.2
3337.6
2920.3
3058.3
2933.7
3773.4
3193.5
3472.2
3345.5
4028.4
3463.1
3675.4
3500.8
4142.1
3598
3765.3
3557.7
4303.6
3620.1
3691.1
3678.1
4505.8
3695
3894.1
3718.9
4749.8
3855.9
4011.7
3907.6
4812.5
4071.3
4163.4
4077.6
5109.2
4207.6
4320.8
4396.9
5358.8




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=302515&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=302515&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302515&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[39])
354505.8-------
363695-------
373894.1-------
383718.9-------
394749.8-------
403855.93970.15023734.87394226.71070.191400.98220
414011.74165.17063821.34514553.91530.21950.94050.91410.0016
423907.64081.7623678.60634549.5940.23280.61540.93580.0026
434812.55102.67184408.13955960.61640.25370.99680.78990.7899
444071.34237.55613570.88235092.39410.35150.09370.80920.1201
454163.44505.04333672.51595627.780.27540.77550.80540.3346
464077.64355.1173454.46815622.17630.33390.61660.75560.2708
475109.25477.29314119.56287554.61570.36420.90670.73480.7538
484207.64548.42123367.07736402.59230.35930.27670.6930.4157
494320.84815.2533425.25027143.77590.33860.69550.70840.522
504396.94651.66453222.83057152.61820.42090.60230.67360.4693
515358.85901.93183822.25569988.45330.39720.76480.64810.7097

\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
35 & 4505.8 & - & - & - & - & - & - & - \tabularnewline
36 & 3695 & - & - & - & - & - & - & - \tabularnewline
37 & 3894.1 & - & - & - & - & - & - & - \tabularnewline
38 & 3718.9 & - & - & - & - & - & - & - \tabularnewline
39 & 4749.8 & - & - & - & - & - & - & - \tabularnewline
40 & 3855.9 & 3970.1502 & 3734.8739 & 4226.7107 & 0.1914 & 0 & 0.9822 & 0 \tabularnewline
41 & 4011.7 & 4165.1706 & 3821.3451 & 4553.9153 & 0.2195 & 0.9405 & 0.9141 & 0.0016 \tabularnewline
42 & 3907.6 & 4081.762 & 3678.6063 & 4549.594 & 0.2328 & 0.6154 & 0.9358 & 0.0026 \tabularnewline
43 & 4812.5 & 5102.6718 & 4408.1395 & 5960.6164 & 0.2537 & 0.9968 & 0.7899 & 0.7899 \tabularnewline
44 & 4071.3 & 4237.5561 & 3570.8823 & 5092.3941 & 0.3515 & 0.0937 & 0.8092 & 0.1201 \tabularnewline
45 & 4163.4 & 4505.0433 & 3672.5159 & 5627.78 & 0.2754 & 0.7755 & 0.8054 & 0.3346 \tabularnewline
46 & 4077.6 & 4355.117 & 3454.4681 & 5622.1763 & 0.3339 & 0.6166 & 0.7556 & 0.2708 \tabularnewline
47 & 5109.2 & 5477.2931 & 4119.5628 & 7554.6157 & 0.3642 & 0.9067 & 0.7348 & 0.7538 \tabularnewline
48 & 4207.6 & 4548.4212 & 3367.0773 & 6402.5923 & 0.3593 & 0.2767 & 0.693 & 0.4157 \tabularnewline
49 & 4320.8 & 4815.253 & 3425.2502 & 7143.7759 & 0.3386 & 0.6955 & 0.7084 & 0.522 \tabularnewline
50 & 4396.9 & 4651.6645 & 3222.8305 & 7152.6182 & 0.4209 & 0.6023 & 0.6736 & 0.4693 \tabularnewline
51 & 5358.8 & 5901.9318 & 3822.2556 & 9988.4533 & 0.3972 & 0.7648 & 0.6481 & 0.7097 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302515&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]35[/C][C]4505.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]3695[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]3894.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]3718.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]4749.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]3855.9[/C][C]3970.1502[/C][C]3734.8739[/C][C]4226.7107[/C][C]0.1914[/C][C]0[/C][C]0.9822[/C][C]0[/C][/ROW]
[ROW][C]41[/C][C]4011.7[/C][C]4165.1706[/C][C]3821.3451[/C][C]4553.9153[/C][C]0.2195[/C][C]0.9405[/C][C]0.9141[/C][C]0.0016[/C][/ROW]
[ROW][C]42[/C][C]3907.6[/C][C]4081.762[/C][C]3678.6063[/C][C]4549.594[/C][C]0.2328[/C][C]0.6154[/C][C]0.9358[/C][C]0.0026[/C][/ROW]
[ROW][C]43[/C][C]4812.5[/C][C]5102.6718[/C][C]4408.1395[/C][C]5960.6164[/C][C]0.2537[/C][C]0.9968[/C][C]0.7899[/C][C]0.7899[/C][/ROW]
[ROW][C]44[/C][C]4071.3[/C][C]4237.5561[/C][C]3570.8823[/C][C]5092.3941[/C][C]0.3515[/C][C]0.0937[/C][C]0.8092[/C][C]0.1201[/C][/ROW]
[ROW][C]45[/C][C]4163.4[/C][C]4505.0433[/C][C]3672.5159[/C][C]5627.78[/C][C]0.2754[/C][C]0.7755[/C][C]0.8054[/C][C]0.3346[/C][/ROW]
[ROW][C]46[/C][C]4077.6[/C][C]4355.117[/C][C]3454.4681[/C][C]5622.1763[/C][C]0.3339[/C][C]0.6166[/C][C]0.7556[/C][C]0.2708[/C][/ROW]
[ROW][C]47[/C][C]5109.2[/C][C]5477.2931[/C][C]4119.5628[/C][C]7554.6157[/C][C]0.3642[/C][C]0.9067[/C][C]0.7348[/C][C]0.7538[/C][/ROW]
[ROW][C]48[/C][C]4207.6[/C][C]4548.4212[/C][C]3367.0773[/C][C]6402.5923[/C][C]0.3593[/C][C]0.2767[/C][C]0.693[/C][C]0.4157[/C][/ROW]
[ROW][C]49[/C][C]4320.8[/C][C]4815.253[/C][C]3425.2502[/C][C]7143.7759[/C][C]0.3386[/C][C]0.6955[/C][C]0.7084[/C][C]0.522[/C][/ROW]
[ROW][C]50[/C][C]4396.9[/C][C]4651.6645[/C][C]3222.8305[/C][C]7152.6182[/C][C]0.4209[/C][C]0.6023[/C][C]0.6736[/C][C]0.4693[/C][/ROW]
[ROW][C]51[/C][C]5358.8[/C][C]5901.9318[/C][C]3822.2556[/C][C]9988.4533[/C][C]0.3972[/C][C]0.7648[/C][C]0.6481[/C][C]0.7097[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302515&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302515&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])
354505.8-------
363695-------
373894.1-------
383718.9-------
394749.8-------
403855.93970.15023734.87394226.71070.191400.98220
414011.74165.17063821.34514553.91530.21950.94050.91410.0016
423907.64081.7623678.60634549.5940.23280.61540.93580.0026
434812.55102.67184408.13955960.61640.25370.99680.78990.7899
444071.34237.55613570.88235092.39410.35150.09370.80920.1201
454163.44505.04333672.51595627.780.27540.77550.80540.3346
464077.64355.1173454.46815622.17630.33390.61660.75560.2708
475109.25477.29314119.56287554.61570.36420.90670.73480.7538
484207.64548.42123367.07736402.59230.35930.27670.6930.4157
494320.84815.2533425.25027143.77590.33860.69550.70840.522
504396.94651.66453222.83057152.61820.42090.60230.67360.4693
515358.85901.93183822.25569988.45330.39720.76480.64810.7097







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
400.033-0.02960.02960.029213053.115200-0.24320.2432
410.0476-0.03830.03390.033423553.231718303.1735135.2892-0.32660.2849
420.0585-0.04460.03750.036830332.417422312.9214149.3751-0.37070.3135
430.0858-0.06030.04320.042284199.669437784.6084194.3826-0.61760.3895
440.1029-0.04080.04270.041827641.093635755.9055189.0923-0.35390.3824
450.1272-0.08210.04930.048116720.154949249.947221.9233-0.72710.4398
460.1484-0.06810.0520.050577015.672553216.4793230.687-0.59070.4614
470.1935-0.0720.05450.0529135492.54163500.987251.994-0.78340.5016
480.208-0.0810.05740.0557116159.086369351.8869263.3475-0.72540.5265
490.2467-0.11440.06310.0609244483.789386865.0771294.7288-1.05240.5791
500.2743-0.05790.06260.060564904.956784868.7026291.3223-0.54220.5757
510.3533-0.10140.06590.0635294992.1776102378.9921319.9672-1.1560.6241

\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.033 & -0.0296 & 0.0296 & 0.0292 & 13053.1152 & 0 & 0 & -0.2432 & 0.2432 \tabularnewline
41 & 0.0476 & -0.0383 & 0.0339 & 0.0334 & 23553.2317 & 18303.1735 & 135.2892 & -0.3266 & 0.2849 \tabularnewline
42 & 0.0585 & -0.0446 & 0.0375 & 0.0368 & 30332.4174 & 22312.9214 & 149.3751 & -0.3707 & 0.3135 \tabularnewline
43 & 0.0858 & -0.0603 & 0.0432 & 0.0422 & 84199.6694 & 37784.6084 & 194.3826 & -0.6176 & 0.3895 \tabularnewline
44 & 0.1029 & -0.0408 & 0.0427 & 0.0418 & 27641.0936 & 35755.9055 & 189.0923 & -0.3539 & 0.3824 \tabularnewline
45 & 0.1272 & -0.0821 & 0.0493 & 0.048 & 116720.1549 & 49249.947 & 221.9233 & -0.7271 & 0.4398 \tabularnewline
46 & 0.1484 & -0.0681 & 0.052 & 0.0505 & 77015.6725 & 53216.4793 & 230.687 & -0.5907 & 0.4614 \tabularnewline
47 & 0.1935 & -0.072 & 0.0545 & 0.0529 & 135492.541 & 63500.987 & 251.994 & -0.7834 & 0.5016 \tabularnewline
48 & 0.208 & -0.081 & 0.0574 & 0.0557 & 116159.0863 & 69351.8869 & 263.3475 & -0.7254 & 0.5265 \tabularnewline
49 & 0.2467 & -0.1144 & 0.0631 & 0.0609 & 244483.7893 & 86865.0771 & 294.7288 & -1.0524 & 0.5791 \tabularnewline
50 & 0.2743 & -0.0579 & 0.0626 & 0.0605 & 64904.9567 & 84868.7026 & 291.3223 & -0.5422 & 0.5757 \tabularnewline
51 & 0.3533 & -0.1014 & 0.0659 & 0.0635 & 294992.1776 & 102378.9921 & 319.9672 & -1.156 & 0.6241 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302515&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.033[/C][C]-0.0296[/C][C]0.0296[/C][C]0.0292[/C][C]13053.1152[/C][C]0[/C][C]0[/C][C]-0.2432[/C][C]0.2432[/C][/ROW]
[ROW][C]41[/C][C]0.0476[/C][C]-0.0383[/C][C]0.0339[/C][C]0.0334[/C][C]23553.2317[/C][C]18303.1735[/C][C]135.2892[/C][C]-0.3266[/C][C]0.2849[/C][/ROW]
[ROW][C]42[/C][C]0.0585[/C][C]-0.0446[/C][C]0.0375[/C][C]0.0368[/C][C]30332.4174[/C][C]22312.9214[/C][C]149.3751[/C][C]-0.3707[/C][C]0.3135[/C][/ROW]
[ROW][C]43[/C][C]0.0858[/C][C]-0.0603[/C][C]0.0432[/C][C]0.0422[/C][C]84199.6694[/C][C]37784.6084[/C][C]194.3826[/C][C]-0.6176[/C][C]0.3895[/C][/ROW]
[ROW][C]44[/C][C]0.1029[/C][C]-0.0408[/C][C]0.0427[/C][C]0.0418[/C][C]27641.0936[/C][C]35755.9055[/C][C]189.0923[/C][C]-0.3539[/C][C]0.3824[/C][/ROW]
[ROW][C]45[/C][C]0.1272[/C][C]-0.0821[/C][C]0.0493[/C][C]0.048[/C][C]116720.1549[/C][C]49249.947[/C][C]221.9233[/C][C]-0.7271[/C][C]0.4398[/C][/ROW]
[ROW][C]46[/C][C]0.1484[/C][C]-0.0681[/C][C]0.052[/C][C]0.0505[/C][C]77015.6725[/C][C]53216.4793[/C][C]230.687[/C][C]-0.5907[/C][C]0.4614[/C][/ROW]
[ROW][C]47[/C][C]0.1935[/C][C]-0.072[/C][C]0.0545[/C][C]0.0529[/C][C]135492.541[/C][C]63500.987[/C][C]251.994[/C][C]-0.7834[/C][C]0.5016[/C][/ROW]
[ROW][C]48[/C][C]0.208[/C][C]-0.081[/C][C]0.0574[/C][C]0.0557[/C][C]116159.0863[/C][C]69351.8869[/C][C]263.3475[/C][C]-0.7254[/C][C]0.5265[/C][/ROW]
[ROW][C]49[/C][C]0.2467[/C][C]-0.1144[/C][C]0.0631[/C][C]0.0609[/C][C]244483.7893[/C][C]86865.0771[/C][C]294.7288[/C][C]-1.0524[/C][C]0.5791[/C][/ROW]
[ROW][C]50[/C][C]0.2743[/C][C]-0.0579[/C][C]0.0626[/C][C]0.0605[/C][C]64904.9567[/C][C]84868.7026[/C][C]291.3223[/C][C]-0.5422[/C][C]0.5757[/C][/ROW]
[ROW][C]51[/C][C]0.3533[/C][C]-0.1014[/C][C]0.0659[/C][C]0.0635[/C][C]294992.1776[/C][C]102378.9921[/C][C]319.9672[/C][C]-1.156[/C][C]0.6241[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302515&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302515&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.033-0.02960.02960.029213053.115200-0.24320.2432
410.0476-0.03830.03390.033423553.231718303.1735135.2892-0.32660.2849
420.0585-0.04460.03750.036830332.417422312.9214149.3751-0.37070.3135
430.0858-0.06030.04320.042284199.669437784.6084194.3826-0.61760.3895
440.1029-0.04080.04270.041827641.093635755.9055189.0923-0.35390.3824
450.1272-0.08210.04930.048116720.154949249.947221.9233-0.72710.4398
460.1484-0.06810.0520.050577015.672553216.4793230.687-0.59070.4614
470.1935-0.0720.05450.0529135492.54163500.987251.994-0.78340.5016
480.208-0.0810.05740.0557116159.086369351.8869263.3475-0.72540.5265
490.2467-0.11440.06310.0609244483.789386865.0771294.7288-1.05240.5791
500.2743-0.05790.06260.060564904.956784868.7026291.3223-0.54220.5757
510.3533-0.10140.06590.0635294992.1776102378.9921319.9672-1.1560.6241



Parameters (Session):
par1 = additive ; par2 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = -0.4 ; par3 = 1 ; par4 = 1 ; par5 = 4 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; 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*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')