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, 10 Dec 2009 13:00:36 -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/2009/Dec/10/t1260475274ojo41m1qm1pjnvo.htm/, Retrieved Fri, 26 Apr 2024 18:52:17 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65768, Retrieved Fri, 26 Apr 2024 18:52:17 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact131
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [ws 10] [2009-12-04 22:28:42] [6e4e01d7eb22a9f33d58ebb35753a195]
-   PD    [ARIMA Forecasting] [workshop 10 berek...] [2009-12-10 20:00:36] [78d370e6d5f4594e9982a5085e7604c6] [Current]
-   PD      [ARIMA Forecasting] [workshop 10] [2009-12-11 12:07:20] [eaf42bcf5162b5692bb3c7f9d4636222]
Feedback Forum

Post a new message
Dataseries X:
4716.99
4926.65
4920.10
5170.09
5246.24
5283.61
4979.05
4825.20
4695.12
4711.54
4727.22
4384.96
4378.75
4472.93
4564.07
4310.54
4171.38
4049.38
3591.37
3720.46
4107.23
4101.71
4162.34
4136.22
4125.88
4031.48
3761.36
3408.56
3228.47
3090.45
2741.14
2980.44
3104.33
3181.57
2863.86
2898.01
3112.33
3254.33
3513.47
3587.61
3727.45
3793.34
3817.58
3845.13
3931.86
4197.52
4307.13
4229.43
4362.28
4217.34
4361.28
4327.74
4417.65
4557.68
4650.35
4967.18
5123.42
5290.85
5535.66
5514.06
5493.88
5694.83
5850.41
6116.64
6175.00
6513.58
6383.78
6673.66
6936.61
7300.68
7392.93
7497.31
7584.71
7160.79
7196.19
7245.63
7347.51
7425.75
7778.51
7822.33
8181.22
8371.47
8347.71
8672.11
8802.79
9138.46
9123.29
9023.21
8850.41
8864.58
9163.74
8516.66
8553.44
7555.20
7851.22
7442.00
7992.53
8264.04
7517.39
7200.40
7193.69
6193.58
5104.21
4800.46
4461.61
4398.59
4243.63
4293.82




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

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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65768&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 time1 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[96])
848672.11-------
858802.79-------
869138.46-------
879123.29-------
889023.21-------
898850.41-------
908864.58-------
919163.74-------
928516.66-------
938553.44-------
947555.2-------
957851.22-------
967442-------
977992.537373.966813.357970.87940.02110.411600.4116
988264.047362.40836514.90498295.9020.02920.09291e-040.4336
997517.397360.446300.06758559.01430.39870.06980.0020.4469
1007200.47360.10456127.37428783.70760.4130.41430.0110.4551
1017193.697360.04735980.37198983.3620.42040.57640.0360.4606
1026193.587360.03755851.00669165.50650.10270.57170.05120.4645
1035104.217360.03585734.69569334.63410.01260.87650.03670.4676
1044800.467360.03565628.54579493.62260.00940.98090.1440.47
1054461.617360.03555530.59259644.43390.00640.9860.15290.472
1064398.597360.03555439.43019788.47320.00840.99030.43740.4736
1074243.637360.03555354.01179926.78760.00870.98810.35380.475
1084293.827360.03555273.532510060.18150.0130.98820.47630.4763

\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 & 8672.11 & - & - & - & - & - & - & - \tabularnewline
85 & 8802.79 & - & - & - & - & - & - & - \tabularnewline
86 & 9138.46 & - & - & - & - & - & - & - \tabularnewline
87 & 9123.29 & - & - & - & - & - & - & - \tabularnewline
88 & 9023.21 & - & - & - & - & - & - & - \tabularnewline
89 & 8850.41 & - & - & - & - & - & - & - \tabularnewline
90 & 8864.58 & - & - & - & - & - & - & - \tabularnewline
91 & 9163.74 & - & - & - & - & - & - & - \tabularnewline
92 & 8516.66 & - & - & - & - & - & - & - \tabularnewline
93 & 8553.44 & - & - & - & - & - & - & - \tabularnewline
94 & 7555.2 & - & - & - & - & - & - & - \tabularnewline
95 & 7851.22 & - & - & - & - & - & - & - \tabularnewline
96 & 7442 & - & - & - & - & - & - & - \tabularnewline
97 & 7992.53 & 7373.96 & 6813.35 & 7970.8794 & 0.0211 & 0.4116 & 0 & 0.4116 \tabularnewline
98 & 8264.04 & 7362.4083 & 6514.9049 & 8295.902 & 0.0292 & 0.0929 & 1e-04 & 0.4336 \tabularnewline
99 & 7517.39 & 7360.44 & 6300.0675 & 8559.0143 & 0.3987 & 0.0698 & 0.002 & 0.4469 \tabularnewline
100 & 7200.4 & 7360.1045 & 6127.3742 & 8783.7076 & 0.413 & 0.4143 & 0.011 & 0.4551 \tabularnewline
101 & 7193.69 & 7360.0473 & 5980.3719 & 8983.362 & 0.4204 & 0.5764 & 0.036 & 0.4606 \tabularnewline
102 & 6193.58 & 7360.0375 & 5851.0066 & 9165.5065 & 0.1027 & 0.5717 & 0.0512 & 0.4645 \tabularnewline
103 & 5104.21 & 7360.0358 & 5734.6956 & 9334.6341 & 0.0126 & 0.8765 & 0.0367 & 0.4676 \tabularnewline
104 & 4800.46 & 7360.0356 & 5628.5457 & 9493.6226 & 0.0094 & 0.9809 & 0.144 & 0.47 \tabularnewline
105 & 4461.61 & 7360.0355 & 5530.5925 & 9644.4339 & 0.0064 & 0.986 & 0.1529 & 0.472 \tabularnewline
106 & 4398.59 & 7360.0355 & 5439.4301 & 9788.4732 & 0.0084 & 0.9903 & 0.4374 & 0.4736 \tabularnewline
107 & 4243.63 & 7360.0355 & 5354.0117 & 9926.7876 & 0.0087 & 0.9881 & 0.3538 & 0.475 \tabularnewline
108 & 4293.82 & 7360.0355 & 5273.5325 & 10060.1815 & 0.013 & 0.9882 & 0.4763 & 0.4763 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65768&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]8672.11[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]8802.79[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]9138.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]9123.29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]9023.21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]8850.41[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]8864.58[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]9163.74[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]8516.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]8553.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]7555.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]7851.22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]7442[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]7992.53[/C][C]7373.96[/C][C]6813.35[/C][C]7970.8794[/C][C]0.0211[/C][C]0.4116[/C][C]0[/C][C]0.4116[/C][/ROW]
[ROW][C]98[/C][C]8264.04[/C][C]7362.4083[/C][C]6514.9049[/C][C]8295.902[/C][C]0.0292[/C][C]0.0929[/C][C]1e-04[/C][C]0.4336[/C][/ROW]
[ROW][C]99[/C][C]7517.39[/C][C]7360.44[/C][C]6300.0675[/C][C]8559.0143[/C][C]0.3987[/C][C]0.0698[/C][C]0.002[/C][C]0.4469[/C][/ROW]
[ROW][C]100[/C][C]7200.4[/C][C]7360.1045[/C][C]6127.3742[/C][C]8783.7076[/C][C]0.413[/C][C]0.4143[/C][C]0.011[/C][C]0.4551[/C][/ROW]
[ROW][C]101[/C][C]7193.69[/C][C]7360.0473[/C][C]5980.3719[/C][C]8983.362[/C][C]0.4204[/C][C]0.5764[/C][C]0.036[/C][C]0.4606[/C][/ROW]
[ROW][C]102[/C][C]6193.58[/C][C]7360.0375[/C][C]5851.0066[/C][C]9165.5065[/C][C]0.1027[/C][C]0.5717[/C][C]0.0512[/C][C]0.4645[/C][/ROW]
[ROW][C]103[/C][C]5104.21[/C][C]7360.0358[/C][C]5734.6956[/C][C]9334.6341[/C][C]0.0126[/C][C]0.8765[/C][C]0.0367[/C][C]0.4676[/C][/ROW]
[ROW][C]104[/C][C]4800.46[/C][C]7360.0356[/C][C]5628.5457[/C][C]9493.6226[/C][C]0.0094[/C][C]0.9809[/C][C]0.144[/C][C]0.47[/C][/ROW]
[ROW][C]105[/C][C]4461.61[/C][C]7360.0355[/C][C]5530.5925[/C][C]9644.4339[/C][C]0.0064[/C][C]0.986[/C][C]0.1529[/C][C]0.472[/C][/ROW]
[ROW][C]106[/C][C]4398.59[/C][C]7360.0355[/C][C]5439.4301[/C][C]9788.4732[/C][C]0.0084[/C][C]0.9903[/C][C]0.4374[/C][C]0.4736[/C][/ROW]
[ROW][C]107[/C][C]4243.63[/C][C]7360.0355[/C][C]5354.0117[/C][C]9926.7876[/C][C]0.0087[/C][C]0.9881[/C][C]0.3538[/C][C]0.475[/C][/ROW]
[ROW][C]108[/C][C]4293.82[/C][C]7360.0355[/C][C]5273.5325[/C][C]10060.1815[/C][C]0.013[/C][C]0.9882[/C][C]0.4763[/C][C]0.4763[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65768&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65768&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])
848672.11-------
858802.79-------
869138.46-------
879123.29-------
889023.21-------
898850.41-------
908864.58-------
919163.74-------
928516.66-------
938553.44-------
947555.2-------
957851.22-------
967442-------
977992.537373.966813.357970.87940.02110.411600.4116
988264.047362.40836514.90498295.9020.02920.09291e-040.4336
997517.397360.446300.06758559.01430.39870.06980.0020.4469
1007200.47360.10456127.37428783.70760.4130.41430.0110.4551
1017193.697360.04735980.37198983.3620.42040.57640.0360.4606
1026193.587360.03755851.00669165.50650.10270.57170.05120.4645
1035104.217360.03585734.69569334.63410.01260.87650.03670.4676
1044800.467360.03565628.54579493.62260.00940.98090.1440.47
1054461.617360.03555530.59259644.43390.00640.9860.15290.472
1064398.597360.03555439.43019788.47320.00840.99030.43740.4736
1074243.637360.03555354.01179926.78760.00870.98810.35380.475
1084293.827360.03555273.532510060.18150.0130.98820.47630.4763







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
970.04130.08390.007382628.876731885.7397178.5658
980.06470.12250.0102812939.75567744.9796260.2787
990.08310.02130.001824633.28822052.77445.3075
1000.0987-0.02170.001825505.52192125.460246.1027
1010.1125-0.02260.001927674.74052306.228448.0232
1020.1252-0.15850.01321360623.1266113385.2606336.7273
1030.1369-0.30650.02555088750.2576424062.5215651.2008
1040.1479-0.34780.0296551427.0709545952.2559738.8858
1050.1584-0.39380.03288400870.4732700072.5394836.7034
1060.1683-0.40240.03358770159.4968730846.6247854.8957
1070.1779-0.42340.03539711983.2815809331.9401899.6288
1080.1872-0.41660.03479401677.5314783473.1276885.1402

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
97 & 0.0413 & 0.0839 & 0.007 & 382628.8767 & 31885.7397 & 178.5658 \tabularnewline
98 & 0.0647 & 0.1225 & 0.0102 & 812939.755 & 67744.9796 & 260.2787 \tabularnewline
99 & 0.0831 & 0.0213 & 0.0018 & 24633.2882 & 2052.774 & 45.3075 \tabularnewline
100 & 0.0987 & -0.0217 & 0.0018 & 25505.5219 & 2125.4602 & 46.1027 \tabularnewline
101 & 0.1125 & -0.0226 & 0.0019 & 27674.7405 & 2306.2284 & 48.0232 \tabularnewline
102 & 0.1252 & -0.1585 & 0.0132 & 1360623.1266 & 113385.2606 & 336.7273 \tabularnewline
103 & 0.1369 & -0.3065 & 0.0255 & 5088750.2576 & 424062.5215 & 651.2008 \tabularnewline
104 & 0.1479 & -0.3478 & 0.029 & 6551427.0709 & 545952.2559 & 738.8858 \tabularnewline
105 & 0.1584 & -0.3938 & 0.0328 & 8400870.4732 & 700072.5394 & 836.7034 \tabularnewline
106 & 0.1683 & -0.4024 & 0.0335 & 8770159.4968 & 730846.6247 & 854.8957 \tabularnewline
107 & 0.1779 & -0.4234 & 0.0353 & 9711983.2815 & 809331.9401 & 899.6288 \tabularnewline
108 & 0.1872 & -0.4166 & 0.0347 & 9401677.5314 & 783473.1276 & 885.1402 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65768&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.0413[/C][C]0.0839[/C][C]0.007[/C][C]382628.8767[/C][C]31885.7397[/C][C]178.5658[/C][/ROW]
[ROW][C]98[/C][C]0.0647[/C][C]0.1225[/C][C]0.0102[/C][C]812939.755[/C][C]67744.9796[/C][C]260.2787[/C][/ROW]
[ROW][C]99[/C][C]0.0831[/C][C]0.0213[/C][C]0.0018[/C][C]24633.2882[/C][C]2052.774[/C][C]45.3075[/C][/ROW]
[ROW][C]100[/C][C]0.0987[/C][C]-0.0217[/C][C]0.0018[/C][C]25505.5219[/C][C]2125.4602[/C][C]46.1027[/C][/ROW]
[ROW][C]101[/C][C]0.1125[/C][C]-0.0226[/C][C]0.0019[/C][C]27674.7405[/C][C]2306.2284[/C][C]48.0232[/C][/ROW]
[ROW][C]102[/C][C]0.1252[/C][C]-0.1585[/C][C]0.0132[/C][C]1360623.1266[/C][C]113385.2606[/C][C]336.7273[/C][/ROW]
[ROW][C]103[/C][C]0.1369[/C][C]-0.3065[/C][C]0.0255[/C][C]5088750.2576[/C][C]424062.5215[/C][C]651.2008[/C][/ROW]
[ROW][C]104[/C][C]0.1479[/C][C]-0.3478[/C][C]0.029[/C][C]6551427.0709[/C][C]545952.2559[/C][C]738.8858[/C][/ROW]
[ROW][C]105[/C][C]0.1584[/C][C]-0.3938[/C][C]0.0328[/C][C]8400870.4732[/C][C]700072.5394[/C][C]836.7034[/C][/ROW]
[ROW][C]106[/C][C]0.1683[/C][C]-0.4024[/C][C]0.0335[/C][C]8770159.4968[/C][C]730846.6247[/C][C]854.8957[/C][/ROW]
[ROW][C]107[/C][C]0.1779[/C][C]-0.4234[/C][C]0.0353[/C][C]9711983.2815[/C][C]809331.9401[/C][C]899.6288[/C][/ROW]
[ROW][C]108[/C][C]0.1872[/C][C]-0.4166[/C][C]0.0347[/C][C]9401677.5314[/C][C]783473.1276[/C][C]885.1402[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65768&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65768&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.04130.08390.007382628.876731885.7397178.5658
980.06470.12250.0102812939.75567744.9796260.2787
990.08310.02130.001824633.28822052.77445.3075
1000.0987-0.02170.001825505.52192125.460246.1027
1010.1125-0.02260.001927674.74052306.228448.0232
1020.1252-0.15850.01321360623.1266113385.2606336.7273
1030.1369-0.30650.02555088750.2576424062.5215651.2008
1040.1479-0.34780.0296551427.0709545952.2559738.8858
1050.1584-0.39380.03288400870.4732700072.5394836.7034
1060.1683-0.40240.03358770159.4968730846.6247854.8957
1070.1779-0.42340.03539711983.2815809331.9401899.6288
1080.1872-0.41660.03479401677.5314783473.1276885.1402



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