Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSat, 22 Dec 2012 19:13:05 -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/2012/Dec/22/t1356221593b96phokdtpknntd.htm/, Retrieved Thu, 28 Mar 2024 19:35:17 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=204653, Retrieved Thu, 28 Mar 2024 19:35:17 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact72
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD  [ARIMA Forecasting] [Forecasting] [2009-12-17 18:28:53] [1eab65e90adf64584b8e6f0da23ff414]
- R P       [ARIMA Forecasting] [] [2012-12-23 00:13:05] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
103.34
102.60
100.69
105.67
123.61
113.08
106.46
123.38
109.87
95.74
123.06
123.39
120.28
115.33
110.40
114.49
132.03
123.16
118.82
128.32
112.24
104.53
132.57
122.52
131.80
124.55
120.96
122.60
145.52
118.57
134.25
136.70
121.37
111.63
134.42
137.65
137.86
119.77
130.69
128.28
147.45
128.42
136.90
143.95
135.64
122.48
136.83
153.04
142.71
123.46
144.37
146.15
147.61
158.51
147.40
165.05
154.64
126.20
157.36
154.15
123.21
113.07
110.45
113.57
122.44
114.93
111.85
126.04
121.34
124.36




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=204653&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'Gwilym Jenkins' @ jenkins.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[58])
46122.48-------
47136.83-------
48153.04-------
49142.71-------
50123.46-------
51144.37-------
52146.15-------
53147.61-------
54158.51-------
55147.4-------
56165.05-------
57154.64-------
58126.2-------
59157.36156.2106142.6452171.06620.439710.99471
60154.15168.9054154.0709185.16830.03770.9180.97211
61123.21154.7528140.8233170.0600.53080.93850.9999
62113.07138.2214124.9259152.93194e-040.97730.97540.9454
63110.45158.674143.3938175.5826010.95140.9999
64113.57160.7468144.8664178.3681010.94780.9999
65122.44163.6888147.1654182.0673010.95681
66114.93174.4979156.7282194.2823010.94341
67111.85162.6467145.7624181.4869010.94360.9999
68126.04182.3914163.1803203.8642010.94331
69121.34170.4844152.3067190.8317010.93651
70124.36139.3131124.2326156.22430.04150.98140.93570.9357

\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[58]) \tabularnewline
46 & 122.48 & - & - & - & - & - & - & - \tabularnewline
47 & 136.83 & - & - & - & - & - & - & - \tabularnewline
48 & 153.04 & - & - & - & - & - & - & - \tabularnewline
49 & 142.71 & - & - & - & - & - & - & - \tabularnewline
50 & 123.46 & - & - & - & - & - & - & - \tabularnewline
51 & 144.37 & - & - & - & - & - & - & - \tabularnewline
52 & 146.15 & - & - & - & - & - & - & - \tabularnewline
53 & 147.61 & - & - & - & - & - & - & - \tabularnewline
54 & 158.51 & - & - & - & - & - & - & - \tabularnewline
55 & 147.4 & - & - & - & - & - & - & - \tabularnewline
56 & 165.05 & - & - & - & - & - & - & - \tabularnewline
57 & 154.64 & - & - & - & - & - & - & - \tabularnewline
58 & 126.2 & - & - & - & - & - & - & - \tabularnewline
59 & 157.36 & 156.2106 & 142.6452 & 171.0662 & 0.4397 & 1 & 0.9947 & 1 \tabularnewline
60 & 154.15 & 168.9054 & 154.0709 & 185.1683 & 0.0377 & 0.918 & 0.9721 & 1 \tabularnewline
61 & 123.21 & 154.7528 & 140.8233 & 170.06 & 0 & 0.5308 & 0.9385 & 0.9999 \tabularnewline
62 & 113.07 & 138.2214 & 124.9259 & 152.9319 & 4e-04 & 0.9773 & 0.9754 & 0.9454 \tabularnewline
63 & 110.45 & 158.674 & 143.3938 & 175.5826 & 0 & 1 & 0.9514 & 0.9999 \tabularnewline
64 & 113.57 & 160.7468 & 144.8664 & 178.3681 & 0 & 1 & 0.9478 & 0.9999 \tabularnewline
65 & 122.44 & 163.6888 & 147.1654 & 182.0673 & 0 & 1 & 0.9568 & 1 \tabularnewline
66 & 114.93 & 174.4979 & 156.7282 & 194.2823 & 0 & 1 & 0.9434 & 1 \tabularnewline
67 & 111.85 & 162.6467 & 145.7624 & 181.4869 & 0 & 1 & 0.9436 & 0.9999 \tabularnewline
68 & 126.04 & 182.3914 & 163.1803 & 203.8642 & 0 & 1 & 0.9433 & 1 \tabularnewline
69 & 121.34 & 170.4844 & 152.3067 & 190.8317 & 0 & 1 & 0.9365 & 1 \tabularnewline
70 & 124.36 & 139.3131 & 124.2326 & 156.2243 & 0.0415 & 0.9814 & 0.9357 & 0.9357 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=204653&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[58])[/C][/ROW]
[ROW][C]46[/C][C]122.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]136.83[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]153.04[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]142.71[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]123.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]144.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]146.15[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]147.61[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]158.51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]147.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]165.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]154.64[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]126.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]157.36[/C][C]156.2106[/C][C]142.6452[/C][C]171.0662[/C][C]0.4397[/C][C]1[/C][C]0.9947[/C][C]1[/C][/ROW]
[ROW][C]60[/C][C]154.15[/C][C]168.9054[/C][C]154.0709[/C][C]185.1683[/C][C]0.0377[/C][C]0.918[/C][C]0.9721[/C][C]1[/C][/ROW]
[ROW][C]61[/C][C]123.21[/C][C]154.7528[/C][C]140.8233[/C][C]170.06[/C][C]0[/C][C]0.5308[/C][C]0.9385[/C][C]0.9999[/C][/ROW]
[ROW][C]62[/C][C]113.07[/C][C]138.2214[/C][C]124.9259[/C][C]152.9319[/C][C]4e-04[/C][C]0.9773[/C][C]0.9754[/C][C]0.9454[/C][/ROW]
[ROW][C]63[/C][C]110.45[/C][C]158.674[/C][C]143.3938[/C][C]175.5826[/C][C]0[/C][C]1[/C][C]0.9514[/C][C]0.9999[/C][/ROW]
[ROW][C]64[/C][C]113.57[/C][C]160.7468[/C][C]144.8664[/C][C]178.3681[/C][C]0[/C][C]1[/C][C]0.9478[/C][C]0.9999[/C][/ROW]
[ROW][C]65[/C][C]122.44[/C][C]163.6888[/C][C]147.1654[/C][C]182.0673[/C][C]0[/C][C]1[/C][C]0.9568[/C][C]1[/C][/ROW]
[ROW][C]66[/C][C]114.93[/C][C]174.4979[/C][C]156.7282[/C][C]194.2823[/C][C]0[/C][C]1[/C][C]0.9434[/C][C]1[/C][/ROW]
[ROW][C]67[/C][C]111.85[/C][C]162.6467[/C][C]145.7624[/C][C]181.4869[/C][C]0[/C][C]1[/C][C]0.9436[/C][C]0.9999[/C][/ROW]
[ROW][C]68[/C][C]126.04[/C][C]182.3914[/C][C]163.1803[/C][C]203.8642[/C][C]0[/C][C]1[/C][C]0.9433[/C][C]1[/C][/ROW]
[ROW][C]69[/C][C]121.34[/C][C]170.4844[/C][C]152.3067[/C][C]190.8317[/C][C]0[/C][C]1[/C][C]0.9365[/C][C]1[/C][/ROW]
[ROW][C]70[/C][C]124.36[/C][C]139.3131[/C][C]124.2326[/C][C]156.2243[/C][C]0.0415[/C][C]0.9814[/C][C]0.9357[/C][C]0.9357[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=204653&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=204653&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[58])
46122.48-------
47136.83-------
48153.04-------
49142.71-------
50123.46-------
51144.37-------
52146.15-------
53147.61-------
54158.51-------
55147.4-------
56165.05-------
57154.64-------
58126.2-------
59157.36156.2106142.6452171.06620.439710.99471
60154.15168.9054154.0709185.16830.03770.9180.97211
61123.21154.7528140.8233170.0600.53080.93850.9999
62113.07138.2214124.9259152.93194e-040.97730.97540.9454
63110.45158.674143.3938175.5826010.95140.9999
64113.57160.7468144.8664178.3681010.94780.9999
65122.44163.6888147.1654182.0673010.95681
66114.93174.4979156.7282194.2823010.94341
67111.85162.6467145.7624181.4869010.94360.9999
68126.04182.3914163.1803203.8642010.94331
69121.34170.4844152.3067190.8317010.93651
70124.36139.3131124.2326156.22430.04150.98140.93570.9357







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
590.04850.007401.321100
600.0491-0.08740.0474217.7226109.521810.4653
610.0505-0.20380.0995994.9451404.662920.1162
620.0543-0.1820.1201632.5924461.645321.4859
630.0544-0.30390.15692325.5562834.427528.8865
640.0559-0.29350.17972225.65021066.297932.6542
650.0573-0.2520.191701.46071157.035534.0152
660.0578-0.34140.20893548.33511455.947938.1569
670.0591-0.31230.22042580.30861580.876939.7602
680.0601-0.3090.22933175.48111740.337341.7174
690.0609-0.28830.23462415.17491801.686242.4463
700.0619-0.10730.224223.59521670.178640.8678

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
59 & 0.0485 & 0.0074 & 0 & 1.3211 & 0 & 0 \tabularnewline
60 & 0.0491 & -0.0874 & 0.0474 & 217.7226 & 109.5218 & 10.4653 \tabularnewline
61 & 0.0505 & -0.2038 & 0.0995 & 994.9451 & 404.6629 & 20.1162 \tabularnewline
62 & 0.0543 & -0.182 & 0.1201 & 632.5924 & 461.6453 & 21.4859 \tabularnewline
63 & 0.0544 & -0.3039 & 0.1569 & 2325.5562 & 834.4275 & 28.8865 \tabularnewline
64 & 0.0559 & -0.2935 & 0.1797 & 2225.6502 & 1066.2979 & 32.6542 \tabularnewline
65 & 0.0573 & -0.252 & 0.19 & 1701.4607 & 1157.0355 & 34.0152 \tabularnewline
66 & 0.0578 & -0.3414 & 0.2089 & 3548.3351 & 1455.9479 & 38.1569 \tabularnewline
67 & 0.0591 & -0.3123 & 0.2204 & 2580.3086 & 1580.8769 & 39.7602 \tabularnewline
68 & 0.0601 & -0.309 & 0.2293 & 3175.4811 & 1740.3373 & 41.7174 \tabularnewline
69 & 0.0609 & -0.2883 & 0.2346 & 2415.1749 & 1801.6862 & 42.4463 \tabularnewline
70 & 0.0619 & -0.1073 & 0.224 & 223.5952 & 1670.1786 & 40.8678 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=204653&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]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]59[/C][C]0.0485[/C][C]0.0074[/C][C]0[/C][C]1.3211[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]60[/C][C]0.0491[/C][C]-0.0874[/C][C]0.0474[/C][C]217.7226[/C][C]109.5218[/C][C]10.4653[/C][/ROW]
[ROW][C]61[/C][C]0.0505[/C][C]-0.2038[/C][C]0.0995[/C][C]994.9451[/C][C]404.6629[/C][C]20.1162[/C][/ROW]
[ROW][C]62[/C][C]0.0543[/C][C]-0.182[/C][C]0.1201[/C][C]632.5924[/C][C]461.6453[/C][C]21.4859[/C][/ROW]
[ROW][C]63[/C][C]0.0544[/C][C]-0.3039[/C][C]0.1569[/C][C]2325.5562[/C][C]834.4275[/C][C]28.8865[/C][/ROW]
[ROW][C]64[/C][C]0.0559[/C][C]-0.2935[/C][C]0.1797[/C][C]2225.6502[/C][C]1066.2979[/C][C]32.6542[/C][/ROW]
[ROW][C]65[/C][C]0.0573[/C][C]-0.252[/C][C]0.19[/C][C]1701.4607[/C][C]1157.0355[/C][C]34.0152[/C][/ROW]
[ROW][C]66[/C][C]0.0578[/C][C]-0.3414[/C][C]0.2089[/C][C]3548.3351[/C][C]1455.9479[/C][C]38.1569[/C][/ROW]
[ROW][C]67[/C][C]0.0591[/C][C]-0.3123[/C][C]0.2204[/C][C]2580.3086[/C][C]1580.8769[/C][C]39.7602[/C][/ROW]
[ROW][C]68[/C][C]0.0601[/C][C]-0.309[/C][C]0.2293[/C][C]3175.4811[/C][C]1740.3373[/C][C]41.7174[/C][/ROW]
[ROW][C]69[/C][C]0.0609[/C][C]-0.2883[/C][C]0.2346[/C][C]2415.1749[/C][C]1801.6862[/C][C]42.4463[/C][/ROW]
[ROW][C]70[/C][C]0.0619[/C][C]-0.1073[/C][C]0.224[/C][C]223.5952[/C][C]1670.1786[/C][C]40.8678[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=204653&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=204653&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.PEMAPESq.EMSERMSE
590.04850.007401.321100
600.0491-0.08740.0474217.7226109.521810.4653
610.0505-0.20380.0995994.9451404.662920.1162
620.0543-0.1820.1201632.5924461.645321.4859
630.0544-0.30390.15692325.5562834.427528.8865
640.0559-0.29350.17972225.65021066.297932.6542
650.0573-0.2520.191701.46071157.035534.0152
660.0578-0.34140.20893548.33511455.947938.1569
670.0591-0.31230.22042580.30861580.876939.7602
680.0601-0.3090.22933175.48111740.337341.7174
690.0609-0.28830.23462415.17491801.686242.4463
700.0619-0.10730.224223.59521670.178640.8678



Parameters (Session):
par1 = 50 ; par2 = 36 ;
Parameters (R input):
par1 = 12 ; par2 = 0.0 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; 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
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.mape <- array(0, dim=fx)
perf.mape1 <- 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)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[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.mse[1] = abs(perf.se[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.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[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',7,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,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',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.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')