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 computationMon, 14 Dec 2009 13:56:08 -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/14/t1260824237zi7vtfohvf82hyb.htm/, Retrieved Sun, 05 May 2024 12:42:22 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=67677, Retrieved Sun, 05 May 2024 12:42:22 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsworkshop 10 review
Estimated Impact138
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD  [ARIMA Forecasting] [workshop 10] [2009-12-09 18:40:24] [74be16979710d4c4e7c6647856088456]
-   PD      [ARIMA Forecasting] [workshop 10 review] [2009-12-14 20:56:08] [6198946fb53eb5eb18db46bb758f7fde] [Current]
Feedback Forum

Post a new message
Dataseries X:
8,6
8,5
8,3
7,8
7,8
8
8,6
8,9
8,9
8,6
8,3
8,3
8,3
8,4
8,5
8,4
8,6
8,5
8,5
8,4
8,5
8,5
8,5
8,5
8,5
8,5
8,5
8,5
8,6
8,4
8,1
8
8
8
8
7,9
7,8
7,8
7,9
8,1
8
7,6
7,3
7
6,8
7
7,1
7,2
7,1
6,9
6,7
6,7
6,6
6,9
7,3
7,5
7,3
7,1
6,9
7,1




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67677&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[48])
367.9-------
377.8-------
387.8-------
397.9-------
408.1-------
418-------
427.6-------
437.3-------
447-------
456.8-------
467-------
477.1-------
487.2-------
497.17.11596.88067.35110.44750.241600.2416
506.97.04396.627.46790.25290.39772e-040.2353
516.76.9816.39427.56790.1740.60670.00110.2323
526.77.04696.38527.70870.15210.84799e-040.3251
536.66.97416.28497.66330.14370.78210.00180.2603
546.96.91776.21977.61570.48010.81390.02770.214
557.36.93936.23027.64840.15940.54320.15940.2356
567.56.83786.10277.57280.03870.10890.33270.1671
577.36.70085.91757.48410.06690.02280.4020.1058
587.16.76035.92157.59910.21370.10370.28770.1521
596.96.78275.89947.6660.39730.24070.24070.1773
607.16.87915.96797.79030.31730.48210.2450.245

\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 & 7.9 & - & - & - & - & - & - & - \tabularnewline
37 & 7.8 & - & - & - & - & - & - & - \tabularnewline
38 & 7.8 & - & - & - & - & - & - & - \tabularnewline
39 & 7.9 & - & - & - & - & - & - & - \tabularnewline
40 & 8.1 & - & - & - & - & - & - & - \tabularnewline
41 & 8 & - & - & - & - & - & - & - \tabularnewline
42 & 7.6 & - & - & - & - & - & - & - \tabularnewline
43 & 7.3 & - & - & - & - & - & - & - \tabularnewline
44 & 7 & - & - & - & - & - & - & - \tabularnewline
45 & 6.8 & - & - & - & - & - & - & - \tabularnewline
46 & 7 & - & - & - & - & - & - & - \tabularnewline
47 & 7.1 & - & - & - & - & - & - & - \tabularnewline
48 & 7.2 & - & - & - & - & - & - & - \tabularnewline
49 & 7.1 & 7.1159 & 6.8806 & 7.3511 & 0.4475 & 0.2416 & 0 & 0.2416 \tabularnewline
50 & 6.9 & 7.0439 & 6.62 & 7.4679 & 0.2529 & 0.3977 & 2e-04 & 0.2353 \tabularnewline
51 & 6.7 & 6.981 & 6.3942 & 7.5679 & 0.174 & 0.6067 & 0.0011 & 0.2323 \tabularnewline
52 & 6.7 & 7.0469 & 6.3852 & 7.7087 & 0.1521 & 0.8479 & 9e-04 & 0.3251 \tabularnewline
53 & 6.6 & 6.9741 & 6.2849 & 7.6633 & 0.1437 & 0.7821 & 0.0018 & 0.2603 \tabularnewline
54 & 6.9 & 6.9177 & 6.2197 & 7.6157 & 0.4801 & 0.8139 & 0.0277 & 0.214 \tabularnewline
55 & 7.3 & 6.9393 & 6.2302 & 7.6484 & 0.1594 & 0.5432 & 0.1594 & 0.2356 \tabularnewline
56 & 7.5 & 6.8378 & 6.1027 & 7.5728 & 0.0387 & 0.1089 & 0.3327 & 0.1671 \tabularnewline
57 & 7.3 & 6.7008 & 5.9175 & 7.4841 & 0.0669 & 0.0228 & 0.402 & 0.1058 \tabularnewline
58 & 7.1 & 6.7603 & 5.9215 & 7.5991 & 0.2137 & 0.1037 & 0.2877 & 0.1521 \tabularnewline
59 & 6.9 & 6.7827 & 5.8994 & 7.666 & 0.3973 & 0.2407 & 0.2407 & 0.1773 \tabularnewline
60 & 7.1 & 6.8791 & 5.9679 & 7.7903 & 0.3173 & 0.4821 & 0.245 & 0.245 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67677&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]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]7.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]7.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]7.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]8.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]7.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]7.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]6.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]7.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]7.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]7.1[/C][C]7.1159[/C][C]6.8806[/C][C]7.3511[/C][C]0.4475[/C][C]0.2416[/C][C]0[/C][C]0.2416[/C][/ROW]
[ROW][C]50[/C][C]6.9[/C][C]7.0439[/C][C]6.62[/C][C]7.4679[/C][C]0.2529[/C][C]0.3977[/C][C]2e-04[/C][C]0.2353[/C][/ROW]
[ROW][C]51[/C][C]6.7[/C][C]6.981[/C][C]6.3942[/C][C]7.5679[/C][C]0.174[/C][C]0.6067[/C][C]0.0011[/C][C]0.2323[/C][/ROW]
[ROW][C]52[/C][C]6.7[/C][C]7.0469[/C][C]6.3852[/C][C]7.7087[/C][C]0.1521[/C][C]0.8479[/C][C]9e-04[/C][C]0.3251[/C][/ROW]
[ROW][C]53[/C][C]6.6[/C][C]6.9741[/C][C]6.2849[/C][C]7.6633[/C][C]0.1437[/C][C]0.7821[/C][C]0.0018[/C][C]0.2603[/C][/ROW]
[ROW][C]54[/C][C]6.9[/C][C]6.9177[/C][C]6.2197[/C][C]7.6157[/C][C]0.4801[/C][C]0.8139[/C][C]0.0277[/C][C]0.214[/C][/ROW]
[ROW][C]55[/C][C]7.3[/C][C]6.9393[/C][C]6.2302[/C][C]7.6484[/C][C]0.1594[/C][C]0.5432[/C][C]0.1594[/C][C]0.2356[/C][/ROW]
[ROW][C]56[/C][C]7.5[/C][C]6.8378[/C][C]6.1027[/C][C]7.5728[/C][C]0.0387[/C][C]0.1089[/C][C]0.3327[/C][C]0.1671[/C][/ROW]
[ROW][C]57[/C][C]7.3[/C][C]6.7008[/C][C]5.9175[/C][C]7.4841[/C][C]0.0669[/C][C]0.0228[/C][C]0.402[/C][C]0.1058[/C][/ROW]
[ROW][C]58[/C][C]7.1[/C][C]6.7603[/C][C]5.9215[/C][C]7.5991[/C][C]0.2137[/C][C]0.1037[/C][C]0.2877[/C][C]0.1521[/C][/ROW]
[ROW][C]59[/C][C]6.9[/C][C]6.7827[/C][C]5.8994[/C][C]7.666[/C][C]0.3973[/C][C]0.2407[/C][C]0.2407[/C][C]0.1773[/C][/ROW]
[ROW][C]60[/C][C]7.1[/C][C]6.8791[/C][C]5.9679[/C][C]7.7903[/C][C]0.3173[/C][C]0.4821[/C][C]0.245[/C][C]0.245[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67677&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67677&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])
367.9-------
377.8-------
387.8-------
397.9-------
408.1-------
418-------
427.6-------
437.3-------
447-------
456.8-------
467-------
477.1-------
487.2-------
497.17.11596.88067.35110.44750.241600.2416
506.97.04396.627.46790.25290.39772e-040.2353
516.76.9816.39427.56790.1740.60670.00110.2323
526.77.04696.38527.70870.15210.84799e-040.3251
536.66.97416.28497.66330.14370.78210.00180.2603
546.96.91776.21977.61570.48010.81390.02770.214
557.36.93936.23027.64840.15940.54320.15940.2356
567.56.83786.10277.57280.03870.10890.33270.1671
577.36.70085.91757.48410.06690.02280.4020.1058
587.16.76035.92157.59910.21370.10370.28770.1521
596.96.78275.89947.6660.39730.24070.24070.1773
607.16.87915.96797.79030.31730.48210.2450.245







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0169-0.002203e-0400
500.0307-0.02040.01130.02070.01050.1024
510.0429-0.04030.0210.0790.03330.1825
520.0479-0.04920.0280.12040.05510.2347
530.0504-0.05360.03320.13990.0720.2684
540.0515-0.00260.02813e-040.06010.2451
550.05210.0520.03150.13010.07010.2648
560.05480.09680.03960.43850.11620.3408
570.05960.08940.04520.35910.14310.3783
580.06330.05020.04570.11540.14040.3747
590.06640.01730.04310.01380.12890.359
600.06760.03210.04220.04880.12220.3495

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0169 & -0.0022 & 0 & 3e-04 & 0 & 0 \tabularnewline
50 & 0.0307 & -0.0204 & 0.0113 & 0.0207 & 0.0105 & 0.1024 \tabularnewline
51 & 0.0429 & -0.0403 & 0.021 & 0.079 & 0.0333 & 0.1825 \tabularnewline
52 & 0.0479 & -0.0492 & 0.028 & 0.1204 & 0.0551 & 0.2347 \tabularnewline
53 & 0.0504 & -0.0536 & 0.0332 & 0.1399 & 0.072 & 0.2684 \tabularnewline
54 & 0.0515 & -0.0026 & 0.0281 & 3e-04 & 0.0601 & 0.2451 \tabularnewline
55 & 0.0521 & 0.052 & 0.0315 & 0.1301 & 0.0701 & 0.2648 \tabularnewline
56 & 0.0548 & 0.0968 & 0.0396 & 0.4385 & 0.1162 & 0.3408 \tabularnewline
57 & 0.0596 & 0.0894 & 0.0452 & 0.3591 & 0.1431 & 0.3783 \tabularnewline
58 & 0.0633 & 0.0502 & 0.0457 & 0.1154 & 0.1404 & 0.3747 \tabularnewline
59 & 0.0664 & 0.0173 & 0.0431 & 0.0138 & 0.1289 & 0.359 \tabularnewline
60 & 0.0676 & 0.0321 & 0.0422 & 0.0488 & 0.1222 & 0.3495 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=67677&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.0169[/C][C]-0.0022[/C][C]0[/C][C]3e-04[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0307[/C][C]-0.0204[/C][C]0.0113[/C][C]0.0207[/C][C]0.0105[/C][C]0.1024[/C][/ROW]
[ROW][C]51[/C][C]0.0429[/C][C]-0.0403[/C][C]0.021[/C][C]0.079[/C][C]0.0333[/C][C]0.1825[/C][/ROW]
[ROW][C]52[/C][C]0.0479[/C][C]-0.0492[/C][C]0.028[/C][C]0.1204[/C][C]0.0551[/C][C]0.2347[/C][/ROW]
[ROW][C]53[/C][C]0.0504[/C][C]-0.0536[/C][C]0.0332[/C][C]0.1399[/C][C]0.072[/C][C]0.2684[/C][/ROW]
[ROW][C]54[/C][C]0.0515[/C][C]-0.0026[/C][C]0.0281[/C][C]3e-04[/C][C]0.0601[/C][C]0.2451[/C][/ROW]
[ROW][C]55[/C][C]0.0521[/C][C]0.052[/C][C]0.0315[/C][C]0.1301[/C][C]0.0701[/C][C]0.2648[/C][/ROW]
[ROW][C]56[/C][C]0.0548[/C][C]0.0968[/C][C]0.0396[/C][C]0.4385[/C][C]0.1162[/C][C]0.3408[/C][/ROW]
[ROW][C]57[/C][C]0.0596[/C][C]0.0894[/C][C]0.0452[/C][C]0.3591[/C][C]0.1431[/C][C]0.3783[/C][/ROW]
[ROW][C]58[/C][C]0.0633[/C][C]0.0502[/C][C]0.0457[/C][C]0.1154[/C][C]0.1404[/C][C]0.3747[/C][/ROW]
[ROW][C]59[/C][C]0.0664[/C][C]0.0173[/C][C]0.0431[/C][C]0.0138[/C][C]0.1289[/C][C]0.359[/C][/ROW]
[ROW][C]60[/C][C]0.0676[/C][C]0.0321[/C][C]0.0422[/C][C]0.0488[/C][C]0.1222[/C][C]0.3495[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=67677&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=67677&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.0169-0.002203e-0400
500.0307-0.02040.01130.02070.01050.1024
510.0429-0.04030.0210.0790.03330.1825
520.0479-0.04920.0280.12040.05510.2347
530.0504-0.05360.03320.13990.0720.2684
540.0515-0.00260.02813e-040.06010.2451
550.05210.0520.03150.13010.07010.2648
560.05480.09680.03960.43850.11620.3408
570.05960.08940.04520.35910.14310.3783
580.06330.05020.04570.11540.14040.3747
590.06640.01730.04310.01380.12890.359
600.06760.03210.04220.04880.12220.3495



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