Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 06 Dec 2007 06:19:48 -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/06/t11969464388xlq5qzdnog0ric.htm/, Retrieved Fri, 03 May 2024 06:15:58 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2593, Retrieved Fri, 03 May 2024 06:15:58 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact192
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting Q1] [2007-12-06 13:19:48] [9fe578921d87f9af8e79a90d6142ba02] [Current]
Feedback Forum

Post a new message
Dataseries X:
8,1
8,2
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,9
7,6




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time4 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 & 4 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=2593&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]4 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=2593&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2593&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 time4 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[49])
378.7-------
388.6-------
398.4-------
408.4-------
418.7-------
428.7-------
438.5-------
448.3-------
458.3-------
468.3-------
478.1-------
488.2-------
498.1-------
508.18.72458.23639.24180.0090.9910.68150.991
517.98.56297.88869.29480.03790.89240.66870.8924
527.78.67957.84739.59980.01850.95150.72410.8914
538.18.39027.57769.28990.26360.93370.24990.7364
5488.32897.51589.22990.23720.69070.20970.6907
557.78.1377.33699.02440.16720.61890.21140.5326
567.88.05747.19749.02010.30010.76660.31070.4654
577.68.0457.12089.08910.20180.67720.31610.4589
587.48.11557.12119.24860.1080.81370.37480.5107
597.78.26647.23579.44390.17290.92540.60910.6091
607.98.37817.31759.59240.22020.86310.61310.6732
617.68.29817.23269.52060.13150.73840.62460.6246

\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[49]) \tabularnewline
37 & 8.7 & - & - & - & - & - & - & - \tabularnewline
38 & 8.6 & - & - & - & - & - & - & - \tabularnewline
39 & 8.4 & - & - & - & - & - & - & - \tabularnewline
40 & 8.4 & - & - & - & - & - & - & - \tabularnewline
41 & 8.7 & - & - & - & - & - & - & - \tabularnewline
42 & 8.7 & - & - & - & - & - & - & - \tabularnewline
43 & 8.5 & - & - & - & - & - & - & - \tabularnewline
44 & 8.3 & - & - & - & - & - & - & - \tabularnewline
45 & 8.3 & - & - & - & - & - & - & - \tabularnewline
46 & 8.3 & - & - & - & - & - & - & - \tabularnewline
47 & 8.1 & - & - & - & - & - & - & - \tabularnewline
48 & 8.2 & - & - & - & - & - & - & - \tabularnewline
49 & 8.1 & - & - & - & - & - & - & - \tabularnewline
50 & 8.1 & 8.7245 & 8.2363 & 9.2418 & 0.009 & 0.991 & 0.6815 & 0.991 \tabularnewline
51 & 7.9 & 8.5629 & 7.8886 & 9.2948 & 0.0379 & 0.8924 & 0.6687 & 0.8924 \tabularnewline
52 & 7.7 & 8.6795 & 7.8473 & 9.5998 & 0.0185 & 0.9515 & 0.7241 & 0.8914 \tabularnewline
53 & 8.1 & 8.3902 & 7.5776 & 9.2899 & 0.2636 & 0.9337 & 0.2499 & 0.7364 \tabularnewline
54 & 8 & 8.3289 & 7.5158 & 9.2299 & 0.2372 & 0.6907 & 0.2097 & 0.6907 \tabularnewline
55 & 7.7 & 8.137 & 7.3369 & 9.0244 & 0.1672 & 0.6189 & 0.2114 & 0.5326 \tabularnewline
56 & 7.8 & 8.0574 & 7.1974 & 9.0201 & 0.3001 & 0.7666 & 0.3107 & 0.4654 \tabularnewline
57 & 7.6 & 8.045 & 7.1208 & 9.0891 & 0.2018 & 0.6772 & 0.3161 & 0.4589 \tabularnewline
58 & 7.4 & 8.1155 & 7.1211 & 9.2486 & 0.108 & 0.8137 & 0.3748 & 0.5107 \tabularnewline
59 & 7.7 & 8.2664 & 7.2357 & 9.4439 & 0.1729 & 0.9254 & 0.6091 & 0.6091 \tabularnewline
60 & 7.9 & 8.3781 & 7.3175 & 9.5924 & 0.2202 & 0.8631 & 0.6131 & 0.6732 \tabularnewline
61 & 7.6 & 8.2981 & 7.2326 & 9.5206 & 0.1315 & 0.7384 & 0.6246 & 0.6246 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2593&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[49])[/C][/ROW]
[ROW][C]37[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]8.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]8.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]8.5[/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.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]8.3[/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.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]8.1[/C][C]8.7245[/C][C]8.2363[/C][C]9.2418[/C][C]0.009[/C][C]0.991[/C][C]0.6815[/C][C]0.991[/C][/ROW]
[ROW][C]51[/C][C]7.9[/C][C]8.5629[/C][C]7.8886[/C][C]9.2948[/C][C]0.0379[/C][C]0.8924[/C][C]0.6687[/C][C]0.8924[/C][/ROW]
[ROW][C]52[/C][C]7.7[/C][C]8.6795[/C][C]7.8473[/C][C]9.5998[/C][C]0.0185[/C][C]0.9515[/C][C]0.7241[/C][C]0.8914[/C][/ROW]
[ROW][C]53[/C][C]8.1[/C][C]8.3902[/C][C]7.5776[/C][C]9.2899[/C][C]0.2636[/C][C]0.9337[/C][C]0.2499[/C][C]0.7364[/C][/ROW]
[ROW][C]54[/C][C]8[/C][C]8.3289[/C][C]7.5158[/C][C]9.2299[/C][C]0.2372[/C][C]0.6907[/C][C]0.2097[/C][C]0.6907[/C][/ROW]
[ROW][C]55[/C][C]7.7[/C][C]8.137[/C][C]7.3369[/C][C]9.0244[/C][C]0.1672[/C][C]0.6189[/C][C]0.2114[/C][C]0.5326[/C][/ROW]
[ROW][C]56[/C][C]7.8[/C][C]8.0574[/C][C]7.1974[/C][C]9.0201[/C][C]0.3001[/C][C]0.7666[/C][C]0.3107[/C][C]0.4654[/C][/ROW]
[ROW][C]57[/C][C]7.6[/C][C]8.045[/C][C]7.1208[/C][C]9.0891[/C][C]0.2018[/C][C]0.6772[/C][C]0.3161[/C][C]0.4589[/C][/ROW]
[ROW][C]58[/C][C]7.4[/C][C]8.1155[/C][C]7.1211[/C][C]9.2486[/C][C]0.108[/C][C]0.8137[/C][C]0.3748[/C][C]0.5107[/C][/ROW]
[ROW][C]59[/C][C]7.7[/C][C]8.2664[/C][C]7.2357[/C][C]9.4439[/C][C]0.1729[/C][C]0.9254[/C][C]0.6091[/C][C]0.6091[/C][/ROW]
[ROW][C]60[/C][C]7.9[/C][C]8.3781[/C][C]7.3175[/C][C]9.5924[/C][C]0.2202[/C][C]0.8631[/C][C]0.6131[/C][C]0.6732[/C][/ROW]
[ROW][C]61[/C][C]7.6[/C][C]8.2981[/C][C]7.2326[/C][C]9.5206[/C][C]0.1315[/C][C]0.7384[/C][C]0.6246[/C][C]0.6246[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2593&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2593&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[49])
378.7-------
388.6-------
398.4-------
408.4-------
418.7-------
428.7-------
438.5-------
448.3-------
458.3-------
468.3-------
478.1-------
488.2-------
498.1-------
508.18.72458.23639.24180.0090.9910.68150.991
517.98.56297.88869.29480.03790.89240.66870.8924
527.78.67957.84739.59980.01850.95150.72410.8914
538.18.39027.57769.28990.26360.93370.24990.7364
5488.32897.51589.22990.23720.69070.20970.6907
557.78.1377.33699.02440.16720.61890.21140.5326
567.88.05747.19749.02010.30010.76660.31070.4654
577.68.0457.12089.08910.20180.67720.31610.4589
587.48.11557.12119.24860.1080.81370.37480.5107
597.78.26647.23579.44390.17290.92540.60910.6091
607.98.37817.31759.59240.22020.86310.61310.6732
617.68.29817.23269.52060.13150.73840.62460.6246







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0302-0.07160.0060.390.03250.1803
510.0436-0.07740.00650.43950.03660.1914
520.0541-0.11280.00940.95940.07990.2828
530.0547-0.03460.00290.08420.0070.0838
540.0552-0.03950.00330.10810.0090.0949
550.0556-0.05370.00450.1910.01590.1262
560.061-0.03190.00270.06620.00550.0743
570.0662-0.05530.00460.1980.01650.1285
580.0712-0.08820.00730.51190.04270.2065
590.0727-0.06850.00570.32080.02670.1635
600.074-0.05710.00480.22860.0190.138
610.0752-0.08410.0070.48740.04060.2015

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0302 & -0.0716 & 0.006 & 0.39 & 0.0325 & 0.1803 \tabularnewline
51 & 0.0436 & -0.0774 & 0.0065 & 0.4395 & 0.0366 & 0.1914 \tabularnewline
52 & 0.0541 & -0.1128 & 0.0094 & 0.9594 & 0.0799 & 0.2828 \tabularnewline
53 & 0.0547 & -0.0346 & 0.0029 & 0.0842 & 0.007 & 0.0838 \tabularnewline
54 & 0.0552 & -0.0395 & 0.0033 & 0.1081 & 0.009 & 0.0949 \tabularnewline
55 & 0.0556 & -0.0537 & 0.0045 & 0.191 & 0.0159 & 0.1262 \tabularnewline
56 & 0.061 & -0.0319 & 0.0027 & 0.0662 & 0.0055 & 0.0743 \tabularnewline
57 & 0.0662 & -0.0553 & 0.0046 & 0.198 & 0.0165 & 0.1285 \tabularnewline
58 & 0.0712 & -0.0882 & 0.0073 & 0.5119 & 0.0427 & 0.2065 \tabularnewline
59 & 0.0727 & -0.0685 & 0.0057 & 0.3208 & 0.0267 & 0.1635 \tabularnewline
60 & 0.074 & -0.0571 & 0.0048 & 0.2286 & 0.019 & 0.138 \tabularnewline
61 & 0.0752 & -0.0841 & 0.007 & 0.4874 & 0.0406 & 0.2015 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2593&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]50[/C][C]0.0302[/C][C]-0.0716[/C][C]0.006[/C][C]0.39[/C][C]0.0325[/C][C]0.1803[/C][/ROW]
[ROW][C]51[/C][C]0.0436[/C][C]-0.0774[/C][C]0.0065[/C][C]0.4395[/C][C]0.0366[/C][C]0.1914[/C][/ROW]
[ROW][C]52[/C][C]0.0541[/C][C]-0.1128[/C][C]0.0094[/C][C]0.9594[/C][C]0.0799[/C][C]0.2828[/C][/ROW]
[ROW][C]53[/C][C]0.0547[/C][C]-0.0346[/C][C]0.0029[/C][C]0.0842[/C][C]0.007[/C][C]0.0838[/C][/ROW]
[ROW][C]54[/C][C]0.0552[/C][C]-0.0395[/C][C]0.0033[/C][C]0.1081[/C][C]0.009[/C][C]0.0949[/C][/ROW]
[ROW][C]55[/C][C]0.0556[/C][C]-0.0537[/C][C]0.0045[/C][C]0.191[/C][C]0.0159[/C][C]0.1262[/C][/ROW]
[ROW][C]56[/C][C]0.061[/C][C]-0.0319[/C][C]0.0027[/C][C]0.0662[/C][C]0.0055[/C][C]0.0743[/C][/ROW]
[ROW][C]57[/C][C]0.0662[/C][C]-0.0553[/C][C]0.0046[/C][C]0.198[/C][C]0.0165[/C][C]0.1285[/C][/ROW]
[ROW][C]58[/C][C]0.0712[/C][C]-0.0882[/C][C]0.0073[/C][C]0.5119[/C][C]0.0427[/C][C]0.2065[/C][/ROW]
[ROW][C]59[/C][C]0.0727[/C][C]-0.0685[/C][C]0.0057[/C][C]0.3208[/C][C]0.0267[/C][C]0.1635[/C][/ROW]
[ROW][C]60[/C][C]0.074[/C][C]-0.0571[/C][C]0.0048[/C][C]0.2286[/C][C]0.019[/C][C]0.138[/C][/ROW]
[ROW][C]61[/C][C]0.0752[/C][C]-0.0841[/C][C]0.007[/C][C]0.4874[/C][C]0.0406[/C][C]0.2015[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2593&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2593&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
500.0302-0.07160.0060.390.03250.1803
510.0436-0.07740.00650.43950.03660.1914
520.0541-0.11280.00940.95940.07990.2828
530.0547-0.03460.00290.08420.0070.0838
540.0552-0.03950.00330.10810.0090.0949
550.0556-0.05370.00450.1910.01590.1262
560.061-0.03190.00270.06620.00550.0743
570.0662-0.05530.00460.1980.01650.1285
580.0712-0.08820.00730.51190.04270.2065
590.0727-0.06850.00570.32080.02670.1635
600.074-0.05710.00480.22860.0190.138
610.0752-0.08410.0070.48740.04060.2015



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