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, 03 Sep 2015 08:20:06 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2015/Sep/03/t1441264820sq4fh3c0js75d9f.htm/, Retrieved Thu, 16 May 2024 13:58:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=280478, Retrieved Thu, 16 May 2024 13:58:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact56
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2015-09-03 07:20:06] [3e99441ea7f7f69c8fa4628f6be951c3] [Current]
Feedback Forum

Post a new message
Dataseries X:
1.4
1.5
1.8
1.8
1.8
1.7
1.5
1.1
1.3
1.6
1.9
1.9
2
2.2
2.2
2
2.3
2.6
3.2
3.2
3.1
2.8
2.3
1.9
1.9
2
2
1.8
1.6
1.4
0.2
0.3
0.4
0.7
1
1.1
0.8
0.8
1
1.1
1
0.8
1.6
1.5
1.6
1.6
1.6
1.9
2
1.9
2
2.1
2.3
2.3
2.6
2.6
2.7
2.6
2.6
2.4
2.5
2.5
2.5
2.4
2.1
2.1
2.3
2.3
2.3
2.9
2.8
2.9
3
3
2.9
2.6
2.8
2.9
3.1
2.8
2.4
1.6
1.5
1.7




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=280478&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=280478&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=280478&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[72])
602.4-------
612.5-------
622.5-------
632.5-------
642.4-------
652.1-------
662.1-------
672.3-------
682.3-------
692.3-------
702.9-------
712.8-------
722.9-------
7332.86072.4123.30940.27140.43180.94250.4318
7432.86962.23523.50410.34360.34360.87330.4626
752.92.79282.01593.56980.39340.30060.770.3934
762.62.83051.93343.72760.30730.43970.82650.4397
772.82.95961.95663.96260.37760.75890.95350.5463
782.93.00331.90464.1020.42690.64160.94640.5731
793.12.73871.5523.92550.27540.3950.76570.395
802.82.75641.48774.02510.47310.29780.75960.4122
812.42.69561.354.04120.33340.43960.71780.383
821.62.36340.9453.78180.14570.47980.22920.2292
831.52.40980.92223.89750.11530.8570.30360.2592
841.72.37390.82013.92770.19760.86490.25350.2535

\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[72]) \tabularnewline
60 & 2.4 & - & - & - & - & - & - & - \tabularnewline
61 & 2.5 & - & - & - & - & - & - & - \tabularnewline
62 & 2.5 & - & - & - & - & - & - & - \tabularnewline
63 & 2.5 & - & - & - & - & - & - & - \tabularnewline
64 & 2.4 & - & - & - & - & - & - & - \tabularnewline
65 & 2.1 & - & - & - & - & - & - & - \tabularnewline
66 & 2.1 & - & - & - & - & - & - & - \tabularnewline
67 & 2.3 & - & - & - & - & - & - & - \tabularnewline
68 & 2.3 & - & - & - & - & - & - & - \tabularnewline
69 & 2.3 & - & - & - & - & - & - & - \tabularnewline
70 & 2.9 & - & - & - & - & - & - & - \tabularnewline
71 & 2.8 & - & - & - & - & - & - & - \tabularnewline
72 & 2.9 & - & - & - & - & - & - & - \tabularnewline
73 & 3 & 2.8607 & 2.412 & 3.3094 & 0.2714 & 0.4318 & 0.9425 & 0.4318 \tabularnewline
74 & 3 & 2.8696 & 2.2352 & 3.5041 & 0.3436 & 0.3436 & 0.8733 & 0.4626 \tabularnewline
75 & 2.9 & 2.7928 & 2.0159 & 3.5698 & 0.3934 & 0.3006 & 0.77 & 0.3934 \tabularnewline
76 & 2.6 & 2.8305 & 1.9334 & 3.7276 & 0.3073 & 0.4397 & 0.8265 & 0.4397 \tabularnewline
77 & 2.8 & 2.9596 & 1.9566 & 3.9626 & 0.3776 & 0.7589 & 0.9535 & 0.5463 \tabularnewline
78 & 2.9 & 3.0033 & 1.9046 & 4.102 & 0.4269 & 0.6416 & 0.9464 & 0.5731 \tabularnewline
79 & 3.1 & 2.7387 & 1.552 & 3.9255 & 0.2754 & 0.395 & 0.7657 & 0.395 \tabularnewline
80 & 2.8 & 2.7564 & 1.4877 & 4.0251 & 0.4731 & 0.2978 & 0.7596 & 0.4122 \tabularnewline
81 & 2.4 & 2.6956 & 1.35 & 4.0412 & 0.3334 & 0.4396 & 0.7178 & 0.383 \tabularnewline
82 & 1.6 & 2.3634 & 0.945 & 3.7818 & 0.1457 & 0.4798 & 0.2292 & 0.2292 \tabularnewline
83 & 1.5 & 2.4098 & 0.9222 & 3.8975 & 0.1153 & 0.857 & 0.3036 & 0.2592 \tabularnewline
84 & 1.7 & 2.3739 & 0.8201 & 3.9277 & 0.1976 & 0.8649 & 0.2535 & 0.2535 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=280478&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[72])[/C][/ROW]
[ROW][C]60[/C][C]2.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]2.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]2.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]2.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]2.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]65[/C][C]2.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]66[/C][C]2.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]67[/C][C]2.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]2.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]2.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]70[/C][C]2.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]71[/C][C]2.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]72[/C][C]2.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]73[/C][C]3[/C][C]2.8607[/C][C]2.412[/C][C]3.3094[/C][C]0.2714[/C][C]0.4318[/C][C]0.9425[/C][C]0.4318[/C][/ROW]
[ROW][C]74[/C][C]3[/C][C]2.8696[/C][C]2.2352[/C][C]3.5041[/C][C]0.3436[/C][C]0.3436[/C][C]0.8733[/C][C]0.4626[/C][/ROW]
[ROW][C]75[/C][C]2.9[/C][C]2.7928[/C][C]2.0159[/C][C]3.5698[/C][C]0.3934[/C][C]0.3006[/C][C]0.77[/C][C]0.3934[/C][/ROW]
[ROW][C]76[/C][C]2.6[/C][C]2.8305[/C][C]1.9334[/C][C]3.7276[/C][C]0.3073[/C][C]0.4397[/C][C]0.8265[/C][C]0.4397[/C][/ROW]
[ROW][C]77[/C][C]2.8[/C][C]2.9596[/C][C]1.9566[/C][C]3.9626[/C][C]0.3776[/C][C]0.7589[/C][C]0.9535[/C][C]0.5463[/C][/ROW]
[ROW][C]78[/C][C]2.9[/C][C]3.0033[/C][C]1.9046[/C][C]4.102[/C][C]0.4269[/C][C]0.6416[/C][C]0.9464[/C][C]0.5731[/C][/ROW]
[ROW][C]79[/C][C]3.1[/C][C]2.7387[/C][C]1.552[/C][C]3.9255[/C][C]0.2754[/C][C]0.395[/C][C]0.7657[/C][C]0.395[/C][/ROW]
[ROW][C]80[/C][C]2.8[/C][C]2.7564[/C][C]1.4877[/C][C]4.0251[/C][C]0.4731[/C][C]0.2978[/C][C]0.7596[/C][C]0.4122[/C][/ROW]
[ROW][C]81[/C][C]2.4[/C][C]2.6956[/C][C]1.35[/C][C]4.0412[/C][C]0.3334[/C][C]0.4396[/C][C]0.7178[/C][C]0.383[/C][/ROW]
[ROW][C]82[/C][C]1.6[/C][C]2.3634[/C][C]0.945[/C][C]3.7818[/C][C]0.1457[/C][C]0.4798[/C][C]0.2292[/C][C]0.2292[/C][/ROW]
[ROW][C]83[/C][C]1.5[/C][C]2.4098[/C][C]0.9222[/C][C]3.8975[/C][C]0.1153[/C][C]0.857[/C][C]0.3036[/C][C]0.2592[/C][/ROW]
[ROW][C]84[/C][C]1.7[/C][C]2.3739[/C][C]0.8201[/C][C]3.9277[/C][C]0.1976[/C][C]0.8649[/C][C]0.2535[/C][C]0.2535[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=280478&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=280478&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[72])
602.4-------
612.5-------
622.5-------
632.5-------
642.4-------
652.1-------
662.1-------
672.3-------
682.3-------
692.3-------
702.9-------
712.8-------
722.9-------
7332.86072.4123.30940.27140.43180.94250.4318
7432.86962.23523.50410.34360.34360.87330.4626
752.92.79282.01593.56980.39340.30060.770.3934
762.62.83051.93343.72760.30730.43970.82650.4397
772.82.95961.95663.96260.37760.75890.95350.5463
782.93.00331.90464.1020.42690.64160.94640.5731
793.12.73871.5523.92550.27540.3950.76570.395
802.82.75641.48774.02510.47310.29780.75960.4122
812.42.69561.354.04120.33340.43960.71780.383
821.62.36340.9453.78180.14570.47980.22920.2292
831.52.40980.92223.89750.11530.8570.30360.2592
841.72.37390.82013.92770.19760.86490.25350.2535







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
730.080.04640.04640.04750.0194000.56760.5676
740.11280.04350.04490.0460.0170.01820.13490.53110.5493
750.14190.0370.04230.04320.01150.0160.12630.43670.5118
760.1617-0.08870.05390.05360.05310.02530.1589-0.93910.6186
770.1729-0.0570.05450.0540.02550.02530.159-0.65010.6249
780.1867-0.03560.05140.05080.01070.02290.1512-0.42080.5909
790.22110.11650.06070.06120.13050.03820.19551.47180.7167
800.23480.01560.0550.05550.00190.03370.18360.17770.6493
810.2547-0.12320.06260.06230.08740.03970.1991-1.20430.711
820.3062-0.47710.10410.09460.58280.0940.3065-3.11020.9509
830.315-0.60660.14970.12830.82780.16070.4009-3.70681.2015
840.3339-0.39640.17030.14520.45420.18510.4303-2.74561.3301

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
73 & 0.08 & 0.0464 & 0.0464 & 0.0475 & 0.0194 & 0 & 0 & 0.5676 & 0.5676 \tabularnewline
74 & 0.1128 & 0.0435 & 0.0449 & 0.046 & 0.017 & 0.0182 & 0.1349 & 0.5311 & 0.5493 \tabularnewline
75 & 0.1419 & 0.037 & 0.0423 & 0.0432 & 0.0115 & 0.016 & 0.1263 & 0.4367 & 0.5118 \tabularnewline
76 & 0.1617 & -0.0887 & 0.0539 & 0.0536 & 0.0531 & 0.0253 & 0.1589 & -0.9391 & 0.6186 \tabularnewline
77 & 0.1729 & -0.057 & 0.0545 & 0.054 & 0.0255 & 0.0253 & 0.159 & -0.6501 & 0.6249 \tabularnewline
78 & 0.1867 & -0.0356 & 0.0514 & 0.0508 & 0.0107 & 0.0229 & 0.1512 & -0.4208 & 0.5909 \tabularnewline
79 & 0.2211 & 0.1165 & 0.0607 & 0.0612 & 0.1305 & 0.0382 & 0.1955 & 1.4718 & 0.7167 \tabularnewline
80 & 0.2348 & 0.0156 & 0.055 & 0.0555 & 0.0019 & 0.0337 & 0.1836 & 0.1777 & 0.6493 \tabularnewline
81 & 0.2547 & -0.1232 & 0.0626 & 0.0623 & 0.0874 & 0.0397 & 0.1991 & -1.2043 & 0.711 \tabularnewline
82 & 0.3062 & -0.4771 & 0.1041 & 0.0946 & 0.5828 & 0.094 & 0.3065 & -3.1102 & 0.9509 \tabularnewline
83 & 0.315 & -0.6066 & 0.1497 & 0.1283 & 0.8278 & 0.1607 & 0.4009 & -3.7068 & 1.2015 \tabularnewline
84 & 0.3339 & -0.3964 & 0.1703 & 0.1452 & 0.4542 & 0.1851 & 0.4303 & -2.7456 & 1.3301 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=280478&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]73[/C][C]0.08[/C][C]0.0464[/C][C]0.0464[/C][C]0.0475[/C][C]0.0194[/C][C]0[/C][C]0[/C][C]0.5676[/C][C]0.5676[/C][/ROW]
[ROW][C]74[/C][C]0.1128[/C][C]0.0435[/C][C]0.0449[/C][C]0.046[/C][C]0.017[/C][C]0.0182[/C][C]0.1349[/C][C]0.5311[/C][C]0.5493[/C][/ROW]
[ROW][C]75[/C][C]0.1419[/C][C]0.037[/C][C]0.0423[/C][C]0.0432[/C][C]0.0115[/C][C]0.016[/C][C]0.1263[/C][C]0.4367[/C][C]0.5118[/C][/ROW]
[ROW][C]76[/C][C]0.1617[/C][C]-0.0887[/C][C]0.0539[/C][C]0.0536[/C][C]0.0531[/C][C]0.0253[/C][C]0.1589[/C][C]-0.9391[/C][C]0.6186[/C][/ROW]
[ROW][C]77[/C][C]0.1729[/C][C]-0.057[/C][C]0.0545[/C][C]0.054[/C][C]0.0255[/C][C]0.0253[/C][C]0.159[/C][C]-0.6501[/C][C]0.6249[/C][/ROW]
[ROW][C]78[/C][C]0.1867[/C][C]-0.0356[/C][C]0.0514[/C][C]0.0508[/C][C]0.0107[/C][C]0.0229[/C][C]0.1512[/C][C]-0.4208[/C][C]0.5909[/C][/ROW]
[ROW][C]79[/C][C]0.2211[/C][C]0.1165[/C][C]0.0607[/C][C]0.0612[/C][C]0.1305[/C][C]0.0382[/C][C]0.1955[/C][C]1.4718[/C][C]0.7167[/C][/ROW]
[ROW][C]80[/C][C]0.2348[/C][C]0.0156[/C][C]0.055[/C][C]0.0555[/C][C]0.0019[/C][C]0.0337[/C][C]0.1836[/C][C]0.1777[/C][C]0.6493[/C][/ROW]
[ROW][C]81[/C][C]0.2547[/C][C]-0.1232[/C][C]0.0626[/C][C]0.0623[/C][C]0.0874[/C][C]0.0397[/C][C]0.1991[/C][C]-1.2043[/C][C]0.711[/C][/ROW]
[ROW][C]82[/C][C]0.3062[/C][C]-0.4771[/C][C]0.1041[/C][C]0.0946[/C][C]0.5828[/C][C]0.094[/C][C]0.3065[/C][C]-3.1102[/C][C]0.9509[/C][/ROW]
[ROW][C]83[/C][C]0.315[/C][C]-0.6066[/C][C]0.1497[/C][C]0.1283[/C][C]0.8278[/C][C]0.1607[/C][C]0.4009[/C][C]-3.7068[/C][C]1.2015[/C][/ROW]
[ROW][C]84[/C][C]0.3339[/C][C]-0.3964[/C][C]0.1703[/C][C]0.1452[/C][C]0.4542[/C][C]0.1851[/C][C]0.4303[/C][C]-2.7456[/C][C]1.3301[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=280478&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=280478&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
730.080.04640.04640.04750.0194000.56760.5676
740.11280.04350.04490.0460.0170.01820.13490.53110.5493
750.14190.0370.04230.04320.01150.0160.12630.43670.5118
760.1617-0.08870.05390.05360.05310.02530.1589-0.93910.6186
770.1729-0.0570.05450.0540.02550.02530.159-0.65010.6249
780.1867-0.03560.05140.05080.01070.02290.1512-0.42080.5909
790.22110.11650.06070.06120.13050.03820.19551.47180.7167
800.23480.01560.0550.05550.00190.03370.18360.17770.6493
810.2547-0.12320.06260.06230.08740.03970.1991-1.20430.711
820.3062-0.47710.10410.09460.58280.0940.3065-3.11020.9509
830.315-0.60660.14970.12830.82780.16070.4009-3.70681.2015
840.3339-0.39640.17030.14520.45420.18510.4303-2.74561.3301



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = 0 ; par7 = 0 ; par8 = 0 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 0 ; 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,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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')