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, 31 Dec 2009 05:19:09 -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/t1262262043oszq3j0ga2h0hl1.htm/, Retrieved Thu, 02 May 2024 03:42:51 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71453, Retrieved Thu, 02 May 2024 03:42:51 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact133
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2009-12-31 12:19:09] [abbb6febea381ea822009ab8520873eb] [Current]
Feedback Forum

Post a new message
Dataseries X:
100.44
100.51
101.00
100.88
100.55
100.83
101.51
102.16
102.39
102.54
102.85
103.47
103.57
103.69
103.50
103.47
103.45
103.48
103.93
103.89
104.40
104.79
104.77
105.13
105.26
104.96
104.75
105.01
105.15
105.20
105.77
105.78
106.26
106.13
106.12
106.57
106.44
106.54
107.10
108.10
108.40
108.84
109.62
110.42
110.67
111.66
112.28
112.87
112.18
112.36
112.16
111.49
111.25
111.36
111.74
111.10
111.33
111.25
111.04
110.97
111.31
111.02
111.07
111.36




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71453&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 time1 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[52])
40108.1-------
41108.4-------
42108.84-------
43109.62-------
44110.42-------
45110.67-------
46111.66-------
47112.28-------
48112.87-------
49112.18-------
50112.36-------
51112.16-------
52111.49-------
53111.25111.2943110.5808112.00780.45150.295510.2955
54111.36111.1063109.9283112.28430.33650.40550.99990.2616
55111.74110.8769109.268112.48590.14650.27810.93710.2276
56111.1110.739108.6521112.82590.36730.17360.61780.2403
57111.33110.6263108.0732113.17930.29450.3580.48660.2536
58111.25110.5238107.5221113.52540.31770.29930.22910.264
59111.04110.4476107.0074113.88780.36790.32380.14820.2763
60110.97110.3864106.5234114.24940.38360.37010.10380.2878
61111.31110.3354106.0663114.60450.32730.38540.19850.298
62111.02110.2952105.6353114.95510.38020.33480.19260.3076
63111.07110.2629105.2276115.29830.37670.38410.23010.3165
64111.36110.2367104.8406115.63280.34160.38110.32450.3245

\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[52]) \tabularnewline
40 & 108.1 & - & - & - & - & - & - & - \tabularnewline
41 & 108.4 & - & - & - & - & - & - & - \tabularnewline
42 & 108.84 & - & - & - & - & - & - & - \tabularnewline
43 & 109.62 & - & - & - & - & - & - & - \tabularnewline
44 & 110.42 & - & - & - & - & - & - & - \tabularnewline
45 & 110.67 & - & - & - & - & - & - & - \tabularnewline
46 & 111.66 & - & - & - & - & - & - & - \tabularnewline
47 & 112.28 & - & - & - & - & - & - & - \tabularnewline
48 & 112.87 & - & - & - & - & - & - & - \tabularnewline
49 & 112.18 & - & - & - & - & - & - & - \tabularnewline
50 & 112.36 & - & - & - & - & - & - & - \tabularnewline
51 & 112.16 & - & - & - & - & - & - & - \tabularnewline
52 & 111.49 & - & - & - & - & - & - & - \tabularnewline
53 & 111.25 & 111.2943 & 110.5808 & 112.0078 & 0.4515 & 0.2955 & 1 & 0.2955 \tabularnewline
54 & 111.36 & 111.1063 & 109.9283 & 112.2843 & 0.3365 & 0.4055 & 0.9999 & 0.2616 \tabularnewline
55 & 111.74 & 110.8769 & 109.268 & 112.4859 & 0.1465 & 0.2781 & 0.9371 & 0.2276 \tabularnewline
56 & 111.1 & 110.739 & 108.6521 & 112.8259 & 0.3673 & 0.1736 & 0.6178 & 0.2403 \tabularnewline
57 & 111.33 & 110.6263 & 108.0732 & 113.1793 & 0.2945 & 0.358 & 0.4866 & 0.2536 \tabularnewline
58 & 111.25 & 110.5238 & 107.5221 & 113.5254 & 0.3177 & 0.2993 & 0.2291 & 0.264 \tabularnewline
59 & 111.04 & 110.4476 & 107.0074 & 113.8878 & 0.3679 & 0.3238 & 0.1482 & 0.2763 \tabularnewline
60 & 110.97 & 110.3864 & 106.5234 & 114.2494 & 0.3836 & 0.3701 & 0.1038 & 0.2878 \tabularnewline
61 & 111.31 & 110.3354 & 106.0663 & 114.6045 & 0.3273 & 0.3854 & 0.1985 & 0.298 \tabularnewline
62 & 111.02 & 110.2952 & 105.6353 & 114.9551 & 0.3802 & 0.3348 & 0.1926 & 0.3076 \tabularnewline
63 & 111.07 & 110.2629 & 105.2276 & 115.2983 & 0.3767 & 0.3841 & 0.2301 & 0.3165 \tabularnewline
64 & 111.36 & 110.2367 & 104.8406 & 115.6328 & 0.3416 & 0.3811 & 0.3245 & 0.3245 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71453&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[52])[/C][/ROW]
[ROW][C]40[/C][C]108.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]108.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]108.84[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]109.62[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]110.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]110.67[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]111.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]112.28[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]112.87[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]112.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]112.36[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]112.16[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]111.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]111.25[/C][C]111.2943[/C][C]110.5808[/C][C]112.0078[/C][C]0.4515[/C][C]0.2955[/C][C]1[/C][C]0.2955[/C][/ROW]
[ROW][C]54[/C][C]111.36[/C][C]111.1063[/C][C]109.9283[/C][C]112.2843[/C][C]0.3365[/C][C]0.4055[/C][C]0.9999[/C][C]0.2616[/C][/ROW]
[ROW][C]55[/C][C]111.74[/C][C]110.8769[/C][C]109.268[/C][C]112.4859[/C][C]0.1465[/C][C]0.2781[/C][C]0.9371[/C][C]0.2276[/C][/ROW]
[ROW][C]56[/C][C]111.1[/C][C]110.739[/C][C]108.6521[/C][C]112.8259[/C][C]0.3673[/C][C]0.1736[/C][C]0.6178[/C][C]0.2403[/C][/ROW]
[ROW][C]57[/C][C]111.33[/C][C]110.6263[/C][C]108.0732[/C][C]113.1793[/C][C]0.2945[/C][C]0.358[/C][C]0.4866[/C][C]0.2536[/C][/ROW]
[ROW][C]58[/C][C]111.25[/C][C]110.5238[/C][C]107.5221[/C][C]113.5254[/C][C]0.3177[/C][C]0.2993[/C][C]0.2291[/C][C]0.264[/C][/ROW]
[ROW][C]59[/C][C]111.04[/C][C]110.4476[/C][C]107.0074[/C][C]113.8878[/C][C]0.3679[/C][C]0.3238[/C][C]0.1482[/C][C]0.2763[/C][/ROW]
[ROW][C]60[/C][C]110.97[/C][C]110.3864[/C][C]106.5234[/C][C]114.2494[/C][C]0.3836[/C][C]0.3701[/C][C]0.1038[/C][C]0.2878[/C][/ROW]
[ROW][C]61[/C][C]111.31[/C][C]110.3354[/C][C]106.0663[/C][C]114.6045[/C][C]0.3273[/C][C]0.3854[/C][C]0.1985[/C][C]0.298[/C][/ROW]
[ROW][C]62[/C][C]111.02[/C][C]110.2952[/C][C]105.6353[/C][C]114.9551[/C][C]0.3802[/C][C]0.3348[/C][C]0.1926[/C][C]0.3076[/C][/ROW]
[ROW][C]63[/C][C]111.07[/C][C]110.2629[/C][C]105.2276[/C][C]115.2983[/C][C]0.3767[/C][C]0.3841[/C][C]0.2301[/C][C]0.3165[/C][/ROW]
[ROW][C]64[/C][C]111.36[/C][C]110.2367[/C][C]104.8406[/C][C]115.6328[/C][C]0.3416[/C][C]0.3811[/C][C]0.3245[/C][C]0.3245[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71453&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71453&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[52])
40108.1-------
41108.4-------
42108.84-------
43109.62-------
44110.42-------
45110.67-------
46111.66-------
47112.28-------
48112.87-------
49112.18-------
50112.36-------
51112.16-------
52111.49-------
53111.25111.2943110.5808112.00780.45150.295510.2955
54111.36111.1063109.9283112.28430.33650.40550.99990.2616
55111.74110.8769109.268112.48590.14650.27810.93710.2276
56111.1110.739108.6521112.82590.36730.17360.61780.2403
57111.33110.6263108.0732113.17930.29450.3580.48660.2536
58111.25110.5238107.5221113.52540.31770.29930.22910.264
59111.04110.4476107.0074113.88780.36790.32380.14820.2763
60110.97110.3864106.5234114.24940.38360.37010.10380.2878
61111.31110.3354106.0663114.60450.32730.38540.19850.298
62111.02110.2952105.6353114.95510.38020.33480.19260.3076
63111.07110.2629105.2276115.29830.37670.38410.23010.3165
64111.36110.2367104.8406115.63280.34160.38110.32450.3245







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
530.0033-4e-0400.00200
540.00540.00230.00130.06440.03320.1821
550.00740.00780.00350.74490.27040.52
560.00960.00330.00340.13030.23540.4852
570.01180.00640.0040.49520.28740.5361
580.01390.00660.00440.52740.32740.5722
590.01590.00540.00460.3510.33070.5751
600.01790.00530.00470.34060.3320.5762
610.01970.00880.00510.94980.40060.6329
620.02160.00660.00530.52530.41310.6427
630.02330.00730.00550.65140.43470.6594
640.0250.01020.00591.26180.50370.7097

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
53 & 0.0033 & -4e-04 & 0 & 0.002 & 0 & 0 \tabularnewline
54 & 0.0054 & 0.0023 & 0.0013 & 0.0644 & 0.0332 & 0.1821 \tabularnewline
55 & 0.0074 & 0.0078 & 0.0035 & 0.7449 & 0.2704 & 0.52 \tabularnewline
56 & 0.0096 & 0.0033 & 0.0034 & 0.1303 & 0.2354 & 0.4852 \tabularnewline
57 & 0.0118 & 0.0064 & 0.004 & 0.4952 & 0.2874 & 0.5361 \tabularnewline
58 & 0.0139 & 0.0066 & 0.0044 & 0.5274 & 0.3274 & 0.5722 \tabularnewline
59 & 0.0159 & 0.0054 & 0.0046 & 0.351 & 0.3307 & 0.5751 \tabularnewline
60 & 0.0179 & 0.0053 & 0.0047 & 0.3406 & 0.332 & 0.5762 \tabularnewline
61 & 0.0197 & 0.0088 & 0.0051 & 0.9498 & 0.4006 & 0.6329 \tabularnewline
62 & 0.0216 & 0.0066 & 0.0053 & 0.5253 & 0.4131 & 0.6427 \tabularnewline
63 & 0.0233 & 0.0073 & 0.0055 & 0.6514 & 0.4347 & 0.6594 \tabularnewline
64 & 0.025 & 0.0102 & 0.0059 & 1.2618 & 0.5037 & 0.7097 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71453&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]53[/C][C]0.0033[/C][C]-4e-04[/C][C]0[/C][C]0.002[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]54[/C][C]0.0054[/C][C]0.0023[/C][C]0.0013[/C][C]0.0644[/C][C]0.0332[/C][C]0.1821[/C][/ROW]
[ROW][C]55[/C][C]0.0074[/C][C]0.0078[/C][C]0.0035[/C][C]0.7449[/C][C]0.2704[/C][C]0.52[/C][/ROW]
[ROW][C]56[/C][C]0.0096[/C][C]0.0033[/C][C]0.0034[/C][C]0.1303[/C][C]0.2354[/C][C]0.4852[/C][/ROW]
[ROW][C]57[/C][C]0.0118[/C][C]0.0064[/C][C]0.004[/C][C]0.4952[/C][C]0.2874[/C][C]0.5361[/C][/ROW]
[ROW][C]58[/C][C]0.0139[/C][C]0.0066[/C][C]0.0044[/C][C]0.5274[/C][C]0.3274[/C][C]0.5722[/C][/ROW]
[ROW][C]59[/C][C]0.0159[/C][C]0.0054[/C][C]0.0046[/C][C]0.351[/C][C]0.3307[/C][C]0.5751[/C][/ROW]
[ROW][C]60[/C][C]0.0179[/C][C]0.0053[/C][C]0.0047[/C][C]0.3406[/C][C]0.332[/C][C]0.5762[/C][/ROW]
[ROW][C]61[/C][C]0.0197[/C][C]0.0088[/C][C]0.0051[/C][C]0.9498[/C][C]0.4006[/C][C]0.6329[/C][/ROW]
[ROW][C]62[/C][C]0.0216[/C][C]0.0066[/C][C]0.0053[/C][C]0.5253[/C][C]0.4131[/C][C]0.6427[/C][/ROW]
[ROW][C]63[/C][C]0.0233[/C][C]0.0073[/C][C]0.0055[/C][C]0.6514[/C][C]0.4347[/C][C]0.6594[/C][/ROW]
[ROW][C]64[/C][C]0.025[/C][C]0.0102[/C][C]0.0059[/C][C]1.2618[/C][C]0.5037[/C][C]0.7097[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71453&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71453&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
530.0033-4e-0400.00200
540.00540.00230.00130.06440.03320.1821
550.00740.00780.00350.74490.27040.52
560.00960.00330.00340.13030.23540.4852
570.01180.00640.0040.49520.28740.5361
580.01390.00660.00440.52740.32740.5722
590.01590.00540.00460.3510.33070.5751
600.01790.00530.00470.34060.3320.5762
610.01970.00880.00510.94980.40060.6329
620.02160.00660.00530.52530.41310.6427
630.02330.00730.00550.65140.43470.6594
640.0250.01020.00591.26180.50370.7097



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