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 computationSat, 19 Dec 2009 05:16:16 -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/19/t1261225193gb4bc4h77r9l4a2.htm/, Retrieved Fri, 03 May 2024 15:54:06 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69545, Retrieved Fri, 03 May 2024 15:54:06 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact107
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2009-12-19 12:16:16] [a93df6747c5c78315f2ee9914aea3ec6] [Current]
Feedback Forum

Post a new message
Dataseries X:
2.64
2.75
2.7
2.87
3.03
3.14
3.02
2.86
3.07
2.93
2.83
2.72
2.73
2.72
2.77
2.61
2.47
2.3
2.38
2.43
2.39
2.6
2.84
2.87
2.92
3.08
3.33
3.48
3.57
3.66
3.77
3.75
3.75
3.81
3.82
3.89
4.05
4.1
4.07
4.26
4.4
4.61
4.63
4.48
4.46
4.45
4.32
4.52
4.21
3.97
4.12
4.5
4.73
5.26
5.2
4.94
4.95
4.52
3.85
3.41
2.95
2.68
2.53
2.44
2.16
2.2
2.1
2.29
2.03
2.05
1.94




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69545&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' @ 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[56])
444.48-------
454.46-------
464.45-------
474.32-------
484.52-------
494.21-------
503.97-------
514.12-------
524.5-------
534.73-------
545.26-------
555.2-------
564.94-------
574.954.89024.58515.19540.35050.37460.99710.3746
584.524.90344.39895.40790.06820.42820.96090.4435
593.854.93544.26875.60217e-040.8890.96480.4946
603.414.9734.1685.77811e-040.99690.8650.532
612.955.01234.08475.9400.99960.9550.5607
622.685.05224.01286.0916010.97940.5838
632.535.09213.94896.2354010.95220.6029
642.445.13213.8916.3733010.84090.6192
652.165.17223.83786.5065010.7420.6335
662.25.21223.78846.636010.47380.6461
672.15.25223.74216.7624010.5270.6573
682.295.29233.69836.88621e-0410.66750.6675
692.035.33233.65687.00781e-040.99980.67260.6768
702.055.37233.61717.12761e-040.99990.82940.6854
711.945.41243.57917.24561e-040.99980.95260.6932

\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[56]) \tabularnewline
44 & 4.48 & - & - & - & - & - & - & - \tabularnewline
45 & 4.46 & - & - & - & - & - & - & - \tabularnewline
46 & 4.45 & - & - & - & - & - & - & - \tabularnewline
47 & 4.32 & - & - & - & - & - & - & - \tabularnewline
48 & 4.52 & - & - & - & - & - & - & - \tabularnewline
49 & 4.21 & - & - & - & - & - & - & - \tabularnewline
50 & 3.97 & - & - & - & - & - & - & - \tabularnewline
51 & 4.12 & - & - & - & - & - & - & - \tabularnewline
52 & 4.5 & - & - & - & - & - & - & - \tabularnewline
53 & 4.73 & - & - & - & - & - & - & - \tabularnewline
54 & 5.26 & - & - & - & - & - & - & - \tabularnewline
55 & 5.2 & - & - & - & - & - & - & - \tabularnewline
56 & 4.94 & - & - & - & - & - & - & - \tabularnewline
57 & 4.95 & 4.8902 & 4.5851 & 5.1954 & 0.3505 & 0.3746 & 0.9971 & 0.3746 \tabularnewline
58 & 4.52 & 4.9034 & 4.3989 & 5.4079 & 0.0682 & 0.4282 & 0.9609 & 0.4435 \tabularnewline
59 & 3.85 & 4.9354 & 4.2687 & 5.6021 & 7e-04 & 0.889 & 0.9648 & 0.4946 \tabularnewline
60 & 3.41 & 4.973 & 4.168 & 5.7781 & 1e-04 & 0.9969 & 0.865 & 0.532 \tabularnewline
61 & 2.95 & 5.0123 & 4.0847 & 5.94 & 0 & 0.9996 & 0.955 & 0.5607 \tabularnewline
62 & 2.68 & 5.0522 & 4.0128 & 6.0916 & 0 & 1 & 0.9794 & 0.5838 \tabularnewline
63 & 2.53 & 5.0921 & 3.9489 & 6.2354 & 0 & 1 & 0.9522 & 0.6029 \tabularnewline
64 & 2.44 & 5.1321 & 3.891 & 6.3733 & 0 & 1 & 0.8409 & 0.6192 \tabularnewline
65 & 2.16 & 5.1722 & 3.8378 & 6.5065 & 0 & 1 & 0.742 & 0.6335 \tabularnewline
66 & 2.2 & 5.2122 & 3.7884 & 6.636 & 0 & 1 & 0.4738 & 0.6461 \tabularnewline
67 & 2.1 & 5.2522 & 3.7421 & 6.7624 & 0 & 1 & 0.527 & 0.6573 \tabularnewline
68 & 2.29 & 5.2923 & 3.6983 & 6.8862 & 1e-04 & 1 & 0.6675 & 0.6675 \tabularnewline
69 & 2.03 & 5.3323 & 3.6568 & 7.0078 & 1e-04 & 0.9998 & 0.6726 & 0.6768 \tabularnewline
70 & 2.05 & 5.3723 & 3.6171 & 7.1276 & 1e-04 & 0.9999 & 0.8294 & 0.6854 \tabularnewline
71 & 1.94 & 5.4124 & 3.5791 & 7.2456 & 1e-04 & 0.9998 & 0.9526 & 0.6932 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69545&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[56])[/C][/ROW]
[ROW][C]44[/C][C]4.48[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4.46[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]4.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4.32[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]4.52[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]4.21[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]3.97[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]4.12[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]4.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]4.73[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]5.26[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]5.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]4.94[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]4.95[/C][C]4.8902[/C][C]4.5851[/C][C]5.1954[/C][C]0.3505[/C][C]0.3746[/C][C]0.9971[/C][C]0.3746[/C][/ROW]
[ROW][C]58[/C][C]4.52[/C][C]4.9034[/C][C]4.3989[/C][C]5.4079[/C][C]0.0682[/C][C]0.4282[/C][C]0.9609[/C][C]0.4435[/C][/ROW]
[ROW][C]59[/C][C]3.85[/C][C]4.9354[/C][C]4.2687[/C][C]5.6021[/C][C]7e-04[/C][C]0.889[/C][C]0.9648[/C][C]0.4946[/C][/ROW]
[ROW][C]60[/C][C]3.41[/C][C]4.973[/C][C]4.168[/C][C]5.7781[/C][C]1e-04[/C][C]0.9969[/C][C]0.865[/C][C]0.532[/C][/ROW]
[ROW][C]61[/C][C]2.95[/C][C]5.0123[/C][C]4.0847[/C][C]5.94[/C][C]0[/C][C]0.9996[/C][C]0.955[/C][C]0.5607[/C][/ROW]
[ROW][C]62[/C][C]2.68[/C][C]5.0522[/C][C]4.0128[/C][C]6.0916[/C][C]0[/C][C]1[/C][C]0.9794[/C][C]0.5838[/C][/ROW]
[ROW][C]63[/C][C]2.53[/C][C]5.0921[/C][C]3.9489[/C][C]6.2354[/C][C]0[/C][C]1[/C][C]0.9522[/C][C]0.6029[/C][/ROW]
[ROW][C]64[/C][C]2.44[/C][C]5.1321[/C][C]3.891[/C][C]6.3733[/C][C]0[/C][C]1[/C][C]0.8409[/C][C]0.6192[/C][/ROW]
[ROW][C]65[/C][C]2.16[/C][C]5.1722[/C][C]3.8378[/C][C]6.5065[/C][C]0[/C][C]1[/C][C]0.742[/C][C]0.6335[/C][/ROW]
[ROW][C]66[/C][C]2.2[/C][C]5.2122[/C][C]3.7884[/C][C]6.636[/C][C]0[/C][C]1[/C][C]0.4738[/C][C]0.6461[/C][/ROW]
[ROW][C]67[/C][C]2.1[/C][C]5.2522[/C][C]3.7421[/C][C]6.7624[/C][C]0[/C][C]1[/C][C]0.527[/C][C]0.6573[/C][/ROW]
[ROW][C]68[/C][C]2.29[/C][C]5.2923[/C][C]3.6983[/C][C]6.8862[/C][C]1e-04[/C][C]1[/C][C]0.6675[/C][C]0.6675[/C][/ROW]
[ROW][C]69[/C][C]2.03[/C][C]5.3323[/C][C]3.6568[/C][C]7.0078[/C][C]1e-04[/C][C]0.9998[/C][C]0.6726[/C][C]0.6768[/C][/ROW]
[ROW][C]70[/C][C]2.05[/C][C]5.3723[/C][C]3.6171[/C][C]7.1276[/C][C]1e-04[/C][C]0.9999[/C][C]0.8294[/C][C]0.6854[/C][/ROW]
[ROW][C]71[/C][C]1.94[/C][C]5.4124[/C][C]3.5791[/C][C]7.2456[/C][C]1e-04[/C][C]0.9998[/C][C]0.9526[/C][C]0.6932[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69545&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69545&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[56])
444.48-------
454.46-------
464.45-------
474.32-------
484.52-------
494.21-------
503.97-------
514.12-------
524.5-------
534.73-------
545.26-------
555.2-------
564.94-------
574.954.89024.58515.19540.35050.37460.99710.3746
584.524.90344.39895.40790.06820.42820.96090.4435
593.854.93544.26875.60217e-040.8890.96480.4946
603.414.9734.1685.77811e-040.99690.8650.532
612.955.01234.08475.9400.99960.9550.5607
622.685.05224.01286.0916010.97940.5838
632.535.09213.94896.2354010.95220.6029
642.445.13213.8916.3733010.84090.6192
652.165.17223.83786.5065010.7420.6335
662.25.21223.78846.636010.47380.6461
672.15.25223.74216.7624010.5270.6573
682.295.29233.69836.88621e-0410.66750.6675
692.035.33233.65687.00781e-040.99980.67260.6768
702.055.37233.61717.12761e-040.99990.82940.6854
711.945.41243.57917.24561e-040.99980.95260.6932







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
570.03180.012200.003600
580.0525-0.07820.04520.1470.07530.2744
590.0689-0.21990.10341.17810.44290.6655
600.0826-0.31430.15622.44310.94290.971
610.0944-0.41150.20724.25331.6051.2669
620.105-0.46950.25095.62712.27541.5084
630.1145-0.50320.2876.56452.88811.6994
640.1234-0.52460.31677.24763.4331.8528
650.1316-0.58240.34629.07314.05972.0149
660.1394-0.57790.36949.07334.56112.1357
670.1467-0.60020.39039.93655.04972.2472
680.1537-0.56730.40519.01365.38012.3195
690.1603-0.61930.421610.90515.80512.4094
700.1667-0.61840.435611.03786.17882.4857
710.1728-0.64160.449412.05726.57072.5633

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
57 & 0.0318 & 0.0122 & 0 & 0.0036 & 0 & 0 \tabularnewline
58 & 0.0525 & -0.0782 & 0.0452 & 0.147 & 0.0753 & 0.2744 \tabularnewline
59 & 0.0689 & -0.2199 & 0.1034 & 1.1781 & 0.4429 & 0.6655 \tabularnewline
60 & 0.0826 & -0.3143 & 0.1562 & 2.4431 & 0.9429 & 0.971 \tabularnewline
61 & 0.0944 & -0.4115 & 0.2072 & 4.2533 & 1.605 & 1.2669 \tabularnewline
62 & 0.105 & -0.4695 & 0.2509 & 5.6271 & 2.2754 & 1.5084 \tabularnewline
63 & 0.1145 & -0.5032 & 0.287 & 6.5645 & 2.8881 & 1.6994 \tabularnewline
64 & 0.1234 & -0.5246 & 0.3167 & 7.2476 & 3.433 & 1.8528 \tabularnewline
65 & 0.1316 & -0.5824 & 0.3462 & 9.0731 & 4.0597 & 2.0149 \tabularnewline
66 & 0.1394 & -0.5779 & 0.3694 & 9.0733 & 4.5611 & 2.1357 \tabularnewline
67 & 0.1467 & -0.6002 & 0.3903 & 9.9365 & 5.0497 & 2.2472 \tabularnewline
68 & 0.1537 & -0.5673 & 0.4051 & 9.0136 & 5.3801 & 2.3195 \tabularnewline
69 & 0.1603 & -0.6193 & 0.4216 & 10.9051 & 5.8051 & 2.4094 \tabularnewline
70 & 0.1667 & -0.6184 & 0.4356 & 11.0378 & 6.1788 & 2.4857 \tabularnewline
71 & 0.1728 & -0.6416 & 0.4494 & 12.0572 & 6.5707 & 2.5633 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69545&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]57[/C][C]0.0318[/C][C]0.0122[/C][C]0[/C][C]0.0036[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]58[/C][C]0.0525[/C][C]-0.0782[/C][C]0.0452[/C][C]0.147[/C][C]0.0753[/C][C]0.2744[/C][/ROW]
[ROW][C]59[/C][C]0.0689[/C][C]-0.2199[/C][C]0.1034[/C][C]1.1781[/C][C]0.4429[/C][C]0.6655[/C][/ROW]
[ROW][C]60[/C][C]0.0826[/C][C]-0.3143[/C][C]0.1562[/C][C]2.4431[/C][C]0.9429[/C][C]0.971[/C][/ROW]
[ROW][C]61[/C][C]0.0944[/C][C]-0.4115[/C][C]0.2072[/C][C]4.2533[/C][C]1.605[/C][C]1.2669[/C][/ROW]
[ROW][C]62[/C][C]0.105[/C][C]-0.4695[/C][C]0.2509[/C][C]5.6271[/C][C]2.2754[/C][C]1.5084[/C][/ROW]
[ROW][C]63[/C][C]0.1145[/C][C]-0.5032[/C][C]0.287[/C][C]6.5645[/C][C]2.8881[/C][C]1.6994[/C][/ROW]
[ROW][C]64[/C][C]0.1234[/C][C]-0.5246[/C][C]0.3167[/C][C]7.2476[/C][C]3.433[/C][C]1.8528[/C][/ROW]
[ROW][C]65[/C][C]0.1316[/C][C]-0.5824[/C][C]0.3462[/C][C]9.0731[/C][C]4.0597[/C][C]2.0149[/C][/ROW]
[ROW][C]66[/C][C]0.1394[/C][C]-0.5779[/C][C]0.3694[/C][C]9.0733[/C][C]4.5611[/C][C]2.1357[/C][/ROW]
[ROW][C]67[/C][C]0.1467[/C][C]-0.6002[/C][C]0.3903[/C][C]9.9365[/C][C]5.0497[/C][C]2.2472[/C][/ROW]
[ROW][C]68[/C][C]0.1537[/C][C]-0.5673[/C][C]0.4051[/C][C]9.0136[/C][C]5.3801[/C][C]2.3195[/C][/ROW]
[ROW][C]69[/C][C]0.1603[/C][C]-0.6193[/C][C]0.4216[/C][C]10.9051[/C][C]5.8051[/C][C]2.4094[/C][/ROW]
[ROW][C]70[/C][C]0.1667[/C][C]-0.6184[/C][C]0.4356[/C][C]11.0378[/C][C]6.1788[/C][C]2.4857[/C][/ROW]
[ROW][C]71[/C][C]0.1728[/C][C]-0.6416[/C][C]0.4494[/C][C]12.0572[/C][C]6.5707[/C][C]2.5633[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69545&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69545&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
570.03180.012200.003600
580.0525-0.07820.04520.1470.07530.2744
590.0689-0.21990.10341.17810.44290.6655
600.0826-0.31430.15622.44310.94290.971
610.0944-0.41150.20724.25331.6051.2669
620.105-0.46950.25095.62712.27541.5084
630.1145-0.50320.2876.56452.88811.6994
640.1234-0.52460.31677.24763.4331.8528
650.1316-0.58240.34629.07314.05972.0149
660.1394-0.57790.36949.07334.56112.1357
670.1467-0.60020.39039.93655.04972.2472
680.1537-0.56730.40519.01365.38012.3195
690.1603-0.61930.421610.90515.80512.4094
700.1667-0.61840.435611.03786.17882.4857
710.1728-0.64160.449412.05726.57072.5633



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