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, 21 Nov 2014 13:10:17 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2014/Nov/21/t14165754276amuuy34oeglyu7.htm/, Retrieved Sun, 19 May 2024 14:11:22 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=257600, Retrieved Sun, 19 May 2024 14:11:22 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact99
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Monthly US soldie...] [2010-11-02 12:07:39] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [] [2014-11-21 12:50:37] [78252ca1523d3477f114bddbfa59edb4]
- RMP       [ARIMA Forecasting] [] [2014-11-21 13:10:17] [54099b55f731ed0aca9a713a2b2a06c3] [Current]
- R P         [ARIMA Forecasting] [] [2014-11-23 12:43:04] [78252ca1523d3477f114bddbfa59edb4]
Feedback Forum

Post a new message
Dataseries X:
37
30
47
35
30
43
82
40
47
19
52
136
80
42
54
66
81
63
137
72
107
58
36
52
79
77
54
84
48
96
83
66
61
53
30
74
69
59
42
65
70
100
63
105
82
81
75
102
121
98
76
77
63
37
35
23
40
29
37
51
20
28
13
22
25
13
16
13
16
17
9
17
25
14
8
7
10
7
10
3




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'George Udny Yule' @ yule.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 & 2 seconds \tabularnewline
R Server & 'George Udny Yule' @ yule.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=257600&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'George Udny Yule' @ yule.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=257600&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=257600&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 time2 seconds
R Server'George Udny Yule' @ yule.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[68])
5623-------
5740-------
5829-------
5937-------
6051-------
6120-------
6228-------
6313-------
6422-------
6525-------
6613-------
6716-------
6813-------
691621.206-39.828282.24020.43360.60390.27310.6039
701710.206-58.153178.56510.42280.4340.2950.4681
71918.206-56.765893.17780.40490.51260.31160.5541
721732.206-48.8407113.25270.35650.71270.32470.6788
73251.206-85.49187.9030.29530.36050.33550.3949
74149.206-82.7949101.20690.45930.36830.34440.4678
758-5.794-102.809391.22130.39020.34460.35210.3521
7673.206-98.5769104.98890.47090.46320.35870.4252
77106.206-100.131112.5430.47210.49420.36450.4502
787-5.794-116.4979104.90990.41040.38990.36970.3697
7910-2.794-117.699112.1110.41360.43370.37430.3938
803-5.794-124.7518113.16380.44240.39730.37840.3784

\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[68]) \tabularnewline
56 & 23 & - & - & - & - & - & - & - \tabularnewline
57 & 40 & - & - & - & - & - & - & - \tabularnewline
58 & 29 & - & - & - & - & - & - & - \tabularnewline
59 & 37 & - & - & - & - & - & - & - \tabularnewline
60 & 51 & - & - & - & - & - & - & - \tabularnewline
61 & 20 & - & - & - & - & - & - & - \tabularnewline
62 & 28 & - & - & - & - & - & - & - \tabularnewline
63 & 13 & - & - & - & - & - & - & - \tabularnewline
64 & 22 & - & - & - & - & - & - & - \tabularnewline
65 & 25 & - & - & - & - & - & - & - \tabularnewline
66 & 13 & - & - & - & - & - & - & - \tabularnewline
67 & 16 & - & - & - & - & - & - & - \tabularnewline
68 & 13 & - & - & - & - & - & - & - \tabularnewline
69 & 16 & 21.206 & -39.8282 & 82.2402 & 0.4336 & 0.6039 & 0.2731 & 0.6039 \tabularnewline
70 & 17 & 10.206 & -58.1531 & 78.5651 & 0.4228 & 0.434 & 0.295 & 0.4681 \tabularnewline
71 & 9 & 18.206 & -56.7658 & 93.1778 & 0.4049 & 0.5126 & 0.3116 & 0.5541 \tabularnewline
72 & 17 & 32.206 & -48.8407 & 113.2527 & 0.3565 & 0.7127 & 0.3247 & 0.6788 \tabularnewline
73 & 25 & 1.206 & -85.491 & 87.903 & 0.2953 & 0.3605 & 0.3355 & 0.3949 \tabularnewline
74 & 14 & 9.206 & -82.7949 & 101.2069 & 0.4593 & 0.3683 & 0.3444 & 0.4678 \tabularnewline
75 & 8 & -5.794 & -102.8093 & 91.2213 & 0.3902 & 0.3446 & 0.3521 & 0.3521 \tabularnewline
76 & 7 & 3.206 & -98.5769 & 104.9889 & 0.4709 & 0.4632 & 0.3587 & 0.4252 \tabularnewline
77 & 10 & 6.206 & -100.131 & 112.543 & 0.4721 & 0.4942 & 0.3645 & 0.4502 \tabularnewline
78 & 7 & -5.794 & -116.4979 & 104.9099 & 0.4104 & 0.3899 & 0.3697 & 0.3697 \tabularnewline
79 & 10 & -2.794 & -117.699 & 112.111 & 0.4136 & 0.4337 & 0.3743 & 0.3938 \tabularnewline
80 & 3 & -5.794 & -124.7518 & 113.1638 & 0.4424 & 0.3973 & 0.3784 & 0.3784 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=257600&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[68])[/C][/ROW]
[ROW][C]56[/C][C]23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]40[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]20[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]28[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]25[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]13[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]16[/C][C]21.206[/C][C]-39.8282[/C][C]82.2402[/C][C]0.4336[/C][C]0.6039[/C][C]0.2731[/C][C]0.6039[/C][/ROW]
[ROW][C]70[/C][C]17[/C][C]10.206[/C][C]-58.1531[/C][C]78.5651[/C][C]0.4228[/C][C]0.434[/C][C]0.295[/C][C]0.4681[/C][/ROW]
[ROW][C]71[/C][C]9[/C][C]18.206[/C][C]-56.7658[/C][C]93.1778[/C][C]0.4049[/C][C]0.5126[/C][C]0.3116[/C][C]0.5541[/C][/ROW]
[ROW][C]72[/C][C]17[/C][C]32.206[/C][C]-48.8407[/C][C]113.2527[/C][C]0.3565[/C][C]0.7127[/C][C]0.3247[/C][C]0.6788[/C][/ROW]
[ROW][C]73[/C][C]25[/C][C]1.206[/C][C]-85.491[/C][C]87.903[/C][C]0.2953[/C][C]0.3605[/C][C]0.3355[/C][C]0.3949[/C][/ROW]
[ROW][C]74[/C][C]14[/C][C]9.206[/C][C]-82.7949[/C][C]101.2069[/C][C]0.4593[/C][C]0.3683[/C][C]0.3444[/C][C]0.4678[/C][/ROW]
[ROW][C]75[/C][C]8[/C][C]-5.794[/C][C]-102.8093[/C][C]91.2213[/C][C]0.3902[/C][C]0.3446[/C][C]0.3521[/C][C]0.3521[/C][/ROW]
[ROW][C]76[/C][C]7[/C][C]3.206[/C][C]-98.5769[/C][C]104.9889[/C][C]0.4709[/C][C]0.4632[/C][C]0.3587[/C][C]0.4252[/C][/ROW]
[ROW][C]77[/C][C]10[/C][C]6.206[/C][C]-100.131[/C][C]112.543[/C][C]0.4721[/C][C]0.4942[/C][C]0.3645[/C][C]0.4502[/C][/ROW]
[ROW][C]78[/C][C]7[/C][C]-5.794[/C][C]-116.4979[/C][C]104.9099[/C][C]0.4104[/C][C]0.3899[/C][C]0.3697[/C][C]0.3697[/C][/ROW]
[ROW][C]79[/C][C]10[/C][C]-2.794[/C][C]-117.699[/C][C]112.111[/C][C]0.4136[/C][C]0.4337[/C][C]0.3743[/C][C]0.3938[/C][/ROW]
[ROW][C]80[/C][C]3[/C][C]-5.794[/C][C]-124.7518[/C][C]113.1638[/C][C]0.4424[/C][C]0.3973[/C][C]0.3784[/C][C]0.3784[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=257600&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=257600&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[68])
5623-------
5740-------
5829-------
5937-------
6051-------
6120-------
6228-------
6313-------
6422-------
6525-------
6613-------
6716-------
6813-------
691621.206-39.828282.24020.43360.60390.27310.6039
701710.206-58.153178.56510.42280.4340.2950.4681
71918.206-56.765893.17780.40490.51260.31160.5541
721732.206-48.8407113.25270.35650.71270.32470.6788
73251.206-85.49187.9030.29530.36050.33550.3949
74149.206-82.7949101.20690.45930.36830.34440.4678
758-5.794-102.809391.22130.39020.34460.35210.3521
7673.206-98.5769104.98890.47090.46320.35870.4252
77106.206-100.131112.5430.47210.49420.36450.4502
787-5.794-116.4979104.90990.41040.38990.36970.3697
7910-2.794-117.699112.1110.41360.43370.37430.3938
803-5.794-124.7518113.16380.44240.39730.37840.3784







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
691.4684-0.32540.32540.279827.102600-0.97060.9706
703.41730.39960.36250.389646.158336.63046.05231.26671.1186
712.101-1.02290.58260.485484.750752.67057.2574-1.71641.3179
721.2839-0.89450.66060.5185231.222897.30869.8645-2.8351.6972
7336.67720.95180.71880.778566.1538191.077613.82314.43622.245
745.09880.34240.65610.717222.9823163.061712.76960.89382.0198
75-8.54291.72420.80872.4013190.2741166.949212.92092.57182.0986
7616.19770.5420.77542.194114.3943147.879912.16060.70741.9247
778.74210.37940.73142.002314.3943133.048111.53460.70741.7895
78-9.74831.82770.8413.9238163.6861136.111911.66672.38531.849
79-20.98261.27940.88083.8899163.6861138.618711.77362.38531.8978
80-10.47512.93131.05174.090377.3342133.511611.55471.63961.8763

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
69 & 1.4684 & -0.3254 & 0.3254 & 0.2798 & 27.1026 & 0 & 0 & -0.9706 & 0.9706 \tabularnewline
70 & 3.4173 & 0.3996 & 0.3625 & 0.3896 & 46.1583 & 36.6304 & 6.0523 & 1.2667 & 1.1186 \tabularnewline
71 & 2.101 & -1.0229 & 0.5826 & 0.4854 & 84.7507 & 52.6705 & 7.2574 & -1.7164 & 1.3179 \tabularnewline
72 & 1.2839 & -0.8945 & 0.6606 & 0.5185 & 231.2228 & 97.3086 & 9.8645 & -2.835 & 1.6972 \tabularnewline
73 & 36.6772 & 0.9518 & 0.7188 & 0.778 & 566.1538 & 191.0776 & 13.8231 & 4.4362 & 2.245 \tabularnewline
74 & 5.0988 & 0.3424 & 0.6561 & 0.7172 & 22.9823 & 163.0617 & 12.7696 & 0.8938 & 2.0198 \tabularnewline
75 & -8.5429 & 1.7242 & 0.8087 & 2.4013 & 190.2741 & 166.9492 & 12.9209 & 2.5718 & 2.0986 \tabularnewline
76 & 16.1977 & 0.542 & 0.7754 & 2.1941 & 14.3943 & 147.8799 & 12.1606 & 0.7074 & 1.9247 \tabularnewline
77 & 8.7421 & 0.3794 & 0.7314 & 2.0023 & 14.3943 & 133.0481 & 11.5346 & 0.7074 & 1.7895 \tabularnewline
78 & -9.7483 & 1.8277 & 0.841 & 3.9238 & 163.6861 & 136.1119 & 11.6667 & 2.3853 & 1.849 \tabularnewline
79 & -20.9826 & 1.2794 & 0.8808 & 3.8899 & 163.6861 & 138.6187 & 11.7736 & 2.3853 & 1.8978 \tabularnewline
80 & -10.4751 & 2.9313 & 1.0517 & 4.0903 & 77.3342 & 133.5116 & 11.5547 & 1.6396 & 1.8763 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=257600&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]69[/C][C]1.4684[/C][C]-0.3254[/C][C]0.3254[/C][C]0.2798[/C][C]27.1026[/C][C]0[/C][C]0[/C][C]-0.9706[/C][C]0.9706[/C][/ROW]
[ROW][C]70[/C][C]3.4173[/C][C]0.3996[/C][C]0.3625[/C][C]0.3896[/C][C]46.1583[/C][C]36.6304[/C][C]6.0523[/C][C]1.2667[/C][C]1.1186[/C][/ROW]
[ROW][C]71[/C][C]2.101[/C][C]-1.0229[/C][C]0.5826[/C][C]0.4854[/C][C]84.7507[/C][C]52.6705[/C][C]7.2574[/C][C]-1.7164[/C][C]1.3179[/C][/ROW]
[ROW][C]72[/C][C]1.2839[/C][C]-0.8945[/C][C]0.6606[/C][C]0.5185[/C][C]231.2228[/C][C]97.3086[/C][C]9.8645[/C][C]-2.835[/C][C]1.6972[/C][/ROW]
[ROW][C]73[/C][C]36.6772[/C][C]0.9518[/C][C]0.7188[/C][C]0.778[/C][C]566.1538[/C][C]191.0776[/C][C]13.8231[/C][C]4.4362[/C][C]2.245[/C][/ROW]
[ROW][C]74[/C][C]5.0988[/C][C]0.3424[/C][C]0.6561[/C][C]0.7172[/C][C]22.9823[/C][C]163.0617[/C][C]12.7696[/C][C]0.8938[/C][C]2.0198[/C][/ROW]
[ROW][C]75[/C][C]-8.5429[/C][C]1.7242[/C][C]0.8087[/C][C]2.4013[/C][C]190.2741[/C][C]166.9492[/C][C]12.9209[/C][C]2.5718[/C][C]2.0986[/C][/ROW]
[ROW][C]76[/C][C]16.1977[/C][C]0.542[/C][C]0.7754[/C][C]2.1941[/C][C]14.3943[/C][C]147.8799[/C][C]12.1606[/C][C]0.7074[/C][C]1.9247[/C][/ROW]
[ROW][C]77[/C][C]8.7421[/C][C]0.3794[/C][C]0.7314[/C][C]2.0023[/C][C]14.3943[/C][C]133.0481[/C][C]11.5346[/C][C]0.7074[/C][C]1.7895[/C][/ROW]
[ROW][C]78[/C][C]-9.7483[/C][C]1.8277[/C][C]0.841[/C][C]3.9238[/C][C]163.6861[/C][C]136.1119[/C][C]11.6667[/C][C]2.3853[/C][C]1.849[/C][/ROW]
[ROW][C]79[/C][C]-20.9826[/C][C]1.2794[/C][C]0.8808[/C][C]3.8899[/C][C]163.6861[/C][C]138.6187[/C][C]11.7736[/C][C]2.3853[/C][C]1.8978[/C][/ROW]
[ROW][C]80[/C][C]-10.4751[/C][C]2.9313[/C][C]1.0517[/C][C]4.0903[/C][C]77.3342[/C][C]133.5116[/C][C]11.5547[/C][C]1.6396[/C][C]1.8763[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=257600&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=257600&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
691.4684-0.32540.32540.279827.102600-0.97060.9706
703.41730.39960.36250.389646.158336.63046.05231.26671.1186
712.101-1.02290.58260.485484.750752.67057.2574-1.71641.3179
721.2839-0.89450.66060.5185231.222897.30869.8645-2.8351.6972
7336.67720.95180.71880.778566.1538191.077613.82314.43622.245
745.09880.34240.65610.717222.9823163.061712.76960.89382.0198
75-8.54291.72420.80872.4013190.2741166.949212.92092.57182.0986
7616.19770.5420.77542.194114.3943147.879912.16060.70741.9247
778.74210.37940.73142.002314.3943133.048111.53460.70741.7895
78-9.74831.82770.8413.9238163.6861136.111911.66672.38531.849
79-20.98261.27940.88083.8899163.6861138.618711.77362.38531.8978
80-10.47512.93131.05174.090377.3342133.511611.55471.63961.8763



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