Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 31 Dec 2009 03:35:45 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2009/Dec/31/t1262255778w23cwax1oi4kumb.htm/, Retrieved Thu, 02 May 2024 10:59:53 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71442, Retrieved Thu, 02 May 2024 10:59:53 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact139
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [aandelenmarkt BEL 20] [2009-12-27 14:10:55] [74be16979710d4c4e7c6647856088456]
- RMPD    [ARIMA Forecasting] [maandelijkse prij...] [2009-12-31 10:35:45] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
40.22
44.23
45.85
53.38
53.26
51.8
55.3
57.81
63.96
63.77
59.15
56.12
57.42
63.52
61.71
63.01
68.18
72.03
69.75
74.41
74.33
64.24
60.03
59.44
62.5
55.04
58.34
61.92
67.65
67.68
70.3
75.26
71.44
76.36
81.71
92.6
90.6
92.23
94.09
102.79
109.65
124.05
132.69
135.81
116.07
101.42
75.73
55.48
43.8
45.29
44.01
47.48
51.07
57.84
69.04
65.61
72.87
68.41
73.25
77.43




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

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

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







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[48])
3692.6-------
3790.6-------
3892.23-------
3994.09-------
40102.79-------
41109.65-------
42124.05-------
43132.69-------
44135.81-------
45116.07-------
46101.42-------
4775.73-------
4855.48-------
4943.848.141642.60955.01710.10790.018200.0182
5045.2944.873936.503157.12690.47350.568200.0449
5144.0143.281532.821961.01390.46790.412200.0888
5247.4842.470830.346665.96960.3380.448900.1389
5351.0742.048828.540771.68240.27540.359700.1872
5457.8441.826627.139578.01560.19290.308300.2298
5569.0441.708926.000984.92480.10760.232200.2661
5665.6141.646325.043392.42030.17750.14521e-040.2967
5772.8741.61324.2171100.54980.14930.21240.00660.3223
5868.4141.595223.4905109.38930.21910.18290.04190.3441
5973.2541.585822.842119.03980.21150.24860.19380.3626
6077.4341.580722.2565129.62760.21240.24040.37850.3785

\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[48]) \tabularnewline
36 & 92.6 & - & - & - & - & - & - & - \tabularnewline
37 & 90.6 & - & - & - & - & - & - & - \tabularnewline
38 & 92.23 & - & - & - & - & - & - & - \tabularnewline
39 & 94.09 & - & - & - & - & - & - & - \tabularnewline
40 & 102.79 & - & - & - & - & - & - & - \tabularnewline
41 & 109.65 & - & - & - & - & - & - & - \tabularnewline
42 & 124.05 & - & - & - & - & - & - & - \tabularnewline
43 & 132.69 & - & - & - & - & - & - & - \tabularnewline
44 & 135.81 & - & - & - & - & - & - & - \tabularnewline
45 & 116.07 & - & - & - & - & - & - & - \tabularnewline
46 & 101.42 & - & - & - & - & - & - & - \tabularnewline
47 & 75.73 & - & - & - & - & - & - & - \tabularnewline
48 & 55.48 & - & - & - & - & - & - & - \tabularnewline
49 & 43.8 & 48.1416 & 42.609 & 55.0171 & 0.1079 & 0.0182 & 0 & 0.0182 \tabularnewline
50 & 45.29 & 44.8739 & 36.5031 & 57.1269 & 0.4735 & 0.5682 & 0 & 0.0449 \tabularnewline
51 & 44.01 & 43.2815 & 32.8219 & 61.0139 & 0.4679 & 0.4122 & 0 & 0.0888 \tabularnewline
52 & 47.48 & 42.4708 & 30.3466 & 65.9696 & 0.338 & 0.4489 & 0 & 0.1389 \tabularnewline
53 & 51.07 & 42.0488 & 28.5407 & 71.6824 & 0.2754 & 0.3597 & 0 & 0.1872 \tabularnewline
54 & 57.84 & 41.8266 & 27.1395 & 78.0156 & 0.1929 & 0.3083 & 0 & 0.2298 \tabularnewline
55 & 69.04 & 41.7089 & 26.0009 & 84.9248 & 0.1076 & 0.2322 & 0 & 0.2661 \tabularnewline
56 & 65.61 & 41.6463 & 25.0433 & 92.4203 & 0.1775 & 0.1452 & 1e-04 & 0.2967 \tabularnewline
57 & 72.87 & 41.613 & 24.2171 & 100.5498 & 0.1493 & 0.2124 & 0.0066 & 0.3223 \tabularnewline
58 & 68.41 & 41.5952 & 23.4905 & 109.3893 & 0.2191 & 0.1829 & 0.0419 & 0.3441 \tabularnewline
59 & 73.25 & 41.5858 & 22.842 & 119.0398 & 0.2115 & 0.2486 & 0.1938 & 0.3626 \tabularnewline
60 & 77.43 & 41.5807 & 22.2565 & 129.6276 & 0.2124 & 0.2404 & 0.3785 & 0.3785 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71442&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[48])[/C][/ROW]
[ROW][C]36[/C][C]92.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]90.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]92.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]94.09[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]102.79[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]109.65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]124.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]132.69[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]135.81[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]116.07[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]101.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]75.73[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]55.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]43.8[/C][C]48.1416[/C][C]42.609[/C][C]55.0171[/C][C]0.1079[/C][C]0.0182[/C][C]0[/C][C]0.0182[/C][/ROW]
[ROW][C]50[/C][C]45.29[/C][C]44.8739[/C][C]36.5031[/C][C]57.1269[/C][C]0.4735[/C][C]0.5682[/C][C]0[/C][C]0.0449[/C][/ROW]
[ROW][C]51[/C][C]44.01[/C][C]43.2815[/C][C]32.8219[/C][C]61.0139[/C][C]0.4679[/C][C]0.4122[/C][C]0[/C][C]0.0888[/C][/ROW]
[ROW][C]52[/C][C]47.48[/C][C]42.4708[/C][C]30.3466[/C][C]65.9696[/C][C]0.338[/C][C]0.4489[/C][C]0[/C][C]0.1389[/C][/ROW]
[ROW][C]53[/C][C]51.07[/C][C]42.0488[/C][C]28.5407[/C][C]71.6824[/C][C]0.2754[/C][C]0.3597[/C][C]0[/C][C]0.1872[/C][/ROW]
[ROW][C]54[/C][C]57.84[/C][C]41.8266[/C][C]27.1395[/C][C]78.0156[/C][C]0.1929[/C][C]0.3083[/C][C]0[/C][C]0.2298[/C][/ROW]
[ROW][C]55[/C][C]69.04[/C][C]41.7089[/C][C]26.0009[/C][C]84.9248[/C][C]0.1076[/C][C]0.2322[/C][C]0[/C][C]0.2661[/C][/ROW]
[ROW][C]56[/C][C]65.61[/C][C]41.6463[/C][C]25.0433[/C][C]92.4203[/C][C]0.1775[/C][C]0.1452[/C][C]1e-04[/C][C]0.2967[/C][/ROW]
[ROW][C]57[/C][C]72.87[/C][C]41.613[/C][C]24.2171[/C][C]100.5498[/C][C]0.1493[/C][C]0.2124[/C][C]0.0066[/C][C]0.3223[/C][/ROW]
[ROW][C]58[/C][C]68.41[/C][C]41.5952[/C][C]23.4905[/C][C]109.3893[/C][C]0.2191[/C][C]0.1829[/C][C]0.0419[/C][C]0.3441[/C][/ROW]
[ROW][C]59[/C][C]73.25[/C][C]41.5858[/C][C]22.842[/C][C]119.0398[/C][C]0.2115[/C][C]0.2486[/C][C]0.1938[/C][C]0.3626[/C][/ROW]
[ROW][C]60[/C][C]77.43[/C][C]41.5807[/C][C]22.2565[/C][C]129.6276[/C][C]0.2124[/C][C]0.2404[/C][C]0.3785[/C][C]0.3785[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71442&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71442&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[48])
3692.6-------
3790.6-------
3892.23-------
3994.09-------
40102.79-------
41109.65-------
42124.05-------
43132.69-------
44135.81-------
45116.07-------
46101.42-------
4775.73-------
4855.48-------
4943.848.141642.60955.01710.10790.018200.0182
5045.2944.873936.503157.12690.47350.568200.0449
5144.0143.281532.821961.01390.46790.412200.0888
5247.4842.470830.346665.96960.3380.448900.1389
5351.0742.048828.540771.68240.27540.359700.1872
5457.8441.826627.139578.01560.19290.308300.2298
5569.0441.708926.000984.92480.10760.232200.2661
5665.6141.646325.043392.42030.17750.14521e-040.2967
5772.8741.61324.2171100.54980.14930.21240.00660.3223
5868.4141.595223.4905109.38930.21910.18290.04190.3441
5973.2541.585822.842119.03980.21150.24860.19380.3626
6077.4341.580722.2565129.62760.21240.24040.37850.3785







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0729-0.0902018.849800
500.13930.00930.04970.17329.51153.0841
510.2090.01680.03880.53086.51792.553
520.28230.11790.058625.09211.16143.3409
530.35960.21450.089881.381525.20555.0205
540.44140.38290.1386256.428263.74267.9839
550.52860.65530.2124746.9893161.349312.7023
560.6220.57540.2578574.2579212.962814.5932
570.72260.75110.3126976.9998297.855817.2585
580.83160.64470.3458719.0309339.973318.4384
590.95030.76140.38361002.6227400.214220.0054
601.08040.86220.42351285.17473.960521.7706

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0729 & -0.0902 & 0 & 18.8498 & 0 & 0 \tabularnewline
50 & 0.1393 & 0.0093 & 0.0497 & 0.1732 & 9.5115 & 3.0841 \tabularnewline
51 & 0.209 & 0.0168 & 0.0388 & 0.5308 & 6.5179 & 2.553 \tabularnewline
52 & 0.2823 & 0.1179 & 0.0586 & 25.092 & 11.1614 & 3.3409 \tabularnewline
53 & 0.3596 & 0.2145 & 0.0898 & 81.3815 & 25.2055 & 5.0205 \tabularnewline
54 & 0.4414 & 0.3829 & 0.1386 & 256.4282 & 63.7426 & 7.9839 \tabularnewline
55 & 0.5286 & 0.6553 & 0.2124 & 746.9893 & 161.3493 & 12.7023 \tabularnewline
56 & 0.622 & 0.5754 & 0.2578 & 574.2579 & 212.9628 & 14.5932 \tabularnewline
57 & 0.7226 & 0.7511 & 0.3126 & 976.9998 & 297.8558 & 17.2585 \tabularnewline
58 & 0.8316 & 0.6447 & 0.3458 & 719.0309 & 339.9733 & 18.4384 \tabularnewline
59 & 0.9503 & 0.7614 & 0.3836 & 1002.6227 & 400.2142 & 20.0054 \tabularnewline
60 & 1.0804 & 0.8622 & 0.4235 & 1285.17 & 473.9605 & 21.7706 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71442&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]49[/C][C]0.0729[/C][C]-0.0902[/C][C]0[/C][C]18.8498[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.1393[/C][C]0.0093[/C][C]0.0497[/C][C]0.1732[/C][C]9.5115[/C][C]3.0841[/C][/ROW]
[ROW][C]51[/C][C]0.209[/C][C]0.0168[/C][C]0.0388[/C][C]0.5308[/C][C]6.5179[/C][C]2.553[/C][/ROW]
[ROW][C]52[/C][C]0.2823[/C][C]0.1179[/C][C]0.0586[/C][C]25.092[/C][C]11.1614[/C][C]3.3409[/C][/ROW]
[ROW][C]53[/C][C]0.3596[/C][C]0.2145[/C][C]0.0898[/C][C]81.3815[/C][C]25.2055[/C][C]5.0205[/C][/ROW]
[ROW][C]54[/C][C]0.4414[/C][C]0.3829[/C][C]0.1386[/C][C]256.4282[/C][C]63.7426[/C][C]7.9839[/C][/ROW]
[ROW][C]55[/C][C]0.5286[/C][C]0.6553[/C][C]0.2124[/C][C]746.9893[/C][C]161.3493[/C][C]12.7023[/C][/ROW]
[ROW][C]56[/C][C]0.622[/C][C]0.5754[/C][C]0.2578[/C][C]574.2579[/C][C]212.9628[/C][C]14.5932[/C][/ROW]
[ROW][C]57[/C][C]0.7226[/C][C]0.7511[/C][C]0.3126[/C][C]976.9998[/C][C]297.8558[/C][C]17.2585[/C][/ROW]
[ROW][C]58[/C][C]0.8316[/C][C]0.6447[/C][C]0.3458[/C][C]719.0309[/C][C]339.9733[/C][C]18.4384[/C][/ROW]
[ROW][C]59[/C][C]0.9503[/C][C]0.7614[/C][C]0.3836[/C][C]1002.6227[/C][C]400.2142[/C][C]20.0054[/C][/ROW]
[ROW][C]60[/C][C]1.0804[/C][C]0.8622[/C][C]0.4235[/C][C]1285.17[/C][C]473.9605[/C][C]21.7706[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71442&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71442&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
490.0729-0.0902018.849800
500.13930.00930.04970.17329.51153.0841
510.2090.01680.03880.53086.51792.553
520.28230.11790.058625.09211.16143.3409
530.35960.21450.089881.381525.20555.0205
540.44140.38290.1386256.428263.74267.9839
550.52860.65530.2124746.9893161.349312.7023
560.6220.57540.2578574.2579212.962814.5932
570.72260.75110.3126976.9998297.855817.2585
580.83160.64470.3458719.0309339.973318.4384
590.95030.76140.38361002.6227400.214220.0054
601.08040.86220.42351285.17473.960521.7706



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