Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Module--
Title produced by softwareARIMA Forecasting
Date of computationFri, 21 Dec 2012 15:57:01 -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/2012/Dec/21/t1356123451h25jpxmrxyi8ft1.htm/, Retrieved Fri, 01 Nov 2024 01:04:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=204282, Retrieved Fri, 01 Nov 2024 01:04:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact106
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-12 13:32:37] [76963dc1903f0f612b6153510a3818cf]
- R  D  [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-17 12:14:40] [76963dc1903f0f612b6153510a3818cf]
-         [Univariate Explorative Data Analysis] [Run Sequence Plot...] [2008-12-22 18:19:51] [1ce0d16c8f4225c977b42c8fa93bc163]
- RMP       [Univariate Data Series] [Identifying Integ...] [2009-11-22 12:08:06] [b98453cac15ba1066b407e146608df68]
- RMP         [Standard Deviation-Mean Plot] [Births] [2010-11-29 10:52:49] [b98453cac15ba1066b407e146608df68]
- RMP           [ARIMA Forecasting] [Births] [2010-11-29 20:53:49] [b98453cac15ba1066b407e146608df68]
- R               [ARIMA Forecasting] [paper arima 7] [2012-12-11 15:33:37] [dbae308bdff61c0f4902cc85498d0d35]
-  M                  [ARIMA Forecasting] [] [2012-12-21 20:57:01] [d41d8cd98f00b204e9800998ecf8427e] [Current]
Feedback Forum

Post a new message
Dataseries X:
9700
9081
9084
9743
8587
9731
9563
9998
9437
10038
9918
9252
9737
9035
9133
9487
8700
9627
8947
9283
8829
9947
9628
9318
9605
8640
9214
9567
8547
9185
9470
9123
9278
10170
9434
9655
9429
8739
9552
9687
9019
9672
9206
9069
9788
10312
10105
9863
9656
9295
9946
9701
9049
10190
9706
9765
9893
9994
10433
10073
10112
9266
9820
10097
9115
10411
9678
10408
10153
10368
10581
10597
10680
9738
9556




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ jenkins.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 & 2 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=204282&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' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=204282&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=204282&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' @ jenkins.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[63])
519946-------
529701-------
539049-------
5410190-------
559706-------
569765-------
579893-------
589994-------
5910433-------
6010073-------
6110112-------
629266-------
639820-------
64100979912.80679376.358110449.25540.25050.63270.78050.6327
6591159130.03788584.67929675.39640.47843e-040.61460.0066
661041110157.53079603.893310711.16820.18480.99990.45420.8839
6796789769.07949207.749410330.40940.37520.01250.58720.4294
68104089851.16339282.687510419.6390.02740.72480.61680.5428
69101539869.82999294.720410444.93950.16730.03330.46850.5674
701036810241.74679660.48410823.00940.33520.61760.79830.9225
711058110358.03969771.076910945.00220.22830.48670.40120.9638
721059710012.00259419.768210604.23690.02640.02980.420.7374
731068010082.93339489.428210676.43840.02430.04480.46180.8074
7497389313.93588715.67389912.19770.082400.56240.0487
7595569783.04369180.33210385.75520.23020.55820.45220.4522

\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[63]) \tabularnewline
51 & 9946 & - & - & - & - & - & - & - \tabularnewline
52 & 9701 & - & - & - & - & - & - & - \tabularnewline
53 & 9049 & - & - & - & - & - & - & - \tabularnewline
54 & 10190 & - & - & - & - & - & - & - \tabularnewline
55 & 9706 & - & - & - & - & - & - & - \tabularnewline
56 & 9765 & - & - & - & - & - & - & - \tabularnewline
57 & 9893 & - & - & - & - & - & - & - \tabularnewline
58 & 9994 & - & - & - & - & - & - & - \tabularnewline
59 & 10433 & - & - & - & - & - & - & - \tabularnewline
60 & 10073 & - & - & - & - & - & - & - \tabularnewline
61 & 10112 & - & - & - & - & - & - & - \tabularnewline
62 & 9266 & - & - & - & - & - & - & - \tabularnewline
63 & 9820 & - & - & - & - & - & - & - \tabularnewline
64 & 10097 & 9912.8067 & 9376.3581 & 10449.2554 & 0.2505 & 0.6327 & 0.7805 & 0.6327 \tabularnewline
65 & 9115 & 9130.0378 & 8584.6792 & 9675.3964 & 0.4784 & 3e-04 & 0.6146 & 0.0066 \tabularnewline
66 & 10411 & 10157.5307 & 9603.8933 & 10711.1682 & 0.1848 & 0.9999 & 0.4542 & 0.8839 \tabularnewline
67 & 9678 & 9769.0794 & 9207.7494 & 10330.4094 & 0.3752 & 0.0125 & 0.5872 & 0.4294 \tabularnewline
68 & 10408 & 9851.1633 & 9282.6875 & 10419.639 & 0.0274 & 0.7248 & 0.6168 & 0.5428 \tabularnewline
69 & 10153 & 9869.8299 & 9294.7204 & 10444.9395 & 0.1673 & 0.0333 & 0.4685 & 0.5674 \tabularnewline
70 & 10368 & 10241.7467 & 9660.484 & 10823.0094 & 0.3352 & 0.6176 & 0.7983 & 0.9225 \tabularnewline
71 & 10581 & 10358.0396 & 9771.0769 & 10945.0022 & 0.2283 & 0.4867 & 0.4012 & 0.9638 \tabularnewline
72 & 10597 & 10012.0025 & 9419.7682 & 10604.2369 & 0.0264 & 0.0298 & 0.42 & 0.7374 \tabularnewline
73 & 10680 & 10082.9333 & 9489.4282 & 10676.4384 & 0.0243 & 0.0448 & 0.4618 & 0.8074 \tabularnewline
74 & 9738 & 9313.9358 & 8715.6738 & 9912.1977 & 0.0824 & 0 & 0.5624 & 0.0487 \tabularnewline
75 & 9556 & 9783.0436 & 9180.332 & 10385.7552 & 0.2302 & 0.5582 & 0.4522 & 0.4522 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=204282&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[63])[/C][/ROW]
[ROW][C]51[/C][C]9946[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]9701[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]9049[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]10190[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]9706[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]9765[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]9893[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]9994[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]10433[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]10073[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]10112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]9266[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]9820[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]10097[/C][C]9912.8067[/C][C]9376.3581[/C][C]10449.2554[/C][C]0.2505[/C][C]0.6327[/C][C]0.7805[/C][C]0.6327[/C][/ROW]
[ROW][C]65[/C][C]9115[/C][C]9130.0378[/C][C]8584.6792[/C][C]9675.3964[/C][C]0.4784[/C][C]3e-04[/C][C]0.6146[/C][C]0.0066[/C][/ROW]
[ROW][C]66[/C][C]10411[/C][C]10157.5307[/C][C]9603.8933[/C][C]10711.1682[/C][C]0.1848[/C][C]0.9999[/C][C]0.4542[/C][C]0.8839[/C][/ROW]
[ROW][C]67[/C][C]9678[/C][C]9769.0794[/C][C]9207.7494[/C][C]10330.4094[/C][C]0.3752[/C][C]0.0125[/C][C]0.5872[/C][C]0.4294[/C][/ROW]
[ROW][C]68[/C][C]10408[/C][C]9851.1633[/C][C]9282.6875[/C][C]10419.639[/C][C]0.0274[/C][C]0.7248[/C][C]0.6168[/C][C]0.5428[/C][/ROW]
[ROW][C]69[/C][C]10153[/C][C]9869.8299[/C][C]9294.7204[/C][C]10444.9395[/C][C]0.1673[/C][C]0.0333[/C][C]0.4685[/C][C]0.5674[/C][/ROW]
[ROW][C]70[/C][C]10368[/C][C]10241.7467[/C][C]9660.484[/C][C]10823.0094[/C][C]0.3352[/C][C]0.6176[/C][C]0.7983[/C][C]0.9225[/C][/ROW]
[ROW][C]71[/C][C]10581[/C][C]10358.0396[/C][C]9771.0769[/C][C]10945.0022[/C][C]0.2283[/C][C]0.4867[/C][C]0.4012[/C][C]0.9638[/C][/ROW]
[ROW][C]72[/C][C]10597[/C][C]10012.0025[/C][C]9419.7682[/C][C]10604.2369[/C][C]0.0264[/C][C]0.0298[/C][C]0.42[/C][C]0.7374[/C][/ROW]
[ROW][C]73[/C][C]10680[/C][C]10082.9333[/C][C]9489.4282[/C][C]10676.4384[/C][C]0.0243[/C][C]0.0448[/C][C]0.4618[/C][C]0.8074[/C][/ROW]
[ROW][C]74[/C][C]9738[/C][C]9313.9358[/C][C]8715.6738[/C][C]9912.1977[/C][C]0.0824[/C][C]0[/C][C]0.5624[/C][C]0.0487[/C][/ROW]
[ROW][C]75[/C][C]9556[/C][C]9783.0436[/C][C]9180.332[/C][C]10385.7552[/C][C]0.2302[/C][C]0.5582[/C][C]0.4522[/C][C]0.4522[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=204282&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=204282&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[63])
519946-------
529701-------
539049-------
5410190-------
559706-------
569765-------
579893-------
589994-------
5910433-------
6010073-------
6110112-------
629266-------
639820-------
64100979912.80679376.358110449.25540.25050.63270.78050.6327
6591159130.03788584.67929675.39640.47843e-040.61460.0066
661041110157.53079603.893310711.16820.18480.99990.45420.8839
6796789769.07949207.749410330.40940.37520.01250.58720.4294
68104089851.16339282.687510419.6390.02740.72480.61680.5428
69101539869.82999294.720410444.93950.16730.03330.46850.5674
701036810241.74679660.48410823.00940.33520.61760.79830.9225
711058110358.03969771.076910945.00220.22830.48670.40120.9638
721059710012.00259419.768210604.23690.02640.02980.420.7374
731068010082.93339489.428210676.43840.02430.04480.46180.8074
7497389313.93588715.67389912.19770.082400.56240.0487
7595569783.04369180.33210385.75520.23020.55820.45220.4522







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
640.02760.0186033927.155400
650.0305-0.00160.0101226.135317076.6453130.6776
660.02780.0250.015164246.664932799.9852181.1077
670.0293-0.00930.01368295.454926673.8526163.3213
680.02940.05650.0222310067.14683352.5113288.7083
690.02970.02870.023380185.284582824.6402287.7927
700.0290.01230.021715939.898573269.6771270.6837
710.02890.02150.021749711.353370324.8866265.1884
720.03020.05840.0258342222.0556100535.6831317.0736
730.030.05920.0291356488.6306126130.9779355.1492
740.03280.04550.0306179830.4573131012.7487361.9568
750.0314-0.02320.0351548.7974124390.7528352.6907

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
64 & 0.0276 & 0.0186 & 0 & 33927.1554 & 0 & 0 \tabularnewline
65 & 0.0305 & -0.0016 & 0.0101 & 226.1353 & 17076.6453 & 130.6776 \tabularnewline
66 & 0.0278 & 0.025 & 0.0151 & 64246.6649 & 32799.9852 & 181.1077 \tabularnewline
67 & 0.0293 & -0.0093 & 0.0136 & 8295.4549 & 26673.8526 & 163.3213 \tabularnewline
68 & 0.0294 & 0.0565 & 0.0222 & 310067.146 & 83352.5113 & 288.7083 \tabularnewline
69 & 0.0297 & 0.0287 & 0.0233 & 80185.2845 & 82824.6402 & 287.7927 \tabularnewline
70 & 0.029 & 0.0123 & 0.0217 & 15939.8985 & 73269.6771 & 270.6837 \tabularnewline
71 & 0.0289 & 0.0215 & 0.0217 & 49711.3533 & 70324.8866 & 265.1884 \tabularnewline
72 & 0.0302 & 0.0584 & 0.0258 & 342222.0556 & 100535.6831 & 317.0736 \tabularnewline
73 & 0.03 & 0.0592 & 0.0291 & 356488.6306 & 126130.9779 & 355.1492 \tabularnewline
74 & 0.0328 & 0.0455 & 0.0306 & 179830.4573 & 131012.7487 & 361.9568 \tabularnewline
75 & 0.0314 & -0.0232 & 0.03 & 51548.7974 & 124390.7528 & 352.6907 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=204282&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]64[/C][C]0.0276[/C][C]0.0186[/C][C]0[/C][C]33927.1554[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]65[/C][C]0.0305[/C][C]-0.0016[/C][C]0.0101[/C][C]226.1353[/C][C]17076.6453[/C][C]130.6776[/C][/ROW]
[ROW][C]66[/C][C]0.0278[/C][C]0.025[/C][C]0.0151[/C][C]64246.6649[/C][C]32799.9852[/C][C]181.1077[/C][/ROW]
[ROW][C]67[/C][C]0.0293[/C][C]-0.0093[/C][C]0.0136[/C][C]8295.4549[/C][C]26673.8526[/C][C]163.3213[/C][/ROW]
[ROW][C]68[/C][C]0.0294[/C][C]0.0565[/C][C]0.0222[/C][C]310067.146[/C][C]83352.5113[/C][C]288.7083[/C][/ROW]
[ROW][C]69[/C][C]0.0297[/C][C]0.0287[/C][C]0.0233[/C][C]80185.2845[/C][C]82824.6402[/C][C]287.7927[/C][/ROW]
[ROW][C]70[/C][C]0.029[/C][C]0.0123[/C][C]0.0217[/C][C]15939.8985[/C][C]73269.6771[/C][C]270.6837[/C][/ROW]
[ROW][C]71[/C][C]0.0289[/C][C]0.0215[/C][C]0.0217[/C][C]49711.3533[/C][C]70324.8866[/C][C]265.1884[/C][/ROW]
[ROW][C]72[/C][C]0.0302[/C][C]0.0584[/C][C]0.0258[/C][C]342222.0556[/C][C]100535.6831[/C][C]317.0736[/C][/ROW]
[ROW][C]73[/C][C]0.03[/C][C]0.0592[/C][C]0.0291[/C][C]356488.6306[/C][C]126130.9779[/C][C]355.1492[/C][/ROW]
[ROW][C]74[/C][C]0.0328[/C][C]0.0455[/C][C]0.0306[/C][C]179830.4573[/C][C]131012.7487[/C][C]361.9568[/C][/ROW]
[ROW][C]75[/C][C]0.0314[/C][C]-0.0232[/C][C]0.03[/C][C]51548.7974[/C][C]124390.7528[/C][C]352.6907[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=204282&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=204282&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
640.02760.0186033927.155400
650.0305-0.00160.0101226.135317076.6453130.6776
660.02780.0250.015164246.664932799.9852181.1077
670.0293-0.00930.01368295.454926673.8526163.3213
680.02940.05650.0222310067.14683352.5113288.7083
690.02970.02870.023380185.284582824.6402287.7927
700.0290.01230.021715939.898573269.6771270.6837
710.02890.02150.021749711.353370324.8866265.1884
720.03020.05840.0258342222.0556100535.6831317.0736
730.030.05920.0291356488.6306126130.9779355.1492
740.03280.04550.0306179830.4573131012.7487361.9568
750.0314-0.02320.0351548.7974124390.7528352.6907



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ; par11 = ; par12 = ; par13 = ; par14 = ; par15 = ; par16 = ; par17 = ; par18 = ; par19 = ; par20 = ;
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')