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 computationThu, 16 Dec 2010 20:55:17 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/16/t1292532813218f1qjgpzl3cip.htm/, Retrieved Fri, 03 May 2024 13:17:14 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=111282, Retrieved Fri, 03 May 2024 13:17:14 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact146
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [estimation of ARM...] [2007-12-06 10:08:23] [dc28704e2f48edede7e5c93fa6811a5e]
- RMPD  [ARIMA Forecasting] [Forecasting beste...] [2009-12-14 19:02:57] [54d83950395cfb8ca1091bdb7440f70a]
-   PD    [ARIMA Forecasting] [] [2010-12-14 19:44:34] [1ec36cc0fd92fd0f07d0b885ce2c369b]
- R PD        [ARIMA Forecasting] [] [2010-12-16 20:55:17] [e7b77eb06cdf8868fc9cf2043e42b3da] [Current]
Feedback Forum

Post a new message
Dataseries X:
4.785
4.109
4.026
4.44
3.828
3.953
4.801
4.104
4.57
4.411
4.839
4.736
3.83
4.248
5.657
3.809
4.578
4.3
5.103
4.121
4.205
5.116
4.219
4.736
4.625
4.146
5.299
5.011
4.731
4.619
5.578
5.369
4.904
6.102
5.04
5.731
5.732
4.491
4.755
5.208
4.962
4.163
5.592
5.761
4.929
5.219
4.429
4.143
4.308
3.996
4.634
4.138
3.759
3.922
5.56
4.004
3.937
5.25
3.908
4.814
4.407
3.243
3.74
3.949
3.711
3.796
4.145
3.499
4.164
3.902
3.186
3.353
3.475
3.032
3.341
3.811
3.655
4.058
3.682
3.348
3.848
3.289
3.851
2.766
2.837
2.734
3.764
3.215
3.287
3.507
3.06
3.734
3.849
4.404
3.497
3.389
2.944
3.098
3.48
3.353
3.958
3.504
3.446
3.794
3.676
4.159
3.914
3.595




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111282&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]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111282&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111282&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'RServer@AstonUniversity' @ vre.aston.ac.uk







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[96])
842.766-------
852.837-------
862.734-------
873.764-------
883.215-------
893.287-------
903.507-------
913.06-------
923.734-------
933.849-------
944.404-------
953.497-------
963.389-------
972.9443.6122.83934.59490.09140.67170.93890.6717
983.0983.59172.81084.58960.16610.89830.9540.6547
993.483.59352.78944.62940.4150.82570.37350.6506
1003.3533.59332.76844.66410.330.58220.75570.6458
1013.9583.59332.74814.69850.25890.6650.70650.6415
1023.5043.59332.72864.73220.43890.26510.55910.6375
1033.4463.59332.70964.76520.40270.55940.81380.6337
1043.7943.59332.69134.79770.3720.59470.40950.6303
1053.6763.59332.67354.82970.44790.37520.34260.627
1064.1593.59332.65624.86110.19090.44920.10510.624
1073.9143.59332.63944.89210.31420.19670.55780.6211
1083.5953.59332.6234.92270.4990.31820.61840.6184

\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[96]) \tabularnewline
84 & 2.766 & - & - & - & - & - & - & - \tabularnewline
85 & 2.837 & - & - & - & - & - & - & - \tabularnewline
86 & 2.734 & - & - & - & - & - & - & - \tabularnewline
87 & 3.764 & - & - & - & - & - & - & - \tabularnewline
88 & 3.215 & - & - & - & - & - & - & - \tabularnewline
89 & 3.287 & - & - & - & - & - & - & - \tabularnewline
90 & 3.507 & - & - & - & - & - & - & - \tabularnewline
91 & 3.06 & - & - & - & - & - & - & - \tabularnewline
92 & 3.734 & - & - & - & - & - & - & - \tabularnewline
93 & 3.849 & - & - & - & - & - & - & - \tabularnewline
94 & 4.404 & - & - & - & - & - & - & - \tabularnewline
95 & 3.497 & - & - & - & - & - & - & - \tabularnewline
96 & 3.389 & - & - & - & - & - & - & - \tabularnewline
97 & 2.944 & 3.612 & 2.8393 & 4.5949 & 0.0914 & 0.6717 & 0.9389 & 0.6717 \tabularnewline
98 & 3.098 & 3.5917 & 2.8108 & 4.5896 & 0.1661 & 0.8983 & 0.954 & 0.6547 \tabularnewline
99 & 3.48 & 3.5935 & 2.7894 & 4.6294 & 0.415 & 0.8257 & 0.3735 & 0.6506 \tabularnewline
100 & 3.353 & 3.5933 & 2.7684 & 4.6641 & 0.33 & 0.5822 & 0.7557 & 0.6458 \tabularnewline
101 & 3.958 & 3.5933 & 2.7481 & 4.6985 & 0.2589 & 0.665 & 0.7065 & 0.6415 \tabularnewline
102 & 3.504 & 3.5933 & 2.7286 & 4.7322 & 0.4389 & 0.2651 & 0.5591 & 0.6375 \tabularnewline
103 & 3.446 & 3.5933 & 2.7096 & 4.7652 & 0.4027 & 0.5594 & 0.8138 & 0.6337 \tabularnewline
104 & 3.794 & 3.5933 & 2.6913 & 4.7977 & 0.372 & 0.5947 & 0.4095 & 0.6303 \tabularnewline
105 & 3.676 & 3.5933 & 2.6735 & 4.8297 & 0.4479 & 0.3752 & 0.3426 & 0.627 \tabularnewline
106 & 4.159 & 3.5933 & 2.6562 & 4.8611 & 0.1909 & 0.4492 & 0.1051 & 0.624 \tabularnewline
107 & 3.914 & 3.5933 & 2.6394 & 4.8921 & 0.3142 & 0.1967 & 0.5578 & 0.6211 \tabularnewline
108 & 3.595 & 3.5933 & 2.623 & 4.9227 & 0.499 & 0.3182 & 0.6184 & 0.6184 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111282&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[96])[/C][/ROW]
[ROW][C]84[/C][C]2.766[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]2.837[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]2.734[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]3.764[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]3.215[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]3.287[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]3.507[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]3.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]3.734[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]3.849[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]4.404[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]3.497[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]3.389[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2.944[/C][C]3.612[/C][C]2.8393[/C][C]4.5949[/C][C]0.0914[/C][C]0.6717[/C][C]0.9389[/C][C]0.6717[/C][/ROW]
[ROW][C]98[/C][C]3.098[/C][C]3.5917[/C][C]2.8108[/C][C]4.5896[/C][C]0.1661[/C][C]0.8983[/C][C]0.954[/C][C]0.6547[/C][/ROW]
[ROW][C]99[/C][C]3.48[/C][C]3.5935[/C][C]2.7894[/C][C]4.6294[/C][C]0.415[/C][C]0.8257[/C][C]0.3735[/C][C]0.6506[/C][/ROW]
[ROW][C]100[/C][C]3.353[/C][C]3.5933[/C][C]2.7684[/C][C]4.6641[/C][C]0.33[/C][C]0.5822[/C][C]0.7557[/C][C]0.6458[/C][/ROW]
[ROW][C]101[/C][C]3.958[/C][C]3.5933[/C][C]2.7481[/C][C]4.6985[/C][C]0.2589[/C][C]0.665[/C][C]0.7065[/C][C]0.6415[/C][/ROW]
[ROW][C]102[/C][C]3.504[/C][C]3.5933[/C][C]2.7286[/C][C]4.7322[/C][C]0.4389[/C][C]0.2651[/C][C]0.5591[/C][C]0.6375[/C][/ROW]
[ROW][C]103[/C][C]3.446[/C][C]3.5933[/C][C]2.7096[/C][C]4.7652[/C][C]0.4027[/C][C]0.5594[/C][C]0.8138[/C][C]0.6337[/C][/ROW]
[ROW][C]104[/C][C]3.794[/C][C]3.5933[/C][C]2.6913[/C][C]4.7977[/C][C]0.372[/C][C]0.5947[/C][C]0.4095[/C][C]0.6303[/C][/ROW]
[ROW][C]105[/C][C]3.676[/C][C]3.5933[/C][C]2.6735[/C][C]4.8297[/C][C]0.4479[/C][C]0.3752[/C][C]0.3426[/C][C]0.627[/C][/ROW]
[ROW][C]106[/C][C]4.159[/C][C]3.5933[/C][C]2.6562[/C][C]4.8611[/C][C]0.1909[/C][C]0.4492[/C][C]0.1051[/C][C]0.624[/C][/ROW]
[ROW][C]107[/C][C]3.914[/C][C]3.5933[/C][C]2.6394[/C][C]4.8921[/C][C]0.3142[/C][C]0.1967[/C][C]0.5578[/C][C]0.6211[/C][/ROW]
[ROW][C]108[/C][C]3.595[/C][C]3.5933[/C][C]2.623[/C][C]4.9227[/C][C]0.499[/C][C]0.3182[/C][C]0.6184[/C][C]0.6184[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111282&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111282&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[96])
842.766-------
852.837-------
862.734-------
873.764-------
883.215-------
893.287-------
903.507-------
913.06-------
923.734-------
933.849-------
944.404-------
953.497-------
963.389-------
972.9443.6122.83934.59490.09140.67170.93890.6717
983.0983.59172.81084.58960.16610.89830.9540.6547
993.483.59352.78944.62940.4150.82570.37350.6506
1003.3533.59332.76844.66410.330.58220.75570.6458
1013.9583.59332.74814.69850.25890.6650.70650.6415
1023.5043.59332.72864.73220.43890.26510.55910.6375
1033.4463.59332.70964.76520.40270.55940.81380.6337
1043.7943.59332.69134.79770.3720.59470.40950.6303
1053.6763.59332.67354.82970.44790.37520.34260.627
1064.1593.59332.65624.86110.19090.44920.10510.624
1073.9143.59332.63944.89210.31420.19670.55780.6211
1083.5953.59332.6234.92270.4990.31820.61840.6184







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
970.1388-0.184900.446200
980.1417-0.13750.16120.24370.3450.5873
990.1471-0.03160.1180.01290.23430.484
1000.152-0.06690.10520.05780.19010.436
1010.15690.10150.10450.1330.17870.4227
1020.1617-0.02490.09120.0080.15030.3876
1030.1664-0.0410.0840.02170.13190.3632
1040.1710.05580.08050.04030.12040.347
1050.17550.0230.07410.00680.10780.3284
1060.180.15740.08240.320.1290.3592
1070.18440.08920.08310.10280.12660.3559
1080.18875e-040.076200.11610.3407

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
97 & 0.1388 & -0.1849 & 0 & 0.4462 & 0 & 0 \tabularnewline
98 & 0.1417 & -0.1375 & 0.1612 & 0.2437 & 0.345 & 0.5873 \tabularnewline
99 & 0.1471 & -0.0316 & 0.118 & 0.0129 & 0.2343 & 0.484 \tabularnewline
100 & 0.152 & -0.0669 & 0.1052 & 0.0578 & 0.1901 & 0.436 \tabularnewline
101 & 0.1569 & 0.1015 & 0.1045 & 0.133 & 0.1787 & 0.4227 \tabularnewline
102 & 0.1617 & -0.0249 & 0.0912 & 0.008 & 0.1503 & 0.3876 \tabularnewline
103 & 0.1664 & -0.041 & 0.084 & 0.0217 & 0.1319 & 0.3632 \tabularnewline
104 & 0.171 & 0.0558 & 0.0805 & 0.0403 & 0.1204 & 0.347 \tabularnewline
105 & 0.1755 & 0.023 & 0.0741 & 0.0068 & 0.1078 & 0.3284 \tabularnewline
106 & 0.18 & 0.1574 & 0.0824 & 0.32 & 0.129 & 0.3592 \tabularnewline
107 & 0.1844 & 0.0892 & 0.0831 & 0.1028 & 0.1266 & 0.3559 \tabularnewline
108 & 0.1887 & 5e-04 & 0.0762 & 0 & 0.1161 & 0.3407 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=111282&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]97[/C][C]0.1388[/C][C]-0.1849[/C][C]0[/C][C]0.4462[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]98[/C][C]0.1417[/C][C]-0.1375[/C][C]0.1612[/C][C]0.2437[/C][C]0.345[/C][C]0.5873[/C][/ROW]
[ROW][C]99[/C][C]0.1471[/C][C]-0.0316[/C][C]0.118[/C][C]0.0129[/C][C]0.2343[/C][C]0.484[/C][/ROW]
[ROW][C]100[/C][C]0.152[/C][C]-0.0669[/C][C]0.1052[/C][C]0.0578[/C][C]0.1901[/C][C]0.436[/C][/ROW]
[ROW][C]101[/C][C]0.1569[/C][C]0.1015[/C][C]0.1045[/C][C]0.133[/C][C]0.1787[/C][C]0.4227[/C][/ROW]
[ROW][C]102[/C][C]0.1617[/C][C]-0.0249[/C][C]0.0912[/C][C]0.008[/C][C]0.1503[/C][C]0.3876[/C][/ROW]
[ROW][C]103[/C][C]0.1664[/C][C]-0.041[/C][C]0.084[/C][C]0.0217[/C][C]0.1319[/C][C]0.3632[/C][/ROW]
[ROW][C]104[/C][C]0.171[/C][C]0.0558[/C][C]0.0805[/C][C]0.0403[/C][C]0.1204[/C][C]0.347[/C][/ROW]
[ROW][C]105[/C][C]0.1755[/C][C]0.023[/C][C]0.0741[/C][C]0.0068[/C][C]0.1078[/C][C]0.3284[/C][/ROW]
[ROW][C]106[/C][C]0.18[/C][C]0.1574[/C][C]0.0824[/C][C]0.32[/C][C]0.129[/C][C]0.3592[/C][/ROW]
[ROW][C]107[/C][C]0.1844[/C][C]0.0892[/C][C]0.0831[/C][C]0.1028[/C][C]0.1266[/C][C]0.3559[/C][/ROW]
[ROW][C]108[/C][C]0.1887[/C][C]5e-04[/C][C]0.0762[/C][C]0[/C][C]0.1161[/C][C]0.3407[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=111282&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=111282&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
970.1388-0.184900.446200
980.1417-0.13750.16120.24370.3450.5873
990.1471-0.03160.1180.01290.23430.484
1000.152-0.06690.10520.05780.19010.436
1010.15690.10150.10450.1330.17870.4227
1020.1617-0.02490.09120.0080.15030.3876
1030.1664-0.0410.0840.02170.13190.3632
1040.1710.05580.08050.04030.12040.347
1050.17550.0230.07410.00680.10780.3284
1060.180.15740.08240.320.1290.3592
1070.18440.08920.08310.10280.12660.3559
1080.18875e-040.076200.11610.3407



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