Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 17 Dec 2008 09:14:42 -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/2008/Dec/17/t1229530532ac5ypms6fwq0m42.htm/, Retrieved Mon, 27 May 2024 17:59:30 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=34436, Retrieved Mon, 27 May 2024 17:59:30 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact139
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [ARIMA Forecasting] [step 1] [2008-12-15 19:00:45] [b28ef2aea2cd58ceb5ad90223572c703]
-   PD    [ARIMA Forecasting] [forecasting ] [2008-12-17 16:14:42] [e8ace8b3d80d7fc51f1760fb13a6fe6b] [Current]
Feedback Forum

Post a new message
Dataseries X:
147768
137507
136919
136151
133001
125554
119647
114158
116193
152803
161761
160942
149470
139208
134588
130322
126611
122401
117352
112135
112879
148729
157230
157221
146681
136524
132111
125326
122716
116615
113719
110737
112093
143565
149946
149147
134339
122683
115614
116566
111272
104609
101802
94542
93051
124129
130374
123946
114971
105531
104919
104782
101281
94545
93248
84031
87486
115867
120327
117008
108811




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34436&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]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34436&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34436&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'George Udny Yule' @ 72.249.76.132







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])
37134339-------
38122683-------
39115614-------
40116566-------
41111272-------
42104609-------
43101802-------
4494542-------
4593051-------
46124129-------
47130374-------
48123946-------
49114971-------
50105531106282.6855102236.1222110489.4140.3631000
51104919102349.161596882.0375108124.79930.19160.140100
52104782100497.258293962.6032107486.36750.11480.107500
5310128197305.154890036.6957105160.38020.16060.0312e-040
549454592320.212884644.9064100691.48940.30120.0180.0020
559324889296.686781197.280298204.00680.19230.12410.0030
568403184844.132176563.070894020.87290.43110.03630.01920
578748684997.77876159.753794861.41840.31050.57620.05480
58115867111631.102799359.8151125417.93750.27350.99970.03780.3175
59120327117391.2455103830.65132722.89560.35370.57720.04850.6215
60117008114990.48101099.6718130789.84580.40120.2540.13330.501
61108811105994.551292658.49121250.03220.35870.07850.12440.1244

\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 & 134339 & - & - & - & - & - & - & - \tabularnewline
38 & 122683 & - & - & - & - & - & - & - \tabularnewline
39 & 115614 & - & - & - & - & - & - & - \tabularnewline
40 & 116566 & - & - & - & - & - & - & - \tabularnewline
41 & 111272 & - & - & - & - & - & - & - \tabularnewline
42 & 104609 & - & - & - & - & - & - & - \tabularnewline
43 & 101802 & - & - & - & - & - & - & - \tabularnewline
44 & 94542 & - & - & - & - & - & - & - \tabularnewline
45 & 93051 & - & - & - & - & - & - & - \tabularnewline
46 & 124129 & - & - & - & - & - & - & - \tabularnewline
47 & 130374 & - & - & - & - & - & - & - \tabularnewline
48 & 123946 & - & - & - & - & - & - & - \tabularnewline
49 & 114971 & - & - & - & - & - & - & - \tabularnewline
50 & 105531 & 106282.6855 & 102236.1222 & 110489.414 & 0.3631 & 0 & 0 & 0 \tabularnewline
51 & 104919 & 102349.1615 & 96882.0375 & 108124.7993 & 0.1916 & 0.1401 & 0 & 0 \tabularnewline
52 & 104782 & 100497.2582 & 93962.6032 & 107486.3675 & 0.1148 & 0.1075 & 0 & 0 \tabularnewline
53 & 101281 & 97305.1548 & 90036.6957 & 105160.3802 & 0.1606 & 0.031 & 2e-04 & 0 \tabularnewline
54 & 94545 & 92320.2128 & 84644.9064 & 100691.4894 & 0.3012 & 0.018 & 0.002 & 0 \tabularnewline
55 & 93248 & 89296.6867 & 81197.2802 & 98204.0068 & 0.1923 & 0.1241 & 0.003 & 0 \tabularnewline
56 & 84031 & 84844.1321 & 76563.0708 & 94020.8729 & 0.4311 & 0.0363 & 0.0192 & 0 \tabularnewline
57 & 87486 & 84997.778 & 76159.7537 & 94861.4184 & 0.3105 & 0.5762 & 0.0548 & 0 \tabularnewline
58 & 115867 & 111631.1027 & 99359.8151 & 125417.9375 & 0.2735 & 0.9997 & 0.0378 & 0.3175 \tabularnewline
59 & 120327 & 117391.2455 & 103830.65 & 132722.8956 & 0.3537 & 0.5772 & 0.0485 & 0.6215 \tabularnewline
60 & 117008 & 114990.48 & 101099.6718 & 130789.8458 & 0.4012 & 0.254 & 0.1333 & 0.501 \tabularnewline
61 & 108811 & 105994.5512 & 92658.49 & 121250.0322 & 0.3587 & 0.0785 & 0.1244 & 0.1244 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34436&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]134339[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]122683[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]115614[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]116566[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]111272[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]104609[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]101802[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]94542[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]93051[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]124129[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]130374[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]123946[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]114971[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]105531[/C][C]106282.6855[/C][C]102236.1222[/C][C]110489.414[/C][C]0.3631[/C][C]0[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]104919[/C][C]102349.1615[/C][C]96882.0375[/C][C]108124.7993[/C][C]0.1916[/C][C]0.1401[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]52[/C][C]104782[/C][C]100497.2582[/C][C]93962.6032[/C][C]107486.3675[/C][C]0.1148[/C][C]0.1075[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]53[/C][C]101281[/C][C]97305.1548[/C][C]90036.6957[/C][C]105160.3802[/C][C]0.1606[/C][C]0.031[/C][C]2e-04[/C][C]0[/C][/ROW]
[ROW][C]54[/C][C]94545[/C][C]92320.2128[/C][C]84644.9064[/C][C]100691.4894[/C][C]0.3012[/C][C]0.018[/C][C]0.002[/C][C]0[/C][/ROW]
[ROW][C]55[/C][C]93248[/C][C]89296.6867[/C][C]81197.2802[/C][C]98204.0068[/C][C]0.1923[/C][C]0.1241[/C][C]0.003[/C][C]0[/C][/ROW]
[ROW][C]56[/C][C]84031[/C][C]84844.1321[/C][C]76563.0708[/C][C]94020.8729[/C][C]0.4311[/C][C]0.0363[/C][C]0.0192[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]87486[/C][C]84997.778[/C][C]76159.7537[/C][C]94861.4184[/C][C]0.3105[/C][C]0.5762[/C][C]0.0548[/C][C]0[/C][/ROW]
[ROW][C]58[/C][C]115867[/C][C]111631.1027[/C][C]99359.8151[/C][C]125417.9375[/C][C]0.2735[/C][C]0.9997[/C][C]0.0378[/C][C]0.3175[/C][/ROW]
[ROW][C]59[/C][C]120327[/C][C]117391.2455[/C][C]103830.65[/C][C]132722.8956[/C][C]0.3537[/C][C]0.5772[/C][C]0.0485[/C][C]0.6215[/C][/ROW]
[ROW][C]60[/C][C]117008[/C][C]114990.48[/C][C]101099.6718[/C][C]130789.8458[/C][C]0.4012[/C][C]0.254[/C][C]0.1333[/C][C]0.501[/C][/ROW]
[ROW][C]61[/C][C]108811[/C][C]105994.5512[/C][C]92658.49[/C][C]121250.0322[/C][C]0.3587[/C][C]0.0785[/C][C]0.1244[/C][C]0.1244[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34436&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34436&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])
37134339-------
38122683-------
39115614-------
40116566-------
41111272-------
42104609-------
43101802-------
4494542-------
4593051-------
46124129-------
47130374-------
48123946-------
49114971-------
50105531106282.6855102236.1222110489.4140.3631000
51104919102349.161596882.0375108124.79930.19160.140100
52104782100497.258293962.6032107486.36750.11480.107500
5310128197305.154890036.6957105160.38020.16060.0312e-040
549454592320.212884644.9064100691.48940.30120.0180.0020
559324889296.686781197.280298204.00680.19230.12410.0030
568403184844.132176563.070894020.87290.43110.03630.01920
578748684997.77876159.753794861.41840.31050.57620.05480
58115867111631.102799359.8151125417.93750.27350.99970.03780.3175
59120327117391.2455103830.65132722.89560.35370.57720.04850.6215
60117008114990.48101099.6718130789.84580.40120.2540.13330.501
61108811105994.551292658.49121250.03220.35870.07850.12440.1244







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0202-0.00716e-04565031.070147085.9225216.9929
510.02880.02510.00216604069.844550339.1537741.8485
520.03550.04260.003618359012.60471529917.71711236.8984
530.04120.04090.003415807345.00981317278.75081147.7276
540.04630.02410.0024949678.0094412473.1675642.2407
550.05090.04420.003715612876.70471301073.05871140.6459
560.0552-0.00968e-04661183.811155098.6509234.731
570.05920.02930.00246191248.8204515937.4017718.2878
580.0630.03790.003217942826.34681495235.52891222.7982
590.06660.0250.00218618654.7402718221.2284847.4793
600.07010.01750.00154070386.9932339198.9161582.4079
610.07340.02660.00227932383.5659661031.9638813.0387

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0202 & -0.0071 & 6e-04 & 565031.0701 & 47085.9225 & 216.9929 \tabularnewline
51 & 0.0288 & 0.0251 & 0.0021 & 6604069.844 & 550339.1537 & 741.8485 \tabularnewline
52 & 0.0355 & 0.0426 & 0.0036 & 18359012.6047 & 1529917.7171 & 1236.8984 \tabularnewline
53 & 0.0412 & 0.0409 & 0.0034 & 15807345.0098 & 1317278.7508 & 1147.7276 \tabularnewline
54 & 0.0463 & 0.0241 & 0.002 & 4949678.0094 & 412473.1675 & 642.2407 \tabularnewline
55 & 0.0509 & 0.0442 & 0.0037 & 15612876.7047 & 1301073.0587 & 1140.6459 \tabularnewline
56 & 0.0552 & -0.0096 & 8e-04 & 661183.8111 & 55098.6509 & 234.731 \tabularnewline
57 & 0.0592 & 0.0293 & 0.0024 & 6191248.8204 & 515937.4017 & 718.2878 \tabularnewline
58 & 0.063 & 0.0379 & 0.0032 & 17942826.3468 & 1495235.5289 & 1222.7982 \tabularnewline
59 & 0.0666 & 0.025 & 0.0021 & 8618654.7402 & 718221.2284 & 847.4793 \tabularnewline
60 & 0.0701 & 0.0175 & 0.0015 & 4070386.9932 & 339198.9161 & 582.4079 \tabularnewline
61 & 0.0734 & 0.0266 & 0.0022 & 7932383.5659 & 661031.9638 & 813.0387 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34436&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.0202[/C][C]-0.0071[/C][C]6e-04[/C][C]565031.0701[/C][C]47085.9225[/C][C]216.9929[/C][/ROW]
[ROW][C]51[/C][C]0.0288[/C][C]0.0251[/C][C]0.0021[/C][C]6604069.844[/C][C]550339.1537[/C][C]741.8485[/C][/ROW]
[ROW][C]52[/C][C]0.0355[/C][C]0.0426[/C][C]0.0036[/C][C]18359012.6047[/C][C]1529917.7171[/C][C]1236.8984[/C][/ROW]
[ROW][C]53[/C][C]0.0412[/C][C]0.0409[/C][C]0.0034[/C][C]15807345.0098[/C][C]1317278.7508[/C][C]1147.7276[/C][/ROW]
[ROW][C]54[/C][C]0.0463[/C][C]0.0241[/C][C]0.002[/C][C]4949678.0094[/C][C]412473.1675[/C][C]642.2407[/C][/ROW]
[ROW][C]55[/C][C]0.0509[/C][C]0.0442[/C][C]0.0037[/C][C]15612876.7047[/C][C]1301073.0587[/C][C]1140.6459[/C][/ROW]
[ROW][C]56[/C][C]0.0552[/C][C]-0.0096[/C][C]8e-04[/C][C]661183.8111[/C][C]55098.6509[/C][C]234.731[/C][/ROW]
[ROW][C]57[/C][C]0.0592[/C][C]0.0293[/C][C]0.0024[/C][C]6191248.8204[/C][C]515937.4017[/C][C]718.2878[/C][/ROW]
[ROW][C]58[/C][C]0.063[/C][C]0.0379[/C][C]0.0032[/C][C]17942826.3468[/C][C]1495235.5289[/C][C]1222.7982[/C][/ROW]
[ROW][C]59[/C][C]0.0666[/C][C]0.025[/C][C]0.0021[/C][C]8618654.7402[/C][C]718221.2284[/C][C]847.4793[/C][/ROW]
[ROW][C]60[/C][C]0.0701[/C][C]0.0175[/C][C]0.0015[/C][C]4070386.9932[/C][C]339198.9161[/C][C]582.4079[/C][/ROW]
[ROW][C]61[/C][C]0.0734[/C][C]0.0266[/C][C]0.0022[/C][C]7932383.5659[/C][C]661031.9638[/C][C]813.0387[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34436&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34436&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.0202-0.00716e-04565031.070147085.9225216.9929
510.02880.02510.00216604069.844550339.1537741.8485
520.03550.04260.003618359012.60471529917.71711236.8984
530.04120.04090.003415807345.00981317278.75081147.7276
540.04630.02410.0024949678.0094412473.1675642.2407
550.05090.04420.003715612876.70471301073.05871140.6459
560.0552-0.00968e-04661183.811155098.6509234.731
570.05920.02930.00246191248.8204515937.4017718.2878
580.0630.03790.003217942826.34681495235.52891222.7982
590.06660.0250.00218618654.7402718221.2284847.4793
600.07010.01750.00154070386.9932339198.9161582.4079
610.07340.02660.00227932383.5659661031.9638813.0387



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