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 computationSat, 12 Dec 2009 05:30:44 -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/12/t1260621098ku8262udoswztfs.htm/, Retrieved Mon, 29 Apr 2024 09:39:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=66923, Retrieved Mon, 29 Apr 2024 09:39:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact138
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [arima forecast] [2009-12-11 11:39:13] [5b6115903520b3e97ede3db9df07064c]
-   PD    [ARIMA Forecasting] [forecast] [2009-12-12 12:30:44] [307139c5e328127f586f26d5bcc435d8] [Current]
-    D      [ARIMA Forecasting] [forecast] [2009-12-14 09:31:48] [34b80aeb109c116fd63bf2eb7493a276]
Feedback Forum

Post a new message
Dataseries X:
6.3
6.1
6.1
6.3
6.3
6
6.2
6.4
6.8
7.5
7.5
7.6
7.6
7.4
7.3
7.1
6.9
6.8
7.5
7.6
7.8
8
8.1
8.2
8.3
8.2
8
7.9
7.6
7.6
8.3
8.4
8.4
8.4
8.4
8.6
8.9
8.8
8.3
7.5
7.2
7.4
8.8
9.3
9.3
8.7
8.2
8.3
8.5
8.6
8.5
8.2
8.1
7.9
8.6
8.7
8.7
8.5
8.4
8.5
8.7




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66923&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[49])
378.9-------
388.8-------
398.3-------
407.5-------
417.2-------
427.4-------
438.8-------
449.3-------
459.3-------
468.7-------
478.2-------
488.3-------
498.5-------
508.68.72248.38349.06130.23960.90080.32680.9008
518.58.41657.85158.98150.3860.26220.65690.386
528.27.87087.14238.59920.18780.04520.84080.0452
538.17.41036.64178.1790.03930.0220.70410.0027
547.97.41446.64038.18850.10950.04130.51450.003
558.68.55077.77439.32720.45050.94980.26460.551
568.79.09648.29289.90.16680.8870.30980.9271
578.79.2178.346710.08740.12210.87790.42590.9468
588.58.8327.88069.78340.2470.60720.60720.753
598.48.33587.33529.33640.450.37390.60490.3739
608.58.37847.35819.39870.40770.48350.55990.4077
618.78.55787.52829.58730.39330.54380.54380.5438

\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.9 & - & - & - & - & - & - & - \tabularnewline
38 & 8.8 & - & - & - & - & - & - & - \tabularnewline
39 & 8.3 & - & - & - & - & - & - & - \tabularnewline
40 & 7.5 & - & - & - & - & - & - & - \tabularnewline
41 & 7.2 & - & - & - & - & - & - & - \tabularnewline
42 & 7.4 & - & - & - & - & - & - & - \tabularnewline
43 & 8.8 & - & - & - & - & - & - & - \tabularnewline
44 & 9.3 & - & - & - & - & - & - & - \tabularnewline
45 & 9.3 & - & - & - & - & - & - & - \tabularnewline
46 & 8.7 & - & - & - & - & - & - & - \tabularnewline
47 & 8.2 & - & - & - & - & - & - & - \tabularnewline
48 & 8.3 & - & - & - & - & - & - & - \tabularnewline
49 & 8.5 & - & - & - & - & - & - & - \tabularnewline
50 & 8.6 & 8.7224 & 8.3834 & 9.0613 & 0.2396 & 0.9008 & 0.3268 & 0.9008 \tabularnewline
51 & 8.5 & 8.4165 & 7.8515 & 8.9815 & 0.386 & 0.2622 & 0.6569 & 0.386 \tabularnewline
52 & 8.2 & 7.8708 & 7.1423 & 8.5992 & 0.1878 & 0.0452 & 0.8408 & 0.0452 \tabularnewline
53 & 8.1 & 7.4103 & 6.6417 & 8.179 & 0.0393 & 0.022 & 0.7041 & 0.0027 \tabularnewline
54 & 7.9 & 7.4144 & 6.6403 & 8.1885 & 0.1095 & 0.0413 & 0.5145 & 0.003 \tabularnewline
55 & 8.6 & 8.5507 & 7.7743 & 9.3272 & 0.4505 & 0.9498 & 0.2646 & 0.551 \tabularnewline
56 & 8.7 & 9.0964 & 8.2928 & 9.9 & 0.1668 & 0.887 & 0.3098 & 0.9271 \tabularnewline
57 & 8.7 & 9.217 & 8.3467 & 10.0874 & 0.1221 & 0.8779 & 0.4259 & 0.9468 \tabularnewline
58 & 8.5 & 8.832 & 7.8806 & 9.7834 & 0.247 & 0.6072 & 0.6072 & 0.753 \tabularnewline
59 & 8.4 & 8.3358 & 7.3352 & 9.3364 & 0.45 & 0.3739 & 0.6049 & 0.3739 \tabularnewline
60 & 8.5 & 8.3784 & 7.3581 & 9.3987 & 0.4077 & 0.4835 & 0.5599 & 0.4077 \tabularnewline
61 & 8.7 & 8.5578 & 7.5282 & 9.5873 & 0.3933 & 0.5438 & 0.5438 & 0.5438 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66923&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.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]8.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]7.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]7.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]7.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]8.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]9.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]9.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]8.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]8.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]8.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]8.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]8.6[/C][C]8.7224[/C][C]8.3834[/C][C]9.0613[/C][C]0.2396[/C][C]0.9008[/C][C]0.3268[/C][C]0.9008[/C][/ROW]
[ROW][C]51[/C][C]8.5[/C][C]8.4165[/C][C]7.8515[/C][C]8.9815[/C][C]0.386[/C][C]0.2622[/C][C]0.6569[/C][C]0.386[/C][/ROW]
[ROW][C]52[/C][C]8.2[/C][C]7.8708[/C][C]7.1423[/C][C]8.5992[/C][C]0.1878[/C][C]0.0452[/C][C]0.8408[/C][C]0.0452[/C][/ROW]
[ROW][C]53[/C][C]8.1[/C][C]7.4103[/C][C]6.6417[/C][C]8.179[/C][C]0.0393[/C][C]0.022[/C][C]0.7041[/C][C]0.0027[/C][/ROW]
[ROW][C]54[/C][C]7.9[/C][C]7.4144[/C][C]6.6403[/C][C]8.1885[/C][C]0.1095[/C][C]0.0413[/C][C]0.5145[/C][C]0.003[/C][/ROW]
[ROW][C]55[/C][C]8.6[/C][C]8.5507[/C][C]7.7743[/C][C]9.3272[/C][C]0.4505[/C][C]0.9498[/C][C]0.2646[/C][C]0.551[/C][/ROW]
[ROW][C]56[/C][C]8.7[/C][C]9.0964[/C][C]8.2928[/C][C]9.9[/C][C]0.1668[/C][C]0.887[/C][C]0.3098[/C][C]0.9271[/C][/ROW]
[ROW][C]57[/C][C]8.7[/C][C]9.217[/C][C]8.3467[/C][C]10.0874[/C][C]0.1221[/C][C]0.8779[/C][C]0.4259[/C][C]0.9468[/C][/ROW]
[ROW][C]58[/C][C]8.5[/C][C]8.832[/C][C]7.8806[/C][C]9.7834[/C][C]0.247[/C][C]0.6072[/C][C]0.6072[/C][C]0.753[/C][/ROW]
[ROW][C]59[/C][C]8.4[/C][C]8.3358[/C][C]7.3352[/C][C]9.3364[/C][C]0.45[/C][C]0.3739[/C][C]0.6049[/C][C]0.3739[/C][/ROW]
[ROW][C]60[/C][C]8.5[/C][C]8.3784[/C][C]7.3581[/C][C]9.3987[/C][C]0.4077[/C][C]0.4835[/C][C]0.5599[/C][C]0.4077[/C][/ROW]
[ROW][C]61[/C][C]8.7[/C][C]8.5578[/C][C]7.5282[/C][C]9.5873[/C][C]0.3933[/C][C]0.5438[/C][C]0.5438[/C][C]0.5438[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66923&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66923&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.9-------
388.8-------
398.3-------
407.5-------
417.2-------
427.4-------
438.8-------
449.3-------
459.3-------
468.7-------
478.2-------
488.3-------
498.5-------
508.68.72248.38349.06130.23960.90080.32680.9008
518.58.41657.85158.98150.3860.26220.65690.386
528.27.87087.14238.59920.18780.04520.84080.0452
538.17.41036.64178.1790.03930.0220.70410.0027
547.97.41446.64038.18850.10950.04130.51450.003
558.68.55077.77439.32720.45050.94980.26460.551
568.79.09648.29289.90.16680.8870.30980.9271
578.79.2178.346710.08740.12210.87790.42590.9468
588.58.8327.88069.78340.2470.60720.60720.753
598.48.33587.33529.33640.450.37390.60490.3739
608.58.37847.35819.39870.40770.48350.55990.4077
618.78.55787.52829.58730.39330.54380.54380.5438







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0198-0.01400.01500
510.03420.00990.0120.0070.0110.1048
520.04720.04180.02190.10840.04350.2084
530.05290.09310.03970.47570.15150.3892
540.05330.06550.04490.23580.16840.4103
550.04630.00580.03840.00240.14070.3751
560.0451-0.04360.03910.15720.14310.3782
570.0482-0.05610.04120.26730.15860.3982
580.055-0.03760.04080.11020.15320.3914
590.06120.00770.03750.00410.13830.3719
600.06210.01450.03540.01480.12710.3565
610.06140.01660.03390.02020.11820.3438

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0198 & -0.014 & 0 & 0.015 & 0 & 0 \tabularnewline
51 & 0.0342 & 0.0099 & 0.012 & 0.007 & 0.011 & 0.1048 \tabularnewline
52 & 0.0472 & 0.0418 & 0.0219 & 0.1084 & 0.0435 & 0.2084 \tabularnewline
53 & 0.0529 & 0.0931 & 0.0397 & 0.4757 & 0.1515 & 0.3892 \tabularnewline
54 & 0.0533 & 0.0655 & 0.0449 & 0.2358 & 0.1684 & 0.4103 \tabularnewline
55 & 0.0463 & 0.0058 & 0.0384 & 0.0024 & 0.1407 & 0.3751 \tabularnewline
56 & 0.0451 & -0.0436 & 0.0391 & 0.1572 & 0.1431 & 0.3782 \tabularnewline
57 & 0.0482 & -0.0561 & 0.0412 & 0.2673 & 0.1586 & 0.3982 \tabularnewline
58 & 0.055 & -0.0376 & 0.0408 & 0.1102 & 0.1532 & 0.3914 \tabularnewline
59 & 0.0612 & 0.0077 & 0.0375 & 0.0041 & 0.1383 & 0.3719 \tabularnewline
60 & 0.0621 & 0.0145 & 0.0354 & 0.0148 & 0.1271 & 0.3565 \tabularnewline
61 & 0.0614 & 0.0166 & 0.0339 & 0.0202 & 0.1182 & 0.3438 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=66923&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.0198[/C][C]-0.014[/C][C]0[/C][C]0.015[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0342[/C][C]0.0099[/C][C]0.012[/C][C]0.007[/C][C]0.011[/C][C]0.1048[/C][/ROW]
[ROW][C]52[/C][C]0.0472[/C][C]0.0418[/C][C]0.0219[/C][C]0.1084[/C][C]0.0435[/C][C]0.2084[/C][/ROW]
[ROW][C]53[/C][C]0.0529[/C][C]0.0931[/C][C]0.0397[/C][C]0.4757[/C][C]0.1515[/C][C]0.3892[/C][/ROW]
[ROW][C]54[/C][C]0.0533[/C][C]0.0655[/C][C]0.0449[/C][C]0.2358[/C][C]0.1684[/C][C]0.4103[/C][/ROW]
[ROW][C]55[/C][C]0.0463[/C][C]0.0058[/C][C]0.0384[/C][C]0.0024[/C][C]0.1407[/C][C]0.3751[/C][/ROW]
[ROW][C]56[/C][C]0.0451[/C][C]-0.0436[/C][C]0.0391[/C][C]0.1572[/C][C]0.1431[/C][C]0.3782[/C][/ROW]
[ROW][C]57[/C][C]0.0482[/C][C]-0.0561[/C][C]0.0412[/C][C]0.2673[/C][C]0.1586[/C][C]0.3982[/C][/ROW]
[ROW][C]58[/C][C]0.055[/C][C]-0.0376[/C][C]0.0408[/C][C]0.1102[/C][C]0.1532[/C][C]0.3914[/C][/ROW]
[ROW][C]59[/C][C]0.0612[/C][C]0.0077[/C][C]0.0375[/C][C]0.0041[/C][C]0.1383[/C][C]0.3719[/C][/ROW]
[ROW][C]60[/C][C]0.0621[/C][C]0.0145[/C][C]0.0354[/C][C]0.0148[/C][C]0.1271[/C][C]0.3565[/C][/ROW]
[ROW][C]61[/C][C]0.0614[/C][C]0.0166[/C][C]0.0339[/C][C]0.0202[/C][C]0.1182[/C][C]0.3438[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=66923&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=66923&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.0198-0.01400.01500
510.03420.00990.0120.0070.0110.1048
520.04720.04180.02190.10840.04350.2084
530.05290.09310.03970.47570.15150.3892
540.05330.06550.04490.23580.16840.4103
550.04630.00580.03840.00240.14070.3751
560.0451-0.04360.03910.15720.14310.3782
570.0482-0.05610.04120.26730.15860.3982
580.055-0.03760.04080.11020.15320.3914
590.06120.00770.03750.00410.13830.3719
600.06210.01450.03540.01480.12710.3565
610.06140.01660.03390.02020.11820.3438



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