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:08:34 -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/t1261224586mn3fxa9ux2bht9w.htm/, Retrieved Fri, 03 May 2024 16:19:15 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69539, Retrieved Fri, 03 May 2024 16:19:15 +0000
QR Codes:

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

Post a new message
Dataseries X:
2.02
2.03
2.01
2.08
2.02
2.03
2.07
2.04
2.05
2.11
2.09
2.05
2.08
2.06
2.06
2.08
2.07
2.06
2.07
2.06
2.09
2.07
2.09
2.28
2.33
2.35
2.52
2.63
2.58
2.70
2.81
2.97
3.04
3.28
3.33
3.50
3.56
3.57
3.69
3.82
3.79
3.96
4.06
4.05
4.03
3.94
4.02
3.88
4.02
4.03
4.09
3.99
4.01
4.01
4.19
4.30
4.27
3.82
3.15
2.49
1.81
1.26
1.06
0.84
0.78
0.70
0.36
0.35
0.36
0.36
0.36




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69539&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[55])
434.06-------
444.05-------
454.03-------
463.94-------
474.02-------
483.88-------
494.02-------
504.03-------
514.09-------
523.99-------
534.01-------
544.01-------
554.19-------
564.34.25584.08784.42380.3030.77870.99180.7787
574.274.39414.10984.67830.19620.74170.9940.9203
583.824.48634.02894.94380.00220.8230.99040.8979
593.154.60783.975.245600.99230.96460.9004
602.494.71073.86345.55800.99980.97270.8858
611.814.82543.75525.8957010.92990.8777
621.264.93273.61956.2458010.91110.8662
631.065.04463.47446.6148010.88330.857
640.845.15363.31036.9968010.8920.8472
650.785.26453.13467.3943010.87580.8386
660.75.37412.94387.80441e-040.99990.86440.8302
670.365.48452.74118.2281e-040.99970.82250.8225
680.355.59452.52538.66364e-040.99960.79580.8151
690.365.70472.2989.11140.00110.9990.79540.8083
700.365.81482.0599.57060.00220.99780.85110.8018
710.365.9251.808910.04110.0040.9960.90680.7956

\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[55]) \tabularnewline
43 & 4.06 & - & - & - & - & - & - & - \tabularnewline
44 & 4.05 & - & - & - & - & - & - & - \tabularnewline
45 & 4.03 & - & - & - & - & - & - & - \tabularnewline
46 & 3.94 & - & - & - & - & - & - & - \tabularnewline
47 & 4.02 & - & - & - & - & - & - & - \tabularnewline
48 & 3.88 & - & - & - & - & - & - & - \tabularnewline
49 & 4.02 & - & - & - & - & - & - & - \tabularnewline
50 & 4.03 & - & - & - & - & - & - & - \tabularnewline
51 & 4.09 & - & - & - & - & - & - & - \tabularnewline
52 & 3.99 & - & - & - & - & - & - & - \tabularnewline
53 & 4.01 & - & - & - & - & - & - & - \tabularnewline
54 & 4.01 & - & - & - & - & - & - & - \tabularnewline
55 & 4.19 & - & - & - & - & - & - & - \tabularnewline
56 & 4.3 & 4.2558 & 4.0878 & 4.4238 & 0.303 & 0.7787 & 0.9918 & 0.7787 \tabularnewline
57 & 4.27 & 4.3941 & 4.1098 & 4.6783 & 0.1962 & 0.7417 & 0.994 & 0.9203 \tabularnewline
58 & 3.82 & 4.4863 & 4.0289 & 4.9438 & 0.0022 & 0.823 & 0.9904 & 0.8979 \tabularnewline
59 & 3.15 & 4.6078 & 3.97 & 5.2456 & 0 & 0.9923 & 0.9646 & 0.9004 \tabularnewline
60 & 2.49 & 4.7107 & 3.8634 & 5.558 & 0 & 0.9998 & 0.9727 & 0.8858 \tabularnewline
61 & 1.81 & 4.8254 & 3.7552 & 5.8957 & 0 & 1 & 0.9299 & 0.8777 \tabularnewline
62 & 1.26 & 4.9327 & 3.6195 & 6.2458 & 0 & 1 & 0.9111 & 0.8662 \tabularnewline
63 & 1.06 & 5.0446 & 3.4744 & 6.6148 & 0 & 1 & 0.8833 & 0.857 \tabularnewline
64 & 0.84 & 5.1536 & 3.3103 & 6.9968 & 0 & 1 & 0.892 & 0.8472 \tabularnewline
65 & 0.78 & 5.2645 & 3.1346 & 7.3943 & 0 & 1 & 0.8758 & 0.8386 \tabularnewline
66 & 0.7 & 5.3741 & 2.9438 & 7.8044 & 1e-04 & 0.9999 & 0.8644 & 0.8302 \tabularnewline
67 & 0.36 & 5.4845 & 2.7411 & 8.228 & 1e-04 & 0.9997 & 0.8225 & 0.8225 \tabularnewline
68 & 0.35 & 5.5945 & 2.5253 & 8.6636 & 4e-04 & 0.9996 & 0.7958 & 0.8151 \tabularnewline
69 & 0.36 & 5.7047 & 2.298 & 9.1114 & 0.0011 & 0.999 & 0.7954 & 0.8083 \tabularnewline
70 & 0.36 & 5.8148 & 2.059 & 9.5706 & 0.0022 & 0.9978 & 0.8511 & 0.8018 \tabularnewline
71 & 0.36 & 5.925 & 1.8089 & 10.0411 & 0.004 & 0.996 & 0.9068 & 0.7956 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69539&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[55])[/C][/ROW]
[ROW][C]43[/C][C]4.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]4.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4.03[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]3.94[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4.02[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]3.88[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]4.02[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]4.03[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]4.09[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]3.99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]4.01[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]4.01[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]4.19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]4.3[/C][C]4.2558[/C][C]4.0878[/C][C]4.4238[/C][C]0.303[/C][C]0.7787[/C][C]0.9918[/C][C]0.7787[/C][/ROW]
[ROW][C]57[/C][C]4.27[/C][C]4.3941[/C][C]4.1098[/C][C]4.6783[/C][C]0.1962[/C][C]0.7417[/C][C]0.994[/C][C]0.9203[/C][/ROW]
[ROW][C]58[/C][C]3.82[/C][C]4.4863[/C][C]4.0289[/C][C]4.9438[/C][C]0.0022[/C][C]0.823[/C][C]0.9904[/C][C]0.8979[/C][/ROW]
[ROW][C]59[/C][C]3.15[/C][C]4.6078[/C][C]3.97[/C][C]5.2456[/C][C]0[/C][C]0.9923[/C][C]0.9646[/C][C]0.9004[/C][/ROW]
[ROW][C]60[/C][C]2.49[/C][C]4.7107[/C][C]3.8634[/C][C]5.558[/C][C]0[/C][C]0.9998[/C][C]0.9727[/C][C]0.8858[/C][/ROW]
[ROW][C]61[/C][C]1.81[/C][C]4.8254[/C][C]3.7552[/C][C]5.8957[/C][C]0[/C][C]1[/C][C]0.9299[/C][C]0.8777[/C][/ROW]
[ROW][C]62[/C][C]1.26[/C][C]4.9327[/C][C]3.6195[/C][C]6.2458[/C][C]0[/C][C]1[/C][C]0.9111[/C][C]0.8662[/C][/ROW]
[ROW][C]63[/C][C]1.06[/C][C]5.0446[/C][C]3.4744[/C][C]6.6148[/C][C]0[/C][C]1[/C][C]0.8833[/C][C]0.857[/C][/ROW]
[ROW][C]64[/C][C]0.84[/C][C]5.1536[/C][C]3.3103[/C][C]6.9968[/C][C]0[/C][C]1[/C][C]0.892[/C][C]0.8472[/C][/ROW]
[ROW][C]65[/C][C]0.78[/C][C]5.2645[/C][C]3.1346[/C][C]7.3943[/C][C]0[/C][C]1[/C][C]0.8758[/C][C]0.8386[/C][/ROW]
[ROW][C]66[/C][C]0.7[/C][C]5.3741[/C][C]2.9438[/C][C]7.8044[/C][C]1e-04[/C][C]0.9999[/C][C]0.8644[/C][C]0.8302[/C][/ROW]
[ROW][C]67[/C][C]0.36[/C][C]5.4845[/C][C]2.7411[/C][C]8.228[/C][C]1e-04[/C][C]0.9997[/C][C]0.8225[/C][C]0.8225[/C][/ROW]
[ROW][C]68[/C][C]0.35[/C][C]5.5945[/C][C]2.5253[/C][C]8.6636[/C][C]4e-04[/C][C]0.9996[/C][C]0.7958[/C][C]0.8151[/C][/ROW]
[ROW][C]69[/C][C]0.36[/C][C]5.7047[/C][C]2.298[/C][C]9.1114[/C][C]0.0011[/C][C]0.999[/C][C]0.7954[/C][C]0.8083[/C][/ROW]
[ROW][C]70[/C][C]0.36[/C][C]5.8148[/C][C]2.059[/C][C]9.5706[/C][C]0.0022[/C][C]0.9978[/C][C]0.8511[/C][C]0.8018[/C][/ROW]
[ROW][C]71[/C][C]0.36[/C][C]5.925[/C][C]1.8089[/C][C]10.0411[/C][C]0.004[/C][C]0.996[/C][C]0.9068[/C][C]0.7956[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69539&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69539&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[55])
434.06-------
444.05-------
454.03-------
463.94-------
474.02-------
483.88-------
494.02-------
504.03-------
514.09-------
523.99-------
534.01-------
544.01-------
554.19-------
564.34.25584.08784.42380.3030.77870.99180.7787
574.274.39414.10984.67830.19620.74170.9940.9203
583.824.48634.02894.94380.00220.8230.99040.8979
593.154.60783.975.245600.99230.96460.9004
602.494.71073.86345.55800.99980.97270.8858
611.814.82543.75525.8957010.92990.8777
621.264.93273.61956.2458010.91110.8662
631.065.04463.47446.6148010.88330.857
640.845.15363.31036.9968010.8920.8472
650.785.26453.13467.3943010.87580.8386
660.75.37412.94387.80441e-040.99990.86440.8302
670.365.48452.74118.2281e-040.99970.82250.8225
680.355.59452.52538.66364e-040.99960.79580.8151
690.365.70472.2989.11140.00110.9990.79540.8083
700.365.81482.0599.57060.00220.99780.85110.8018
710.365.9251.808910.04110.0040.9960.90680.7956







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
560.02010.010400.00200
570.033-0.02820.01930.01540.00870.0931
580.052-0.14850.06240.4440.15380.3922
590.0706-0.31640.12592.12520.64660.8041
600.0918-0.47140.1954.93171.50361.2262
610.1132-0.62490.26669.09282.76851.6639
620.1358-0.74460.334913.48854.29992.0736
630.1588-0.78990.391815.87735.74712.3973
640.1825-0.8370.441318.60717.1762.6788
650.2064-0.85180.482320.11048.46942.9102
660.2307-0.86970.517521.84749.68563.1122
670.2552-0.93440.552326.26111.06693.3267
680.2799-0.93740.581927.504712.33133.5116
690.3047-0.93690.607328.566213.4913.673
700.3295-0.93810.629329.754814.57523.8178
710.3544-0.93920.648730.968915.59983.9497

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
56 & 0.0201 & 0.0104 & 0 & 0.002 & 0 & 0 \tabularnewline
57 & 0.033 & -0.0282 & 0.0193 & 0.0154 & 0.0087 & 0.0931 \tabularnewline
58 & 0.052 & -0.1485 & 0.0624 & 0.444 & 0.1538 & 0.3922 \tabularnewline
59 & 0.0706 & -0.3164 & 0.1259 & 2.1252 & 0.6466 & 0.8041 \tabularnewline
60 & 0.0918 & -0.4714 & 0.195 & 4.9317 & 1.5036 & 1.2262 \tabularnewline
61 & 0.1132 & -0.6249 & 0.2666 & 9.0928 & 2.7685 & 1.6639 \tabularnewline
62 & 0.1358 & -0.7446 & 0.3349 & 13.4885 & 4.2999 & 2.0736 \tabularnewline
63 & 0.1588 & -0.7899 & 0.3918 & 15.8773 & 5.7471 & 2.3973 \tabularnewline
64 & 0.1825 & -0.837 & 0.4413 & 18.6071 & 7.176 & 2.6788 \tabularnewline
65 & 0.2064 & -0.8518 & 0.4823 & 20.1104 & 8.4694 & 2.9102 \tabularnewline
66 & 0.2307 & -0.8697 & 0.5175 & 21.8474 & 9.6856 & 3.1122 \tabularnewline
67 & 0.2552 & -0.9344 & 0.5523 & 26.261 & 11.0669 & 3.3267 \tabularnewline
68 & 0.2799 & -0.9374 & 0.5819 & 27.5047 & 12.3313 & 3.5116 \tabularnewline
69 & 0.3047 & -0.9369 & 0.6073 & 28.5662 & 13.491 & 3.673 \tabularnewline
70 & 0.3295 & -0.9381 & 0.6293 & 29.7548 & 14.5752 & 3.8178 \tabularnewline
71 & 0.3544 & -0.9392 & 0.6487 & 30.9689 & 15.5998 & 3.9497 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69539&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]56[/C][C]0.0201[/C][C]0.0104[/C][C]0[/C][C]0.002[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]0.033[/C][C]-0.0282[/C][C]0.0193[/C][C]0.0154[/C][C]0.0087[/C][C]0.0931[/C][/ROW]
[ROW][C]58[/C][C]0.052[/C][C]-0.1485[/C][C]0.0624[/C][C]0.444[/C][C]0.1538[/C][C]0.3922[/C][/ROW]
[ROW][C]59[/C][C]0.0706[/C][C]-0.3164[/C][C]0.1259[/C][C]2.1252[/C][C]0.6466[/C][C]0.8041[/C][/ROW]
[ROW][C]60[/C][C]0.0918[/C][C]-0.4714[/C][C]0.195[/C][C]4.9317[/C][C]1.5036[/C][C]1.2262[/C][/ROW]
[ROW][C]61[/C][C]0.1132[/C][C]-0.6249[/C][C]0.2666[/C][C]9.0928[/C][C]2.7685[/C][C]1.6639[/C][/ROW]
[ROW][C]62[/C][C]0.1358[/C][C]-0.7446[/C][C]0.3349[/C][C]13.4885[/C][C]4.2999[/C][C]2.0736[/C][/ROW]
[ROW][C]63[/C][C]0.1588[/C][C]-0.7899[/C][C]0.3918[/C][C]15.8773[/C][C]5.7471[/C][C]2.3973[/C][/ROW]
[ROW][C]64[/C][C]0.1825[/C][C]-0.837[/C][C]0.4413[/C][C]18.6071[/C][C]7.176[/C][C]2.6788[/C][/ROW]
[ROW][C]65[/C][C]0.2064[/C][C]-0.8518[/C][C]0.4823[/C][C]20.1104[/C][C]8.4694[/C][C]2.9102[/C][/ROW]
[ROW][C]66[/C][C]0.2307[/C][C]-0.8697[/C][C]0.5175[/C][C]21.8474[/C][C]9.6856[/C][C]3.1122[/C][/ROW]
[ROW][C]67[/C][C]0.2552[/C][C]-0.9344[/C][C]0.5523[/C][C]26.261[/C][C]11.0669[/C][C]3.3267[/C][/ROW]
[ROW][C]68[/C][C]0.2799[/C][C]-0.9374[/C][C]0.5819[/C][C]27.5047[/C][C]12.3313[/C][C]3.5116[/C][/ROW]
[ROW][C]69[/C][C]0.3047[/C][C]-0.9369[/C][C]0.6073[/C][C]28.5662[/C][C]13.491[/C][C]3.673[/C][/ROW]
[ROW][C]70[/C][C]0.3295[/C][C]-0.9381[/C][C]0.6293[/C][C]29.7548[/C][C]14.5752[/C][C]3.8178[/C][/ROW]
[ROW][C]71[/C][C]0.3544[/C][C]-0.9392[/C][C]0.6487[/C][C]30.9689[/C][C]15.5998[/C][C]3.9497[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69539&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69539&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
560.02010.010400.00200
570.033-0.02820.01930.01540.00870.0931
580.052-0.14850.06240.4440.15380.3922
590.0706-0.31640.12592.12520.64660.8041
600.0918-0.47140.1954.93171.50361.2262
610.1132-0.62490.26669.09282.76851.6639
620.1358-0.74460.334913.48854.29992.0736
630.1588-0.78990.391815.87735.74712.3973
640.1825-0.8370.441318.60717.1762.6788
650.2064-0.85180.482320.11048.46942.9102
660.2307-0.86970.517521.84749.68563.1122
670.2552-0.93440.552326.26111.06693.3267
680.2799-0.93740.581927.504712.33133.5116
690.3047-0.93690.607328.566213.4913.673
700.3295-0.93810.629329.754814.57523.8178
710.3544-0.93920.648730.968915.59983.9497



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