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 computationTue, 06 Dec 2011 08:42:36 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/06/t1323178976c6bl1827y8aephk.htm/, Retrieved Sun, 28 Apr 2024 21:59:02 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=151572, Retrieved Sun, 28 Apr 2024 21:59:02 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact80
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Spectral Analysis] [] [2011-12-02 13:00:58] [8845143a6d3c316a3d9f23c370a4d275]
- RMP   [ARIMA Forecasting] [] [2011-12-02 16:01:07] [8845143a6d3c316a3d9f23c370a4d275]
-         [ARIMA Forecasting] [] [2011-12-06 13:07:35] [8845143a6d3c316a3d9f23c370a4d275]
- R P         [ARIMA Forecasting] [] [2011-12-06 13:42:36] [cd8b9934e81fda54a97eda68755efa21] [Current]
Feedback Forum

Post a new message
Dataseries X:
26.663
23.598
26.931
24.740
25.806
24.364
24.477
23.901
23.175
23.227
21.672
21.870
21.439
21.089
23.709
21.669
21.752
20.761
23.479
23.824
23.105
23.110
21.759
22.073
21.937
20.035
23.590
21.672
22.222
22.123
23.950
23.504
22.238
23.142
21.059
21.573
21.548
20.000
22.424
20.615
21.761
22.874
24.104
23.748
23.262
22.907
21.519
22.025
22.604
20.894
24.677
23.673
25.320
23.583
24.671
24.454
24.122
24.252
22.084
22.991
23.287
23.049
25.076
24.037
24.430
24.667
26.451
25.618
25.014
25.110
22.964
23.981
23.798
22.270
24.775
22.646
23.988
24.737
26.276
25.816
25.210
25.199
23.162
24.707
24.364
22.644
25.565
24.062
25.431
24.635
27.009
26.606
26.268
26.462
25.246
25.180
24.657
23.304
26.982
26.199
27.210
26.122
26.706
26.878
26.152
26.379
24.712
25.688
24.990
24.239
26.721
23.475
24.767
26.219
28.361
28.599
27.914
27.784
25.693
26.881
26.217
24.218
27.914
26.975
28.527
27.139
28.982
28.169
28.056
29.136
26.291
26.987
26.589
24.848
27.543
26.896
28.878
27.390
28.065
28.141
29.048
28.484
26.634
27.735
27.132
24.924
28.963
26.589
27.931
28.009
29.229
28.759
28.405
27.945
25.912
26.619
26.076
25.286
27.660
25.951
26.398
25.565
28.865
30.000
29.261
29.012
26.992
27.897




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'George Udny Yule' @ yule.wessa.net

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151572&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 time5 seconds
R Server'George Udny Yule' @ yule.wessa.net







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[156])
14427.735-------
14527.132-------
14624.924-------
14728.963-------
14826.589-------
14927.931-------
15028.009-------
15129.229-------
15228.759-------
15328.405-------
15427.945-------
15525.912-------
15626.619-------
15726.07626.143424.924527.36220.45690.22220.05590.2222
15825.28624.710323.050826.36970.24820.05340.40030.0121
15927.6627.78425.88929.6790.4490.99510.11130.8859
16025.95126.325624.206828.44440.36450.10850.40370.393
16126.39827.726225.390530.06190.13250.93180.43180.8236
16225.56527.162524.631629.69330.1080.72310.2560.6631
16328.86528.809226.099231.51910.48390.99050.38070.9434
1643028.528425.649831.4070.15820.40940.43760.9032
16529.26128.25225.213931.29020.25760.12970.46070.854
16629.01228.643825.454231.83340.41050.35230.66620.8933
16726.99226.442723.108529.77680.37340.06550.62250.4587
16827.89727.321323.848630.79410.37260.57370.65410.6541

\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[156]) \tabularnewline
144 & 27.735 & - & - & - & - & - & - & - \tabularnewline
145 & 27.132 & - & - & - & - & - & - & - \tabularnewline
146 & 24.924 & - & - & - & - & - & - & - \tabularnewline
147 & 28.963 & - & - & - & - & - & - & - \tabularnewline
148 & 26.589 & - & - & - & - & - & - & - \tabularnewline
149 & 27.931 & - & - & - & - & - & - & - \tabularnewline
150 & 28.009 & - & - & - & - & - & - & - \tabularnewline
151 & 29.229 & - & - & - & - & - & - & - \tabularnewline
152 & 28.759 & - & - & - & - & - & - & - \tabularnewline
153 & 28.405 & - & - & - & - & - & - & - \tabularnewline
154 & 27.945 & - & - & - & - & - & - & - \tabularnewline
155 & 25.912 & - & - & - & - & - & - & - \tabularnewline
156 & 26.619 & - & - & - & - & - & - & - \tabularnewline
157 & 26.076 & 26.1434 & 24.9245 & 27.3622 & 0.4569 & 0.2222 & 0.0559 & 0.2222 \tabularnewline
158 & 25.286 & 24.7103 & 23.0508 & 26.3697 & 0.2482 & 0.0534 & 0.4003 & 0.0121 \tabularnewline
159 & 27.66 & 27.784 & 25.889 & 29.679 & 0.449 & 0.9951 & 0.1113 & 0.8859 \tabularnewline
160 & 25.951 & 26.3256 & 24.2068 & 28.4444 & 0.3645 & 0.1085 & 0.4037 & 0.393 \tabularnewline
161 & 26.398 & 27.7262 & 25.3905 & 30.0619 & 0.1325 & 0.9318 & 0.4318 & 0.8236 \tabularnewline
162 & 25.565 & 27.1625 & 24.6316 & 29.6933 & 0.108 & 0.7231 & 0.256 & 0.6631 \tabularnewline
163 & 28.865 & 28.8092 & 26.0992 & 31.5191 & 0.4839 & 0.9905 & 0.3807 & 0.9434 \tabularnewline
164 & 30 & 28.5284 & 25.6498 & 31.407 & 0.1582 & 0.4094 & 0.4376 & 0.9032 \tabularnewline
165 & 29.261 & 28.252 & 25.2139 & 31.2902 & 0.2576 & 0.1297 & 0.4607 & 0.854 \tabularnewline
166 & 29.012 & 28.6438 & 25.4542 & 31.8334 & 0.4105 & 0.3523 & 0.6662 & 0.8933 \tabularnewline
167 & 26.992 & 26.4427 & 23.1085 & 29.7768 & 0.3734 & 0.0655 & 0.6225 & 0.4587 \tabularnewline
168 & 27.897 & 27.3213 & 23.8486 & 30.7941 & 0.3726 & 0.5737 & 0.6541 & 0.6541 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151572&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[156])[/C][/ROW]
[ROW][C]144[/C][C]27.735[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]145[/C][C]27.132[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]146[/C][C]24.924[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]147[/C][C]28.963[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]148[/C][C]26.589[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]149[/C][C]27.931[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]150[/C][C]28.009[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]151[/C][C]29.229[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]152[/C][C]28.759[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]153[/C][C]28.405[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]154[/C][C]27.945[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]155[/C][C]25.912[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]156[/C][C]26.619[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]157[/C][C]26.076[/C][C]26.1434[/C][C]24.9245[/C][C]27.3622[/C][C]0.4569[/C][C]0.2222[/C][C]0.0559[/C][C]0.2222[/C][/ROW]
[ROW][C]158[/C][C]25.286[/C][C]24.7103[/C][C]23.0508[/C][C]26.3697[/C][C]0.2482[/C][C]0.0534[/C][C]0.4003[/C][C]0.0121[/C][/ROW]
[ROW][C]159[/C][C]27.66[/C][C]27.784[/C][C]25.889[/C][C]29.679[/C][C]0.449[/C][C]0.9951[/C][C]0.1113[/C][C]0.8859[/C][/ROW]
[ROW][C]160[/C][C]25.951[/C][C]26.3256[/C][C]24.2068[/C][C]28.4444[/C][C]0.3645[/C][C]0.1085[/C][C]0.4037[/C][C]0.393[/C][/ROW]
[ROW][C]161[/C][C]26.398[/C][C]27.7262[/C][C]25.3905[/C][C]30.0619[/C][C]0.1325[/C][C]0.9318[/C][C]0.4318[/C][C]0.8236[/C][/ROW]
[ROW][C]162[/C][C]25.565[/C][C]27.1625[/C][C]24.6316[/C][C]29.6933[/C][C]0.108[/C][C]0.7231[/C][C]0.256[/C][C]0.6631[/C][/ROW]
[ROW][C]163[/C][C]28.865[/C][C]28.8092[/C][C]26.0992[/C][C]31.5191[/C][C]0.4839[/C][C]0.9905[/C][C]0.3807[/C][C]0.9434[/C][/ROW]
[ROW][C]164[/C][C]30[/C][C]28.5284[/C][C]25.6498[/C][C]31.407[/C][C]0.1582[/C][C]0.4094[/C][C]0.4376[/C][C]0.9032[/C][/ROW]
[ROW][C]165[/C][C]29.261[/C][C]28.252[/C][C]25.2139[/C][C]31.2902[/C][C]0.2576[/C][C]0.1297[/C][C]0.4607[/C][C]0.854[/C][/ROW]
[ROW][C]166[/C][C]29.012[/C][C]28.6438[/C][C]25.4542[/C][C]31.8334[/C][C]0.4105[/C][C]0.3523[/C][C]0.6662[/C][C]0.8933[/C][/ROW]
[ROW][C]167[/C][C]26.992[/C][C]26.4427[/C][C]23.1085[/C][C]29.7768[/C][C]0.3734[/C][C]0.0655[/C][C]0.6225[/C][C]0.4587[/C][/ROW]
[ROW][C]168[/C][C]27.897[/C][C]27.3213[/C][C]23.8486[/C][C]30.7941[/C][C]0.3726[/C][C]0.5737[/C][C]0.6541[/C][C]0.6541[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151572&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151572&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[156])
14427.735-------
14527.132-------
14624.924-------
14728.963-------
14826.589-------
14927.931-------
15028.009-------
15129.229-------
15228.759-------
15328.405-------
15427.945-------
15525.912-------
15626.619-------
15726.07626.143424.924527.36220.45690.22220.05590.2222
15825.28624.710323.050826.36970.24820.05340.40030.0121
15927.6627.78425.88929.6790.4490.99510.11130.8859
16025.95126.325624.206828.44440.36450.10850.40370.393
16126.39827.726225.390530.06190.13250.93180.43180.8236
16225.56527.162524.631629.69330.1080.72310.2560.6631
16328.86528.809226.099231.51910.48390.99050.38070.9434
1643028.528425.649831.4070.15820.40940.43760.9032
16529.26128.25225.213931.29020.25760.12970.46070.854
16629.01228.643825.454231.83340.41050.35230.66620.8933
16726.99226.442723.108529.77680.37340.06550.62250.4587
16827.89727.321323.848630.79410.37260.57370.65410.6541







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1570.0238-0.002600.004500
1580.03430.02330.01290.33150.1680.4099
1590.0348-0.00450.01010.01540.11710.3422
1600.0411-0.01420.01110.14030.12290.3506
1610.043-0.04790.01851.76410.45110.6717
1620.0475-0.05880.02522.55190.80130.8951
1630.0480.00190.02190.00310.68730.829
1640.05150.05160.02562.16560.8720.9338
1650.05490.03570.02671.0180.88830.9425
1660.05680.01290.02530.13560.8130.9017
1670.06430.02080.02490.30180.76650.8755
1680.06490.02110.02460.33140.73030.8545

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
157 & 0.0238 & -0.0026 & 0 & 0.0045 & 0 & 0 \tabularnewline
158 & 0.0343 & 0.0233 & 0.0129 & 0.3315 & 0.168 & 0.4099 \tabularnewline
159 & 0.0348 & -0.0045 & 0.0101 & 0.0154 & 0.1171 & 0.3422 \tabularnewline
160 & 0.0411 & -0.0142 & 0.0111 & 0.1403 & 0.1229 & 0.3506 \tabularnewline
161 & 0.043 & -0.0479 & 0.0185 & 1.7641 & 0.4511 & 0.6717 \tabularnewline
162 & 0.0475 & -0.0588 & 0.0252 & 2.5519 & 0.8013 & 0.8951 \tabularnewline
163 & 0.048 & 0.0019 & 0.0219 & 0.0031 & 0.6873 & 0.829 \tabularnewline
164 & 0.0515 & 0.0516 & 0.0256 & 2.1656 & 0.872 & 0.9338 \tabularnewline
165 & 0.0549 & 0.0357 & 0.0267 & 1.018 & 0.8883 & 0.9425 \tabularnewline
166 & 0.0568 & 0.0129 & 0.0253 & 0.1356 & 0.813 & 0.9017 \tabularnewline
167 & 0.0643 & 0.0208 & 0.0249 & 0.3018 & 0.7665 & 0.8755 \tabularnewline
168 & 0.0649 & 0.0211 & 0.0246 & 0.3314 & 0.7303 & 0.8545 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151572&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]157[/C][C]0.0238[/C][C]-0.0026[/C][C]0[/C][C]0.0045[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]158[/C][C]0.0343[/C][C]0.0233[/C][C]0.0129[/C][C]0.3315[/C][C]0.168[/C][C]0.4099[/C][/ROW]
[ROW][C]159[/C][C]0.0348[/C][C]-0.0045[/C][C]0.0101[/C][C]0.0154[/C][C]0.1171[/C][C]0.3422[/C][/ROW]
[ROW][C]160[/C][C]0.0411[/C][C]-0.0142[/C][C]0.0111[/C][C]0.1403[/C][C]0.1229[/C][C]0.3506[/C][/ROW]
[ROW][C]161[/C][C]0.043[/C][C]-0.0479[/C][C]0.0185[/C][C]1.7641[/C][C]0.4511[/C][C]0.6717[/C][/ROW]
[ROW][C]162[/C][C]0.0475[/C][C]-0.0588[/C][C]0.0252[/C][C]2.5519[/C][C]0.8013[/C][C]0.8951[/C][/ROW]
[ROW][C]163[/C][C]0.048[/C][C]0.0019[/C][C]0.0219[/C][C]0.0031[/C][C]0.6873[/C][C]0.829[/C][/ROW]
[ROW][C]164[/C][C]0.0515[/C][C]0.0516[/C][C]0.0256[/C][C]2.1656[/C][C]0.872[/C][C]0.9338[/C][/ROW]
[ROW][C]165[/C][C]0.0549[/C][C]0.0357[/C][C]0.0267[/C][C]1.018[/C][C]0.8883[/C][C]0.9425[/C][/ROW]
[ROW][C]166[/C][C]0.0568[/C][C]0.0129[/C][C]0.0253[/C][C]0.1356[/C][C]0.813[/C][C]0.9017[/C][/ROW]
[ROW][C]167[/C][C]0.0643[/C][C]0.0208[/C][C]0.0249[/C][C]0.3018[/C][C]0.7665[/C][C]0.8755[/C][/ROW]
[ROW][C]168[/C][C]0.0649[/C][C]0.0211[/C][C]0.0246[/C][C]0.3314[/C][C]0.7303[/C][C]0.8545[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151572&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151572&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
1570.0238-0.002600.004500
1580.03430.02330.01290.33150.1680.4099
1590.0348-0.00450.01010.01540.11710.3422
1600.0411-0.01420.01110.14030.12290.3506
1610.043-0.04790.01851.76410.45110.6717
1620.0475-0.05880.02522.55190.80130.8951
1630.0480.00190.02190.00310.68730.829
1640.05150.05160.02562.16560.8720.9338
1650.05490.03570.02671.0180.88830.9425
1660.05680.01290.02530.13560.8130.9017
1670.06430.02080.02490.30180.76650.8755
1680.06490.02110.02460.33140.73030.8545



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