Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 12 Dec 2007 08:51:26 -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/2007/Dec/12/t1197473787yvm1sxt0zyfgfb4.htm/, Retrieved Fri, 03 May 2024 01:26:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3227, Retrieved Fri, 03 May 2024 01:26:08 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact212
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [werkloosheidsgraa...] [2007-12-12 15:51:26] [dd38921fafddee0dfc20da83e9650a2a] [Current]
Feedback Forum

Post a new message
Dataseries X:
8
8.1
8.3
8.2
8.1
7.7
7.6
7.7
8.2
8.4
8.4
8.6
8.4
8.5
8.7
8.7
8.6
7.4
7.3
7.4
9
9.2
9.2
8.5
8.3
8.3
8.6
8.6
8.5
8.1
8.1
8
8.6
8.7
8.7
8.6
8.4
8.4
8.7
8.7
8.5
8.3
8.3
8.3
8.1
8.2
8.1
8.1
7.9
7.7
8.1
8
7.7
7.8
7.6
7.4
7.7
7.8
7.5
7.2




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & 'Herman Ole Andreas Wold' @ 193.190.124.10:1001 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3227&T=0

[TABLE]
[ROW][C]Summary of compuational 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]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Herman Ole Andreas Wold' @ 193.190.124.10:1001[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3227&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3227&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Herman Ole Andreas Wold' @ 193.190.124.10:1001







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])
368.6-------
378.4-------
388.4-------
398.7-------
408.7-------
418.5-------
428.3-------
438.3-------
448.3-------
458.1-------
468.2-------
478.1-------
488.1-------
497.97.97727.52038.43410.37030.29910.03480.2991
507.78.03987.36678.71280.16120.6580.14710.4304
518.18.19637.36079.03190.41070.87780.11870.5893
5288.23857.37459.10240.29430.62330.14750.6233
537.78.13137.25019.01260.16870.61490.20610.5278
547.87.98397.08628.88160.34410.73230.2450.3999
557.67.95166.99258.91060.23620.62160.23820.3808
567.47.99466.96359.02560.12920.77340.28080.4206
577.77.93736.83759.03720.33620.83080.38590.3859
587.87.99136.85579.12690.37060.69240.35930.4256
597.57.93696.77419.09960.23070.59120.39160.3916
607.27.86956.68139.05760.13470.72890.35190.3519

\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 & 8.6 & - & - & - & - & - & - & - \tabularnewline
37 & 8.4 & - & - & - & - & - & - & - \tabularnewline
38 & 8.4 & - & - & - & - & - & - & - \tabularnewline
39 & 8.7 & - & - & - & - & - & - & - \tabularnewline
40 & 8.7 & - & - & - & - & - & - & - \tabularnewline
41 & 8.5 & - & - & - & - & - & - & - \tabularnewline
42 & 8.3 & - & - & - & - & - & - & - \tabularnewline
43 & 8.3 & - & - & - & - & - & - & - \tabularnewline
44 & 8.3 & - & - & - & - & - & - & - \tabularnewline
45 & 8.1 & - & - & - & - & - & - & - \tabularnewline
46 & 8.2 & - & - & - & - & - & - & - \tabularnewline
47 & 8.1 & - & - & - & - & - & - & - \tabularnewline
48 & 8.1 & - & - & - & - & - & - & - \tabularnewline
49 & 7.9 & 7.9772 & 7.5203 & 8.4341 & 0.3703 & 0.2991 & 0.0348 & 0.2991 \tabularnewline
50 & 7.7 & 8.0398 & 7.3667 & 8.7128 & 0.1612 & 0.658 & 0.1471 & 0.4304 \tabularnewline
51 & 8.1 & 8.1963 & 7.3607 & 9.0319 & 0.4107 & 0.8778 & 0.1187 & 0.5893 \tabularnewline
52 & 8 & 8.2385 & 7.3745 & 9.1024 & 0.2943 & 0.6233 & 0.1475 & 0.6233 \tabularnewline
53 & 7.7 & 8.1313 & 7.2501 & 9.0126 & 0.1687 & 0.6149 & 0.2061 & 0.5278 \tabularnewline
54 & 7.8 & 7.9839 & 7.0862 & 8.8816 & 0.3441 & 0.7323 & 0.245 & 0.3999 \tabularnewline
55 & 7.6 & 7.9516 & 6.9925 & 8.9106 & 0.2362 & 0.6216 & 0.2382 & 0.3808 \tabularnewline
56 & 7.4 & 7.9946 & 6.9635 & 9.0256 & 0.1292 & 0.7734 & 0.2808 & 0.4206 \tabularnewline
57 & 7.7 & 7.9373 & 6.8375 & 9.0372 & 0.3362 & 0.8308 & 0.3859 & 0.3859 \tabularnewline
58 & 7.8 & 7.9913 & 6.8557 & 9.1269 & 0.3706 & 0.6924 & 0.3593 & 0.4256 \tabularnewline
59 & 7.5 & 7.9369 & 6.7741 & 9.0996 & 0.2307 & 0.5912 & 0.3916 & 0.3916 \tabularnewline
60 & 7.2 & 7.8695 & 6.6813 & 9.0576 & 0.1347 & 0.7289 & 0.3519 & 0.3519 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3227&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]8.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]8.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]7.9[/C][C]7.9772[/C][C]7.5203[/C][C]8.4341[/C][C]0.3703[/C][C]0.2991[/C][C]0.0348[/C][C]0.2991[/C][/ROW]
[ROW][C]50[/C][C]7.7[/C][C]8.0398[/C][C]7.3667[/C][C]8.7128[/C][C]0.1612[/C][C]0.658[/C][C]0.1471[/C][C]0.4304[/C][/ROW]
[ROW][C]51[/C][C]8.1[/C][C]8.1963[/C][C]7.3607[/C][C]9.0319[/C][C]0.4107[/C][C]0.8778[/C][C]0.1187[/C][C]0.5893[/C][/ROW]
[ROW][C]52[/C][C]8[/C][C]8.2385[/C][C]7.3745[/C][C]9.1024[/C][C]0.2943[/C][C]0.6233[/C][C]0.1475[/C][C]0.6233[/C][/ROW]
[ROW][C]53[/C][C]7.7[/C][C]8.1313[/C][C]7.2501[/C][C]9.0126[/C][C]0.1687[/C][C]0.6149[/C][C]0.2061[/C][C]0.5278[/C][/ROW]
[ROW][C]54[/C][C]7.8[/C][C]7.9839[/C][C]7.0862[/C][C]8.8816[/C][C]0.3441[/C][C]0.7323[/C][C]0.245[/C][C]0.3999[/C][/ROW]
[ROW][C]55[/C][C]7.6[/C][C]7.9516[/C][C]6.9925[/C][C]8.9106[/C][C]0.2362[/C][C]0.6216[/C][C]0.2382[/C][C]0.3808[/C][/ROW]
[ROW][C]56[/C][C]7.4[/C][C]7.9946[/C][C]6.9635[/C][C]9.0256[/C][C]0.1292[/C][C]0.7734[/C][C]0.2808[/C][C]0.4206[/C][/ROW]
[ROW][C]57[/C][C]7.7[/C][C]7.9373[/C][C]6.8375[/C][C]9.0372[/C][C]0.3362[/C][C]0.8308[/C][C]0.3859[/C][C]0.3859[/C][/ROW]
[ROW][C]58[/C][C]7.8[/C][C]7.9913[/C][C]6.8557[/C][C]9.1269[/C][C]0.3706[/C][C]0.6924[/C][C]0.3593[/C][C]0.4256[/C][/ROW]
[ROW][C]59[/C][C]7.5[/C][C]7.9369[/C][C]6.7741[/C][C]9.0996[/C][C]0.2307[/C][C]0.5912[/C][C]0.3916[/C][C]0.3916[/C][/ROW]
[ROW][C]60[/C][C]7.2[/C][C]7.8695[/C][C]6.6813[/C][C]9.0576[/C][C]0.1347[/C][C]0.7289[/C][C]0.3519[/C][C]0.3519[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3227&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3227&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])
368.6-------
378.4-------
388.4-------
398.7-------
408.7-------
418.5-------
428.3-------
438.3-------
448.3-------
458.1-------
468.2-------
478.1-------
488.1-------
497.97.97727.52038.43410.37030.29910.03480.2991
507.78.03987.36678.71280.16120.6580.14710.4304
518.18.19637.36079.03190.41070.87780.11870.5893
5288.23857.37459.10240.29430.62330.14750.6233
537.78.13137.25019.01260.16870.61490.20610.5278
547.87.98397.08628.88160.34410.73230.2450.3999
557.67.95166.99258.91060.23620.62160.23820.3808
567.47.99466.96359.02560.12920.77340.28080.4206
577.77.93736.83759.03720.33620.83080.38590.3859
587.87.99136.85579.12690.37060.69240.35930.4256
597.57.93696.77419.09960.23070.59120.39160.3916
607.27.86956.68139.05760.13470.72890.35190.3519







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0292-0.00978e-040.0065e-040.0223
500.0427-0.04230.00350.11550.00960.0981
510.052-0.01170.0010.00938e-040.0278
520.0535-0.02890.00240.05690.00470.0688
530.0553-0.0530.00440.1860.01550.1245
540.0574-0.0230.00190.03380.00280.0531
550.0615-0.04420.00370.12360.01030.1015
560.0658-0.07440.00620.35350.02950.1716
570.0707-0.02990.00250.05630.00470.0685
580.0725-0.02390.0020.03660.0030.0552
590.0747-0.0550.00460.19080.01590.1261
600.077-0.08510.00710.44820.03730.1933

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0292 & -0.0097 & 8e-04 & 0.006 & 5e-04 & 0.0223 \tabularnewline
50 & 0.0427 & -0.0423 & 0.0035 & 0.1155 & 0.0096 & 0.0981 \tabularnewline
51 & 0.052 & -0.0117 & 0.001 & 0.0093 & 8e-04 & 0.0278 \tabularnewline
52 & 0.0535 & -0.0289 & 0.0024 & 0.0569 & 0.0047 & 0.0688 \tabularnewline
53 & 0.0553 & -0.053 & 0.0044 & 0.186 & 0.0155 & 0.1245 \tabularnewline
54 & 0.0574 & -0.023 & 0.0019 & 0.0338 & 0.0028 & 0.0531 \tabularnewline
55 & 0.0615 & -0.0442 & 0.0037 & 0.1236 & 0.0103 & 0.1015 \tabularnewline
56 & 0.0658 & -0.0744 & 0.0062 & 0.3535 & 0.0295 & 0.1716 \tabularnewline
57 & 0.0707 & -0.0299 & 0.0025 & 0.0563 & 0.0047 & 0.0685 \tabularnewline
58 & 0.0725 & -0.0239 & 0.002 & 0.0366 & 0.003 & 0.0552 \tabularnewline
59 & 0.0747 & -0.055 & 0.0046 & 0.1908 & 0.0159 & 0.1261 \tabularnewline
60 & 0.077 & -0.0851 & 0.0071 & 0.4482 & 0.0373 & 0.1933 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3227&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.0292[/C][C]-0.0097[/C][C]8e-04[/C][C]0.006[/C][C]5e-04[/C][C]0.0223[/C][/ROW]
[ROW][C]50[/C][C]0.0427[/C][C]-0.0423[/C][C]0.0035[/C][C]0.1155[/C][C]0.0096[/C][C]0.0981[/C][/ROW]
[ROW][C]51[/C][C]0.052[/C][C]-0.0117[/C][C]0.001[/C][C]0.0093[/C][C]8e-04[/C][C]0.0278[/C][/ROW]
[ROW][C]52[/C][C]0.0535[/C][C]-0.0289[/C][C]0.0024[/C][C]0.0569[/C][C]0.0047[/C][C]0.0688[/C][/ROW]
[ROW][C]53[/C][C]0.0553[/C][C]-0.053[/C][C]0.0044[/C][C]0.186[/C][C]0.0155[/C][C]0.1245[/C][/ROW]
[ROW][C]54[/C][C]0.0574[/C][C]-0.023[/C][C]0.0019[/C][C]0.0338[/C][C]0.0028[/C][C]0.0531[/C][/ROW]
[ROW][C]55[/C][C]0.0615[/C][C]-0.0442[/C][C]0.0037[/C][C]0.1236[/C][C]0.0103[/C][C]0.1015[/C][/ROW]
[ROW][C]56[/C][C]0.0658[/C][C]-0.0744[/C][C]0.0062[/C][C]0.3535[/C][C]0.0295[/C][C]0.1716[/C][/ROW]
[ROW][C]57[/C][C]0.0707[/C][C]-0.0299[/C][C]0.0025[/C][C]0.0563[/C][C]0.0047[/C][C]0.0685[/C][/ROW]
[ROW][C]58[/C][C]0.0725[/C][C]-0.0239[/C][C]0.002[/C][C]0.0366[/C][C]0.003[/C][C]0.0552[/C][/ROW]
[ROW][C]59[/C][C]0.0747[/C][C]-0.055[/C][C]0.0046[/C][C]0.1908[/C][C]0.0159[/C][C]0.1261[/C][/ROW]
[ROW][C]60[/C][C]0.077[/C][C]-0.0851[/C][C]0.0071[/C][C]0.4482[/C][C]0.0373[/C][C]0.1933[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3227&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3227&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.0292-0.00978e-040.0065e-040.0223
500.0427-0.04230.00350.11550.00960.0981
510.052-0.01170.0010.00938e-040.0278
520.0535-0.02890.00240.05690.00470.0688
530.0553-0.0530.00440.1860.01550.1245
540.0574-0.0230.00190.03380.00280.0531
550.0615-0.04420.00370.12360.01030.1015
560.0658-0.07440.00620.35350.02950.1716
570.0707-0.02990.00250.05630.00470.0685
580.0725-0.02390.0020.03660.0030.0552
590.0747-0.0550.00460.19080.01590.1261
600.077-0.08510.00710.44820.03730.1933



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = TRUE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = TRUE ;
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,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)
}
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')