Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationSat, 15 Dec 2007 07:11:55 -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/15/t1197727001yne8vh09kwlrgxo.htm/, Retrieved Thu, 02 May 2024 18:11:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4060, Retrieved Thu, 02 May 2024 18:11:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact208
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [arima forecast ve...] [2007-12-15 14:11:55] [c5caf8a1e3802eaf41184f28719e74c9] [Current]
Feedback Forum

Post a new message
Dataseries X:
101.17
101.93
102.05
102.08
102.14
102.15
95.42
95.43
95.43
95.43
95.43
95.57
95.71
94.58
94.6
94.61
94.62
94.66
94.66
94.69
94.79
94.79
94.79
94.79
94.8
95.46
95.49
95.74
95.74
95.74
95.75
95.83
95.83
95.84
95.81
95.81
95.8
97.06
97.15
97.14
97.48
97.48
97.48
97.5
97.63
97.86
97.87
97.87
97.84
98.72
100.49
100.54
100.54
100.54
100.55
100.59
100.60
100.62
100.68
100.68




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=4060&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=4060&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4060&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])
3695.81-------
3795.8-------
3897.06-------
3997.15-------
4097.14-------
4197.48-------
4297.48-------
4397.48-------
4497.5-------
4597.63-------
4697.86-------
4797.87-------
4897.87-------
4997.8497.8695.4522100.26780.49350.49680.95320.4968
5098.7299.1295.7148102.52520.4090.76940.88210.7641
51100.4999.2195.0395103.38050.27370.59110.83350.7356
52100.5499.294.3844104.01560.29270.29980.79910.7059
53100.5499.5494.156104.9240.35790.35790.77330.7284
54100.5499.5493.6421105.43790.36980.36980.75320.7105
55100.5599.5493.1695105.91050.3780.37920.73690.6963
56100.5999.5692.7497106.37030.38350.38790.72340.6867
57100.699.6992.4665106.91350.40250.40350.71190.6893
58100.6299.9292.3058107.53420.42850.43050.7020.7011
59100.6899.9391.9442107.91580.4270.43280.69340.6934
60100.6899.9391.5891108.27090.43010.43010.68580.6858

\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 & 95.81 & - & - & - & - & - & - & - \tabularnewline
37 & 95.8 & - & - & - & - & - & - & - \tabularnewline
38 & 97.06 & - & - & - & - & - & - & - \tabularnewline
39 & 97.15 & - & - & - & - & - & - & - \tabularnewline
40 & 97.14 & - & - & - & - & - & - & - \tabularnewline
41 & 97.48 & - & - & - & - & - & - & - \tabularnewline
42 & 97.48 & - & - & - & - & - & - & - \tabularnewline
43 & 97.48 & - & - & - & - & - & - & - \tabularnewline
44 & 97.5 & - & - & - & - & - & - & - \tabularnewline
45 & 97.63 & - & - & - & - & - & - & - \tabularnewline
46 & 97.86 & - & - & - & - & - & - & - \tabularnewline
47 & 97.87 & - & - & - & - & - & - & - \tabularnewline
48 & 97.87 & - & - & - & - & - & - & - \tabularnewline
49 & 97.84 & 97.86 & 95.4522 & 100.2678 & 0.4935 & 0.4968 & 0.9532 & 0.4968 \tabularnewline
50 & 98.72 & 99.12 & 95.7148 & 102.5252 & 0.409 & 0.7694 & 0.8821 & 0.7641 \tabularnewline
51 & 100.49 & 99.21 & 95.0395 & 103.3805 & 0.2737 & 0.5911 & 0.8335 & 0.7356 \tabularnewline
52 & 100.54 & 99.2 & 94.3844 & 104.0156 & 0.2927 & 0.2998 & 0.7991 & 0.7059 \tabularnewline
53 & 100.54 & 99.54 & 94.156 & 104.924 & 0.3579 & 0.3579 & 0.7733 & 0.7284 \tabularnewline
54 & 100.54 & 99.54 & 93.6421 & 105.4379 & 0.3698 & 0.3698 & 0.7532 & 0.7105 \tabularnewline
55 & 100.55 & 99.54 & 93.1695 & 105.9105 & 0.378 & 0.3792 & 0.7369 & 0.6963 \tabularnewline
56 & 100.59 & 99.56 & 92.7497 & 106.3703 & 0.3835 & 0.3879 & 0.7234 & 0.6867 \tabularnewline
57 & 100.6 & 99.69 & 92.4665 & 106.9135 & 0.4025 & 0.4035 & 0.7119 & 0.6893 \tabularnewline
58 & 100.62 & 99.92 & 92.3058 & 107.5342 & 0.4285 & 0.4305 & 0.702 & 0.7011 \tabularnewline
59 & 100.68 & 99.93 & 91.9442 & 107.9158 & 0.427 & 0.4328 & 0.6934 & 0.6934 \tabularnewline
60 & 100.68 & 99.93 & 91.5891 & 108.2709 & 0.4301 & 0.4301 & 0.6858 & 0.6858 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4060&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]95.81[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]95.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]97.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]97.15[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]97.14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]97.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]97.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]97.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]97.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]97.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]97.86[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]97.87[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]97.87[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]97.84[/C][C]97.86[/C][C]95.4522[/C][C]100.2678[/C][C]0.4935[/C][C]0.4968[/C][C]0.9532[/C][C]0.4968[/C][/ROW]
[ROW][C]50[/C][C]98.72[/C][C]99.12[/C][C]95.7148[/C][C]102.5252[/C][C]0.409[/C][C]0.7694[/C][C]0.8821[/C][C]0.7641[/C][/ROW]
[ROW][C]51[/C][C]100.49[/C][C]99.21[/C][C]95.0395[/C][C]103.3805[/C][C]0.2737[/C][C]0.5911[/C][C]0.8335[/C][C]0.7356[/C][/ROW]
[ROW][C]52[/C][C]100.54[/C][C]99.2[/C][C]94.3844[/C][C]104.0156[/C][C]0.2927[/C][C]0.2998[/C][C]0.7991[/C][C]0.7059[/C][/ROW]
[ROW][C]53[/C][C]100.54[/C][C]99.54[/C][C]94.156[/C][C]104.924[/C][C]0.3579[/C][C]0.3579[/C][C]0.7733[/C][C]0.7284[/C][/ROW]
[ROW][C]54[/C][C]100.54[/C][C]99.54[/C][C]93.6421[/C][C]105.4379[/C][C]0.3698[/C][C]0.3698[/C][C]0.7532[/C][C]0.7105[/C][/ROW]
[ROW][C]55[/C][C]100.55[/C][C]99.54[/C][C]93.1695[/C][C]105.9105[/C][C]0.378[/C][C]0.3792[/C][C]0.7369[/C][C]0.6963[/C][/ROW]
[ROW][C]56[/C][C]100.59[/C][C]99.56[/C][C]92.7497[/C][C]106.3703[/C][C]0.3835[/C][C]0.3879[/C][C]0.7234[/C][C]0.6867[/C][/ROW]
[ROW][C]57[/C][C]100.6[/C][C]99.69[/C][C]92.4665[/C][C]106.9135[/C][C]0.4025[/C][C]0.4035[/C][C]0.7119[/C][C]0.6893[/C][/ROW]
[ROW][C]58[/C][C]100.62[/C][C]99.92[/C][C]92.3058[/C][C]107.5342[/C][C]0.4285[/C][C]0.4305[/C][C]0.702[/C][C]0.7011[/C][/ROW]
[ROW][C]59[/C][C]100.68[/C][C]99.93[/C][C]91.9442[/C][C]107.9158[/C][C]0.427[/C][C]0.4328[/C][C]0.6934[/C][C]0.6934[/C][/ROW]
[ROW][C]60[/C][C]100.68[/C][C]99.93[/C][C]91.5891[/C][C]108.2709[/C][C]0.4301[/C][C]0.4301[/C][C]0.6858[/C][C]0.6858[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4060&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4060&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])
3695.81-------
3795.8-------
3897.06-------
3997.15-------
4097.14-------
4197.48-------
4297.48-------
4397.48-------
4497.5-------
4597.63-------
4697.86-------
4797.87-------
4897.87-------
4997.8497.8695.4522100.26780.49350.49680.95320.4968
5098.7299.1295.7148102.52520.4090.76940.88210.7641
51100.4999.2195.0395103.38050.27370.59110.83350.7356
52100.5499.294.3844104.01560.29270.29980.79910.7059
53100.5499.5494.156104.9240.35790.35790.77330.7284
54100.5499.5493.6421105.43790.36980.36980.75320.7105
55100.5599.5493.1695105.91050.3780.37920.73690.6963
56100.5999.5692.7497106.37030.38350.38790.72340.6867
57100.699.6992.4665106.91350.40250.40350.71190.6893
58100.6299.9292.3058107.53420.42850.43050.7020.7011
59100.6899.9391.9442107.91580.4270.43280.69340.6934
60100.6899.9391.5891108.27090.43010.43010.68580.6858







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0126-2e-0404e-0400.0058
500.0175-0.0043e-040.160.01330.1155
510.02140.01290.00111.63840.13650.3695
520.02480.01350.00111.79560.14960.3868
530.02760.018e-0410.08330.2887
540.03020.018e-0410.08330.2887
550.03270.01018e-041.02010.0850.2916
560.03490.01039e-041.06090.08840.2973
570.0370.00918e-040.82810.0690.2627
580.03890.0076e-040.490.04080.2021
590.04080.00756e-040.56250.04690.2165
600.04260.00756e-040.56250.04690.2165

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0126 & -2e-04 & 0 & 4e-04 & 0 & 0.0058 \tabularnewline
50 & 0.0175 & -0.004 & 3e-04 & 0.16 & 0.0133 & 0.1155 \tabularnewline
51 & 0.0214 & 0.0129 & 0.0011 & 1.6384 & 0.1365 & 0.3695 \tabularnewline
52 & 0.0248 & 0.0135 & 0.0011 & 1.7956 & 0.1496 & 0.3868 \tabularnewline
53 & 0.0276 & 0.01 & 8e-04 & 1 & 0.0833 & 0.2887 \tabularnewline
54 & 0.0302 & 0.01 & 8e-04 & 1 & 0.0833 & 0.2887 \tabularnewline
55 & 0.0327 & 0.0101 & 8e-04 & 1.0201 & 0.085 & 0.2916 \tabularnewline
56 & 0.0349 & 0.0103 & 9e-04 & 1.0609 & 0.0884 & 0.2973 \tabularnewline
57 & 0.037 & 0.0091 & 8e-04 & 0.8281 & 0.069 & 0.2627 \tabularnewline
58 & 0.0389 & 0.007 & 6e-04 & 0.49 & 0.0408 & 0.2021 \tabularnewline
59 & 0.0408 & 0.0075 & 6e-04 & 0.5625 & 0.0469 & 0.2165 \tabularnewline
60 & 0.0426 & 0.0075 & 6e-04 & 0.5625 & 0.0469 & 0.2165 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4060&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.0126[/C][C]-2e-04[/C][C]0[/C][C]4e-04[/C][C]0[/C][C]0.0058[/C][/ROW]
[ROW][C]50[/C][C]0.0175[/C][C]-0.004[/C][C]3e-04[/C][C]0.16[/C][C]0.0133[/C][C]0.1155[/C][/ROW]
[ROW][C]51[/C][C]0.0214[/C][C]0.0129[/C][C]0.0011[/C][C]1.6384[/C][C]0.1365[/C][C]0.3695[/C][/ROW]
[ROW][C]52[/C][C]0.0248[/C][C]0.0135[/C][C]0.0011[/C][C]1.7956[/C][C]0.1496[/C][C]0.3868[/C][/ROW]
[ROW][C]53[/C][C]0.0276[/C][C]0.01[/C][C]8e-04[/C][C]1[/C][C]0.0833[/C][C]0.2887[/C][/ROW]
[ROW][C]54[/C][C]0.0302[/C][C]0.01[/C][C]8e-04[/C][C]1[/C][C]0.0833[/C][C]0.2887[/C][/ROW]
[ROW][C]55[/C][C]0.0327[/C][C]0.0101[/C][C]8e-04[/C][C]1.0201[/C][C]0.085[/C][C]0.2916[/C][/ROW]
[ROW][C]56[/C][C]0.0349[/C][C]0.0103[/C][C]9e-04[/C][C]1.0609[/C][C]0.0884[/C][C]0.2973[/C][/ROW]
[ROW][C]57[/C][C]0.037[/C][C]0.0091[/C][C]8e-04[/C][C]0.8281[/C][C]0.069[/C][C]0.2627[/C][/ROW]
[ROW][C]58[/C][C]0.0389[/C][C]0.007[/C][C]6e-04[/C][C]0.49[/C][C]0.0408[/C][C]0.2021[/C][/ROW]
[ROW][C]59[/C][C]0.0408[/C][C]0.0075[/C][C]6e-04[/C][C]0.5625[/C][C]0.0469[/C][C]0.2165[/C][/ROW]
[ROW][C]60[/C][C]0.0426[/C][C]0.0075[/C][C]6e-04[/C][C]0.5625[/C][C]0.0469[/C][C]0.2165[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4060&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4060&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.0126-2e-0404e-0400.0058
500.0175-0.0043e-040.160.01330.1155
510.02140.01290.00111.63840.13650.3695
520.02480.01350.00111.79560.14960.3868
530.02760.018e-0410.08330.2887
540.03020.018e-0410.08330.2887
550.03270.01018e-041.02010.0850.2916
560.03490.01039e-041.06090.08840.2973
570.0370.00918e-040.82810.0690.2627
580.03890.0076e-040.490.04080.2021
590.04080.00756e-040.56250.04690.2165
600.04260.00756e-040.56250.04690.2165



Parameters (Session):
par1 = Default ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 0 ; 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,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)
}
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.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')