Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 13 Dec 2007 05:42: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/13/t1197549122zd77tyud6oz0lao.htm/, Retrieved Sun, 05 May 2024 18:56:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=3485, Retrieved Sun, 05 May 2024 18:56:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact174
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Variance reductio...] [2007-12-13 12:42:55] [bc15d8d2f79dc0888573b215bcd9118f] [Current]
Feedback Forum

Post a new message
Dataseries X:
100.70
97.90
96.50
96.60
96.60
95.50
91.80
89.30
87.00
85.90
88.00
87.90
89.20
90.90
91.60
90.20
89.10
87.50
86.30
86.00
84.40
86.10
91.00
92.70
88.00
84.30
82.20
80.80
79.40
80.20
82.20
82.20
81.20
82.10
88.10
88.50
92.10
98.60
100.90
100.60
101.10
102.10
103.60
102.80
108.30
104.00
106.10
106.30
109.00
111.00
113.70
112.70
110.30
114.50
119.30
121.80
125.40
129.70
129.40
134.50
141.20
141.40
152.20
167.70
173.30
168.70
172.60
169.80
172.00
179.40
174.60
172.50
172.60
176.30
178.90
179.60
179.90
180.30
180.90
177.70




Summary of compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 5 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3485&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]5 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=3485&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3485&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 time5 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[68])
56121.8-------
57125.4-------
58129.7-------
59129.4-------
60134.5-------
61141.2-------
62141.4-------
63152.2-------
64167.7-------
65173.3-------
66168.7-------
67172.6-------
68169.8-------
69172164.7073158.8917170.5230.0070.04310.043
70179.4165.0211154.1251175.91720.00480.104710.195
71174.6167.1747152.3378182.01160.16330.053210.3644
72172.5164.0576146.0738182.04130.17880.12530.99940.2657
73172.6164.4091143.2949185.52340.22350.22630.98440.3084
74176.3167.4662143.627191.30550.23380.33650.98390.4239
75178.9165.5652139.4989191.63140.1580.20980.84250.3751
76179.6165.0809136.7467193.41520.15760.16960.42810.372
77179.9168.3667137.8821198.85130.22920.23510.37560.4633
78180.3166.9024134.6217199.1830.2080.2150.45650.4302
79180.9165.347131.2469199.4470.18570.1950.33840.399
80177.7168.3406132.4118204.26930.30480.24660.46830.4683

\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[68]) \tabularnewline
56 & 121.8 & - & - & - & - & - & - & - \tabularnewline
57 & 125.4 & - & - & - & - & - & - & - \tabularnewline
58 & 129.7 & - & - & - & - & - & - & - \tabularnewline
59 & 129.4 & - & - & - & - & - & - & - \tabularnewline
60 & 134.5 & - & - & - & - & - & - & - \tabularnewline
61 & 141.2 & - & - & - & - & - & - & - \tabularnewline
62 & 141.4 & - & - & - & - & - & - & - \tabularnewline
63 & 152.2 & - & - & - & - & - & - & - \tabularnewline
64 & 167.7 & - & - & - & - & - & - & - \tabularnewline
65 & 173.3 & - & - & - & - & - & - & - \tabularnewline
66 & 168.7 & - & - & - & - & - & - & - \tabularnewline
67 & 172.6 & - & - & - & - & - & - & - \tabularnewline
68 & 169.8 & - & - & - & - & - & - & - \tabularnewline
69 & 172 & 164.7073 & 158.8917 & 170.523 & 0.007 & 0.043 & 1 & 0.043 \tabularnewline
70 & 179.4 & 165.0211 & 154.1251 & 175.9172 & 0.0048 & 0.1047 & 1 & 0.195 \tabularnewline
71 & 174.6 & 167.1747 & 152.3378 & 182.0116 & 0.1633 & 0.0532 & 1 & 0.3644 \tabularnewline
72 & 172.5 & 164.0576 & 146.0738 & 182.0413 & 0.1788 & 0.1253 & 0.9994 & 0.2657 \tabularnewline
73 & 172.6 & 164.4091 & 143.2949 & 185.5234 & 0.2235 & 0.2263 & 0.9844 & 0.3084 \tabularnewline
74 & 176.3 & 167.4662 & 143.627 & 191.3055 & 0.2338 & 0.3365 & 0.9839 & 0.4239 \tabularnewline
75 & 178.9 & 165.5652 & 139.4989 & 191.6314 & 0.158 & 0.2098 & 0.8425 & 0.3751 \tabularnewline
76 & 179.6 & 165.0809 & 136.7467 & 193.4152 & 0.1576 & 0.1696 & 0.4281 & 0.372 \tabularnewline
77 & 179.9 & 168.3667 & 137.8821 & 198.8513 & 0.2292 & 0.2351 & 0.3756 & 0.4633 \tabularnewline
78 & 180.3 & 166.9024 & 134.6217 & 199.183 & 0.208 & 0.215 & 0.4565 & 0.4302 \tabularnewline
79 & 180.9 & 165.347 & 131.2469 & 199.447 & 0.1857 & 0.195 & 0.3384 & 0.399 \tabularnewline
80 & 177.7 & 168.3406 & 132.4118 & 204.2693 & 0.3048 & 0.2466 & 0.4683 & 0.4683 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3485&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[68])[/C][/ROW]
[ROW][C]56[/C][C]121.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]125.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]129.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]129.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]134.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]141.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]141.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]152.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]167.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]173.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]168.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]172.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]169.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]172[/C][C]164.7073[/C][C]158.8917[/C][C]170.523[/C][C]0.007[/C][C]0.043[/C][C]1[/C][C]0.043[/C][/ROW]
[ROW][C]70[/C][C]179.4[/C][C]165.0211[/C][C]154.1251[/C][C]175.9172[/C][C]0.0048[/C][C]0.1047[/C][C]1[/C][C]0.195[/C][/ROW]
[ROW][C]71[/C][C]174.6[/C][C]167.1747[/C][C]152.3378[/C][C]182.0116[/C][C]0.1633[/C][C]0.0532[/C][C]1[/C][C]0.3644[/C][/ROW]
[ROW][C]72[/C][C]172.5[/C][C]164.0576[/C][C]146.0738[/C][C]182.0413[/C][C]0.1788[/C][C]0.1253[/C][C]0.9994[/C][C]0.2657[/C][/ROW]
[ROW][C]73[/C][C]172.6[/C][C]164.4091[/C][C]143.2949[/C][C]185.5234[/C][C]0.2235[/C][C]0.2263[/C][C]0.9844[/C][C]0.3084[/C][/ROW]
[ROW][C]74[/C][C]176.3[/C][C]167.4662[/C][C]143.627[/C][C]191.3055[/C][C]0.2338[/C][C]0.3365[/C][C]0.9839[/C][C]0.4239[/C][/ROW]
[ROW][C]75[/C][C]178.9[/C][C]165.5652[/C][C]139.4989[/C][C]191.6314[/C][C]0.158[/C][C]0.2098[/C][C]0.8425[/C][C]0.3751[/C][/ROW]
[ROW][C]76[/C][C]179.6[/C][C]165.0809[/C][C]136.7467[/C][C]193.4152[/C][C]0.1576[/C][C]0.1696[/C][C]0.4281[/C][C]0.372[/C][/ROW]
[ROW][C]77[/C][C]179.9[/C][C]168.3667[/C][C]137.8821[/C][C]198.8513[/C][C]0.2292[/C][C]0.2351[/C][C]0.3756[/C][C]0.4633[/C][/ROW]
[ROW][C]78[/C][C]180.3[/C][C]166.9024[/C][C]134.6217[/C][C]199.183[/C][C]0.208[/C][C]0.215[/C][C]0.4565[/C][C]0.4302[/C][/ROW]
[ROW][C]79[/C][C]180.9[/C][C]165.347[/C][C]131.2469[/C][C]199.447[/C][C]0.1857[/C][C]0.195[/C][C]0.3384[/C][C]0.399[/C][/ROW]
[ROW][C]80[/C][C]177.7[/C][C]168.3406[/C][C]132.4118[/C][C]204.2693[/C][C]0.3048[/C][C]0.2466[/C][C]0.4683[/C][C]0.4683[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3485&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3485&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[68])
56121.8-------
57125.4-------
58129.7-------
59129.4-------
60134.5-------
61141.2-------
62141.4-------
63152.2-------
64167.7-------
65173.3-------
66168.7-------
67172.6-------
68169.8-------
69172164.7073158.8917170.5230.0070.04310.043
70179.4165.0211154.1251175.91720.00480.104710.195
71174.6167.1747152.3378182.01160.16330.053210.3644
72172.5164.0576146.0738182.04130.17880.12530.99940.2657
73172.6164.4091143.2949185.52340.22350.22630.98440.3084
74176.3167.4662143.627191.30550.23380.33650.98390.4239
75178.9165.5652139.4989191.63140.1580.20980.84250.3751
76179.6165.0809136.7467193.41520.15760.16960.42810.372
77179.9168.3667137.8821198.85130.22920.23510.37560.4633
78180.3166.9024134.6217199.1830.2080.2150.45650.4302
79180.9165.347131.2469199.4470.18570.1950.33840.399
80177.7168.3406132.4118204.26930.30480.24660.46830.4683







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
690.0180.04430.003753.18324.43192.1052
700.03370.08710.0073206.751717.22934.1508
710.04530.04440.003755.13474.59462.1435
720.05590.05150.004371.27465.93952.4371
730.06550.04980.004267.09025.59082.3645
740.07260.05270.004478.03546.5032.5501
750.08030.08050.0067177.818114.81823.8494
760.08760.0880.0073210.803317.56694.1913
770.09240.06850.0057133.017611.08483.3294
780.09870.08030.0067179.496714.95813.8676
790.10520.09410.0078241.896320.1584.4898
800.10890.05560.004687.59877.29992.7018

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
69 & 0.018 & 0.0443 & 0.0037 & 53.1832 & 4.4319 & 2.1052 \tabularnewline
70 & 0.0337 & 0.0871 & 0.0073 & 206.7517 & 17.2293 & 4.1508 \tabularnewline
71 & 0.0453 & 0.0444 & 0.0037 & 55.1347 & 4.5946 & 2.1435 \tabularnewline
72 & 0.0559 & 0.0515 & 0.0043 & 71.2746 & 5.9395 & 2.4371 \tabularnewline
73 & 0.0655 & 0.0498 & 0.0042 & 67.0902 & 5.5908 & 2.3645 \tabularnewline
74 & 0.0726 & 0.0527 & 0.0044 & 78.0354 & 6.503 & 2.5501 \tabularnewline
75 & 0.0803 & 0.0805 & 0.0067 & 177.8181 & 14.8182 & 3.8494 \tabularnewline
76 & 0.0876 & 0.088 & 0.0073 & 210.8033 & 17.5669 & 4.1913 \tabularnewline
77 & 0.0924 & 0.0685 & 0.0057 & 133.0176 & 11.0848 & 3.3294 \tabularnewline
78 & 0.0987 & 0.0803 & 0.0067 & 179.4967 & 14.9581 & 3.8676 \tabularnewline
79 & 0.1052 & 0.0941 & 0.0078 & 241.8963 & 20.158 & 4.4898 \tabularnewline
80 & 0.1089 & 0.0556 & 0.0046 & 87.5987 & 7.2999 & 2.7018 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=3485&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]69[/C][C]0.018[/C][C]0.0443[/C][C]0.0037[/C][C]53.1832[/C][C]4.4319[/C][C]2.1052[/C][/ROW]
[ROW][C]70[/C][C]0.0337[/C][C]0.0871[/C][C]0.0073[/C][C]206.7517[/C][C]17.2293[/C][C]4.1508[/C][/ROW]
[ROW][C]71[/C][C]0.0453[/C][C]0.0444[/C][C]0.0037[/C][C]55.1347[/C][C]4.5946[/C][C]2.1435[/C][/ROW]
[ROW][C]72[/C][C]0.0559[/C][C]0.0515[/C][C]0.0043[/C][C]71.2746[/C][C]5.9395[/C][C]2.4371[/C][/ROW]
[ROW][C]73[/C][C]0.0655[/C][C]0.0498[/C][C]0.0042[/C][C]67.0902[/C][C]5.5908[/C][C]2.3645[/C][/ROW]
[ROW][C]74[/C][C]0.0726[/C][C]0.0527[/C][C]0.0044[/C][C]78.0354[/C][C]6.503[/C][C]2.5501[/C][/ROW]
[ROW][C]75[/C][C]0.0803[/C][C]0.0805[/C][C]0.0067[/C][C]177.8181[/C][C]14.8182[/C][C]3.8494[/C][/ROW]
[ROW][C]76[/C][C]0.0876[/C][C]0.088[/C][C]0.0073[/C][C]210.8033[/C][C]17.5669[/C][C]4.1913[/C][/ROW]
[ROW][C]77[/C][C]0.0924[/C][C]0.0685[/C][C]0.0057[/C][C]133.0176[/C][C]11.0848[/C][C]3.3294[/C][/ROW]
[ROW][C]78[/C][C]0.0987[/C][C]0.0803[/C][C]0.0067[/C][C]179.4967[/C][C]14.9581[/C][C]3.8676[/C][/ROW]
[ROW][C]79[/C][C]0.1052[/C][C]0.0941[/C][C]0.0078[/C][C]241.8963[/C][C]20.158[/C][C]4.4898[/C][/ROW]
[ROW][C]80[/C][C]0.1089[/C][C]0.0556[/C][C]0.0046[/C][C]87.5987[/C][C]7.2999[/C][C]2.7018[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=3485&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=3485&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
690.0180.04430.003753.18324.43192.1052
700.03370.08710.0073206.751717.22934.1508
710.04530.04440.003755.13474.59462.1435
720.05590.05150.004371.27465.93952.4371
730.06550.04980.004267.09025.59082.3645
740.07260.05270.004478.03546.5032.5501
750.08030.08050.0067177.818114.81823.8494
760.08760.0880.0073210.803317.56694.1913
770.09240.06850.0057133.017611.08483.3294
780.09870.08030.0067179.496714.95813.8676
790.10520.09410.0078241.896320.1584.4898
800.10890.05560.004687.59877.29992.7018



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