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 computationFri, 09 Dec 2011 07:23:21 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/09/t1323433462vv08q516w8cccpt.htm/, Retrieved Thu, 02 May 2024 14:27:16 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=153294, Retrieved Thu, 02 May 2024 14:27:16 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact126
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Variance Reduction Matrix] [] [2011-12-09 11:37:33] [f2faabc3a2466a29562900bc59f67898]
- RMPD    [ARIMA Forecasting] [] [2011-12-09 12:23:21] [5988e21ec0676b551e455a86717edc1d] [Current]
Feedback Forum

Post a new message
Dataseries X:
31956
29506
34506
27165
26736
23691
18157
17328
18205
20995
17382
9367
31124
26551
30651
25859
25100
25778
20418
18688
20424
24776
19814
12738
31566
30111
30019
31934
25826
26835
20205
17789
20520
22518
15572
11509
25447
24090
27786
26195
20516
22759
19028
16971
20036
22485
18730
14538
27561
25985
34670
32066
27186
29586
21359
21553
19573
24256
22380
16167




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=153294&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' @ 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[48])
3611509-------
3725447-------
3824090-------
3927786-------
4026195-------
4120516-------
4222759-------
4319028-------
4416971-------
4520036-------
4622485-------
4718730-------
4814538-------
492756127902.120423426.31232377.92880.440610.85881
502598526545.120421369.835431720.40540.4160.35020.82381
513467030241.120424450.240636032.00020.06690.92510.7971
523206628650.120422303.073634997.16720.14570.03150.77581
532718622971.120416112.861429829.37940.11420.00470.75850.992
542958625214.120417880.197132548.04370.12130.29910.74410.9978
552135921483.120413702.558429263.68240.48750.02060.73190.9599
562155319426.120411223.202727629.03810.30570.32210.72130.8786
571957322491.120413886.553431095.68740.25310.58460.7120.965
582425624940.120415951.834333928.40650.44070.87910.70380.9883
592238021185.120411828.839130541.40170.40120.260.69650.9181
601616716993.12047282.779826703.4610.43380.13840.68990.6899

\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[48]) \tabularnewline
36 & 11509 & - & - & - & - & - & - & - \tabularnewline
37 & 25447 & - & - & - & - & - & - & - \tabularnewline
38 & 24090 & - & - & - & - & - & - & - \tabularnewline
39 & 27786 & - & - & - & - & - & - & - \tabularnewline
40 & 26195 & - & - & - & - & - & - & - \tabularnewline
41 & 20516 & - & - & - & - & - & - & - \tabularnewline
42 & 22759 & - & - & - & - & - & - & - \tabularnewline
43 & 19028 & - & - & - & - & - & - & - \tabularnewline
44 & 16971 & - & - & - & - & - & - & - \tabularnewline
45 & 20036 & - & - & - & - & - & - & - \tabularnewline
46 & 22485 & - & - & - & - & - & - & - \tabularnewline
47 & 18730 & - & - & - & - & - & - & - \tabularnewline
48 & 14538 & - & - & - & - & - & - & - \tabularnewline
49 & 27561 & 27902.1204 & 23426.312 & 32377.9288 & 0.4406 & 1 & 0.8588 & 1 \tabularnewline
50 & 25985 & 26545.1204 & 21369.8354 & 31720.4054 & 0.416 & 0.3502 & 0.8238 & 1 \tabularnewline
51 & 34670 & 30241.1204 & 24450.2406 & 36032.0002 & 0.0669 & 0.9251 & 0.797 & 1 \tabularnewline
52 & 32066 & 28650.1204 & 22303.0736 & 34997.1672 & 0.1457 & 0.0315 & 0.7758 & 1 \tabularnewline
53 & 27186 & 22971.1204 & 16112.8614 & 29829.3794 & 0.1142 & 0.0047 & 0.7585 & 0.992 \tabularnewline
54 & 29586 & 25214.1204 & 17880.1971 & 32548.0437 & 0.1213 & 0.2991 & 0.7441 & 0.9978 \tabularnewline
55 & 21359 & 21483.1204 & 13702.5584 & 29263.6824 & 0.4875 & 0.0206 & 0.7319 & 0.9599 \tabularnewline
56 & 21553 & 19426.1204 & 11223.2027 & 27629.0381 & 0.3057 & 0.3221 & 0.7213 & 0.8786 \tabularnewline
57 & 19573 & 22491.1204 & 13886.5534 & 31095.6874 & 0.2531 & 0.5846 & 0.712 & 0.965 \tabularnewline
58 & 24256 & 24940.1204 & 15951.8343 & 33928.4065 & 0.4407 & 0.8791 & 0.7038 & 0.9883 \tabularnewline
59 & 22380 & 21185.1204 & 11828.8391 & 30541.4017 & 0.4012 & 0.26 & 0.6965 & 0.9181 \tabularnewline
60 & 16167 & 16993.1204 & 7282.7798 & 26703.461 & 0.4338 & 0.1384 & 0.6899 & 0.6899 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=153294&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[48])[/C][/ROW]
[ROW][C]36[/C][C]11509[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]25447[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]24090[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]27786[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]26195[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]20516[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]22759[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]19028[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]16971[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]20036[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]22485[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]18730[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]14538[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]27561[/C][C]27902.1204[/C][C]23426.312[/C][C]32377.9288[/C][C]0.4406[/C][C]1[/C][C]0.8588[/C][C]1[/C][/ROW]
[ROW][C]50[/C][C]25985[/C][C]26545.1204[/C][C]21369.8354[/C][C]31720.4054[/C][C]0.416[/C][C]0.3502[/C][C]0.8238[/C][C]1[/C][/ROW]
[ROW][C]51[/C][C]34670[/C][C]30241.1204[/C][C]24450.2406[/C][C]36032.0002[/C][C]0.0669[/C][C]0.9251[/C][C]0.797[/C][C]1[/C][/ROW]
[ROW][C]52[/C][C]32066[/C][C]28650.1204[/C][C]22303.0736[/C][C]34997.1672[/C][C]0.1457[/C][C]0.0315[/C][C]0.7758[/C][C]1[/C][/ROW]
[ROW][C]53[/C][C]27186[/C][C]22971.1204[/C][C]16112.8614[/C][C]29829.3794[/C][C]0.1142[/C][C]0.0047[/C][C]0.7585[/C][C]0.992[/C][/ROW]
[ROW][C]54[/C][C]29586[/C][C]25214.1204[/C][C]17880.1971[/C][C]32548.0437[/C][C]0.1213[/C][C]0.2991[/C][C]0.7441[/C][C]0.9978[/C][/ROW]
[ROW][C]55[/C][C]21359[/C][C]21483.1204[/C][C]13702.5584[/C][C]29263.6824[/C][C]0.4875[/C][C]0.0206[/C][C]0.7319[/C][C]0.9599[/C][/ROW]
[ROW][C]56[/C][C]21553[/C][C]19426.1204[/C][C]11223.2027[/C][C]27629.0381[/C][C]0.3057[/C][C]0.3221[/C][C]0.7213[/C][C]0.8786[/C][/ROW]
[ROW][C]57[/C][C]19573[/C][C]22491.1204[/C][C]13886.5534[/C][C]31095.6874[/C][C]0.2531[/C][C]0.5846[/C][C]0.712[/C][C]0.965[/C][/ROW]
[ROW][C]58[/C][C]24256[/C][C]24940.1204[/C][C]15951.8343[/C][C]33928.4065[/C][C]0.4407[/C][C]0.8791[/C][C]0.7038[/C][C]0.9883[/C][/ROW]
[ROW][C]59[/C][C]22380[/C][C]21185.1204[/C][C]11828.8391[/C][C]30541.4017[/C][C]0.4012[/C][C]0.26[/C][C]0.6965[/C][C]0.9181[/C][/ROW]
[ROW][C]60[/C][C]16167[/C][C]16993.1204[/C][C]7282.7798[/C][C]26703.461[/C][C]0.4338[/C][C]0.1384[/C][C]0.6899[/C][C]0.6899[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=153294&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=153294&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[48])
3611509-------
3725447-------
3824090-------
3927786-------
4026195-------
4120516-------
4222759-------
4319028-------
4416971-------
4520036-------
4622485-------
4718730-------
4814538-------
492756127902.120423426.31232377.92880.440610.85881
502598526545.120421369.835431720.40540.4160.35020.82381
513467030241.120424450.240636032.00020.06690.92510.7971
523206628650.120422303.073634997.16720.14570.03150.77581
532718622971.120416112.861429829.37940.11420.00470.75850.992
542958625214.120417880.197132548.04370.12130.29910.74410.9978
552135921483.120413702.558429263.68240.48750.02060.73190.9599
562155319426.120411223.202727629.03810.30570.32210.72130.8786
571957322491.120413886.553431095.68740.25310.58460.7120.965
582425624940.120415951.834333928.40650.44070.87910.70380.9883
592238021185.120411828.839130541.40170.40120.260.69650.9181
601616716993.12047282.779826703.4610.43380.13840.68990.6899







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0818-0.01220116363.129200
500.0995-0.02110.0167313734.8655215048.9973463.7338
510.09770.14650.059919614974.48726681690.82732584.8967
520.1130.11920.074811668233.42317928326.47622815.7284
530.15230.18350.096517765210.01969895703.18493145.7437
540.14840.17340.109319113331.213111431974.52293381.1203
550.1848-0.00580.094515405.87449801036.14463130.6607
560.21540.10950.09644523616.82139141358.72923023.468
570.1952-0.12970.10018515426.68489071810.72423011.9447
580.1839-0.02740.0928468020.72548211431.72442865.5596
590.22530.05640.08951427737.2527594732.22692755.8542
600.2915-0.04860.0861682474.91987018710.78462649.285

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0818 & -0.0122 & 0 & 116363.1292 & 0 & 0 \tabularnewline
50 & 0.0995 & -0.0211 & 0.0167 & 313734.8655 & 215048.9973 & 463.7338 \tabularnewline
51 & 0.0977 & 0.1465 & 0.0599 & 19614974.4872 & 6681690.8273 & 2584.8967 \tabularnewline
52 & 0.113 & 0.1192 & 0.0748 & 11668233.4231 & 7928326.4762 & 2815.7284 \tabularnewline
53 & 0.1523 & 0.1835 & 0.0965 & 17765210.0196 & 9895703.1849 & 3145.7437 \tabularnewline
54 & 0.1484 & 0.1734 & 0.1093 & 19113331.2131 & 11431974.5229 & 3381.1203 \tabularnewline
55 & 0.1848 & -0.0058 & 0.0945 & 15405.8744 & 9801036.1446 & 3130.6607 \tabularnewline
56 & 0.2154 & 0.1095 & 0.0964 & 4523616.8213 & 9141358.7292 & 3023.468 \tabularnewline
57 & 0.1952 & -0.1297 & 0.1001 & 8515426.6848 & 9071810.7242 & 3011.9447 \tabularnewline
58 & 0.1839 & -0.0274 & 0.0928 & 468020.7254 & 8211431.7244 & 2865.5596 \tabularnewline
59 & 0.2253 & 0.0564 & 0.0895 & 1427737.252 & 7594732.2269 & 2755.8542 \tabularnewline
60 & 0.2915 & -0.0486 & 0.0861 & 682474.9198 & 7018710.7846 & 2649.285 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=153294&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]49[/C][C]0.0818[/C][C]-0.0122[/C][C]0[/C][C]116363.1292[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0995[/C][C]-0.0211[/C][C]0.0167[/C][C]313734.8655[/C][C]215048.9973[/C][C]463.7338[/C][/ROW]
[ROW][C]51[/C][C]0.0977[/C][C]0.1465[/C][C]0.0599[/C][C]19614974.4872[/C][C]6681690.8273[/C][C]2584.8967[/C][/ROW]
[ROW][C]52[/C][C]0.113[/C][C]0.1192[/C][C]0.0748[/C][C]11668233.4231[/C][C]7928326.4762[/C][C]2815.7284[/C][/ROW]
[ROW][C]53[/C][C]0.1523[/C][C]0.1835[/C][C]0.0965[/C][C]17765210.0196[/C][C]9895703.1849[/C][C]3145.7437[/C][/ROW]
[ROW][C]54[/C][C]0.1484[/C][C]0.1734[/C][C]0.1093[/C][C]19113331.2131[/C][C]11431974.5229[/C][C]3381.1203[/C][/ROW]
[ROW][C]55[/C][C]0.1848[/C][C]-0.0058[/C][C]0.0945[/C][C]15405.8744[/C][C]9801036.1446[/C][C]3130.6607[/C][/ROW]
[ROW][C]56[/C][C]0.2154[/C][C]0.1095[/C][C]0.0964[/C][C]4523616.8213[/C][C]9141358.7292[/C][C]3023.468[/C][/ROW]
[ROW][C]57[/C][C]0.1952[/C][C]-0.1297[/C][C]0.1001[/C][C]8515426.6848[/C][C]9071810.7242[/C][C]3011.9447[/C][/ROW]
[ROW][C]58[/C][C]0.1839[/C][C]-0.0274[/C][C]0.0928[/C][C]468020.7254[/C][C]8211431.7244[/C][C]2865.5596[/C][/ROW]
[ROW][C]59[/C][C]0.2253[/C][C]0.0564[/C][C]0.0895[/C][C]1427737.252[/C][C]7594732.2269[/C][C]2755.8542[/C][/ROW]
[ROW][C]60[/C][C]0.2915[/C][C]-0.0486[/C][C]0.0861[/C][C]682474.9198[/C][C]7018710.7846[/C][C]2649.285[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=153294&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=153294&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
490.0818-0.01220116363.129200
500.0995-0.02110.0167313734.8655215048.9973463.7338
510.09770.14650.059919614974.48726681690.82732584.8967
520.1130.11920.074811668233.42317928326.47622815.7284
530.15230.18350.096517765210.01969895703.18493145.7437
540.14840.17340.109319113331.213111431974.52293381.1203
550.1848-0.00580.094515405.87449801036.14463130.6607
560.21540.10950.09644523616.82139141358.72923023.468
570.1952-0.12970.10018515426.68489071810.72423011.9447
580.1839-0.02740.0928468020.72548211431.72442865.5596
590.22530.05640.08951427737.2527594732.22692755.8542
600.2915-0.04860.0861682474.91987018710.78462649.285



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