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 computationMon, 21 Dec 2009 09:44:35 -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/21/t1261413932jq5dpcuxqv9l6tc.htm/, Retrieved Sun, 05 May 2024 14:45:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70340, Retrieved Sun, 05 May 2024 14:45:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsForecasting
Estimated Impact98
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting ] [2009-12-21 16:44:35] [64e929ed9a52e44aa31e1ff8e49d1c0b] [Current]
Feedback Forum

Post a new message
Dataseries X:
699.8
871.2
842.6
809.2
847.1
857
839.9
967.4
1037.2
1062.3
899.3
1129.6
845.7
1173.9
1073.8
1024.7
912.9
1055
936.4
920.6
1059.3
1164.1
823.9
1076.6
833.5
996
852.8
758.5
760.4
826.8
941.7
1097.8
802.8
839.7
791
1063.1
1138.4
888.6
931.1
863.2
936.2
701.7
873.8
696.8
658.1
706.7
458.5
685.7
660.1
774.9
787.4
486.9
310.8
619.5
550.2
463.4
630.4
729
485.6
453.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' @ 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=70340&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=70340&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70340&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[48])
361063.1-------
371138.4-------
38888.6-------
39931.1-------
40863.2-------
41936.2-------
42701.7-------
43873.8-------
44696.8-------
45658.1-------
46706.7-------
47458.5-------
48685.7-------
49660.1586.1173298.7781873.45650.30690.24851e-040.2485
50774.9607.2753272.7098941.84070.1630.37850.04970.323
51787.4563.6405164.2222963.05870.13610.14990.03570.2746
52486.9494.495648.12940.87130.48670.09920.05270.2006
53310.8494.18012.1804986.17980.23250.51160.03910.2227
54619.5446.6988-85.8542979.25180.26240.69150.1740.1895
55550.2516.0606-54.61381086.7350.45330.36120.10960.2801
56463.4467.7683-138.46651074.00310.49440.39490.22950.2405
57630.4422.4934-217.39311062.37990.26210.45010.23520.2101
58729485.545-186.2851157.37490.23880.33630.25940.2796
59485.6256.6068-445.7248958.93850.26140.09370.28660.1156
60453.7502.3148-229.24411233.87370.44820.51790.31160.3116

\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 & 1063.1 & - & - & - & - & - & - & - \tabularnewline
37 & 1138.4 & - & - & - & - & - & - & - \tabularnewline
38 & 888.6 & - & - & - & - & - & - & - \tabularnewline
39 & 931.1 & - & - & - & - & - & - & - \tabularnewline
40 & 863.2 & - & - & - & - & - & - & - \tabularnewline
41 & 936.2 & - & - & - & - & - & - & - \tabularnewline
42 & 701.7 & - & - & - & - & - & - & - \tabularnewline
43 & 873.8 & - & - & - & - & - & - & - \tabularnewline
44 & 696.8 & - & - & - & - & - & - & - \tabularnewline
45 & 658.1 & - & - & - & - & - & - & - \tabularnewline
46 & 706.7 & - & - & - & - & - & - & - \tabularnewline
47 & 458.5 & - & - & - & - & - & - & - \tabularnewline
48 & 685.7 & - & - & - & - & - & - & - \tabularnewline
49 & 660.1 & 586.1173 & 298.7781 & 873.4565 & 0.3069 & 0.2485 & 1e-04 & 0.2485 \tabularnewline
50 & 774.9 & 607.2753 & 272.7098 & 941.8407 & 0.163 & 0.3785 & 0.0497 & 0.323 \tabularnewline
51 & 787.4 & 563.6405 & 164.2222 & 963.0587 & 0.1361 & 0.1499 & 0.0357 & 0.2746 \tabularnewline
52 & 486.9 & 494.4956 & 48.12 & 940.8713 & 0.4867 & 0.0992 & 0.0527 & 0.2006 \tabularnewline
53 & 310.8 & 494.1801 & 2.1804 & 986.1798 & 0.2325 & 0.5116 & 0.0391 & 0.2227 \tabularnewline
54 & 619.5 & 446.6988 & -85.8542 & 979.2518 & 0.2624 & 0.6915 & 0.174 & 0.1895 \tabularnewline
55 & 550.2 & 516.0606 & -54.6138 & 1086.735 & 0.4533 & 0.3612 & 0.1096 & 0.2801 \tabularnewline
56 & 463.4 & 467.7683 & -138.4665 & 1074.0031 & 0.4944 & 0.3949 & 0.2295 & 0.2405 \tabularnewline
57 & 630.4 & 422.4934 & -217.3931 & 1062.3799 & 0.2621 & 0.4501 & 0.2352 & 0.2101 \tabularnewline
58 & 729 & 485.545 & -186.285 & 1157.3749 & 0.2388 & 0.3363 & 0.2594 & 0.2796 \tabularnewline
59 & 485.6 & 256.6068 & -445.7248 & 958.9385 & 0.2614 & 0.0937 & 0.2866 & 0.1156 \tabularnewline
60 & 453.7 & 502.3148 & -229.2441 & 1233.8737 & 0.4482 & 0.5179 & 0.3116 & 0.3116 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70340&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]1063.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]1138.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]888.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]931.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]863.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]936.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]701.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]873.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]696.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]658.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]706.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]458.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]685.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]660.1[/C][C]586.1173[/C][C]298.7781[/C][C]873.4565[/C][C]0.3069[/C][C]0.2485[/C][C]1e-04[/C][C]0.2485[/C][/ROW]
[ROW][C]50[/C][C]774.9[/C][C]607.2753[/C][C]272.7098[/C][C]941.8407[/C][C]0.163[/C][C]0.3785[/C][C]0.0497[/C][C]0.323[/C][/ROW]
[ROW][C]51[/C][C]787.4[/C][C]563.6405[/C][C]164.2222[/C][C]963.0587[/C][C]0.1361[/C][C]0.1499[/C][C]0.0357[/C][C]0.2746[/C][/ROW]
[ROW][C]52[/C][C]486.9[/C][C]494.4956[/C][C]48.12[/C][C]940.8713[/C][C]0.4867[/C][C]0.0992[/C][C]0.0527[/C][C]0.2006[/C][/ROW]
[ROW][C]53[/C][C]310.8[/C][C]494.1801[/C][C]2.1804[/C][C]986.1798[/C][C]0.2325[/C][C]0.5116[/C][C]0.0391[/C][C]0.2227[/C][/ROW]
[ROW][C]54[/C][C]619.5[/C][C]446.6988[/C][C]-85.8542[/C][C]979.2518[/C][C]0.2624[/C][C]0.6915[/C][C]0.174[/C][C]0.1895[/C][/ROW]
[ROW][C]55[/C][C]550.2[/C][C]516.0606[/C][C]-54.6138[/C][C]1086.735[/C][C]0.4533[/C][C]0.3612[/C][C]0.1096[/C][C]0.2801[/C][/ROW]
[ROW][C]56[/C][C]463.4[/C][C]467.7683[/C][C]-138.4665[/C][C]1074.0031[/C][C]0.4944[/C][C]0.3949[/C][C]0.2295[/C][C]0.2405[/C][/ROW]
[ROW][C]57[/C][C]630.4[/C][C]422.4934[/C][C]-217.3931[/C][C]1062.3799[/C][C]0.2621[/C][C]0.4501[/C][C]0.2352[/C][C]0.2101[/C][/ROW]
[ROW][C]58[/C][C]729[/C][C]485.545[/C][C]-186.285[/C][C]1157.3749[/C][C]0.2388[/C][C]0.3363[/C][C]0.2594[/C][C]0.2796[/C][/ROW]
[ROW][C]59[/C][C]485.6[/C][C]256.6068[/C][C]-445.7248[/C][C]958.9385[/C][C]0.2614[/C][C]0.0937[/C][C]0.2866[/C][C]0.1156[/C][/ROW]
[ROW][C]60[/C][C]453.7[/C][C]502.3148[/C][C]-229.2441[/C][C]1233.8737[/C][C]0.4482[/C][C]0.5179[/C][C]0.3116[/C][C]0.3116[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70340&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70340&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])
361063.1-------
371138.4-------
38888.6-------
39931.1-------
40863.2-------
41936.2-------
42701.7-------
43873.8-------
44696.8-------
45658.1-------
46706.7-------
47458.5-------
48685.7-------
49660.1586.1173298.7781873.45650.30690.24851e-040.2485
50774.9607.2753272.7098941.84070.1630.37850.04970.323
51787.4563.6405164.2222963.05870.13610.14990.03570.2746
52486.9494.495648.12940.87130.48670.09920.05270.2006
53310.8494.18012.1804986.17980.23250.51160.03910.2227
54619.5446.6988-85.8542979.25180.26240.69150.1740.1895
55550.2516.0606-54.61381086.7350.45330.36120.10960.2801
56463.4467.7683-138.46651074.00310.49440.39490.22950.2405
57630.4422.4934-217.39311062.37990.26210.45010.23520.2101
58729485.545-186.2851157.37490.23880.33630.25940.2796
59485.6256.6068-445.7248958.93850.26140.09370.28660.1156
60453.7502.3148-229.24411233.87370.44820.51790.31160.3116







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.25010.126205473.434700
500.28110.2760.201128098.045316785.74129.5598
510.36160.3970.266450068.333727879.9379166.9729
520.4606-0.01540.203757.693920924.3769144.6526
530.508-0.37110.237133628.269223465.1554153.1834
540.60830.38680.262129860.24224531.0031156.6238
550.56420.06620.23411165.499221193.074145.5784
560.6612-0.00930.20619.081918546.325136.1849
570.77270.49210.237843225.155221288.4172145.9055
580.70590.50140.264259270.343525086.6099158.3875
591.39640.89240.321352437.862927573.0874166.0515
600.743-0.09680.30262363.400225472.2802159.6004

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.2501 & 0.1262 & 0 & 5473.4347 & 0 & 0 \tabularnewline
50 & 0.2811 & 0.276 & 0.2011 & 28098.0453 & 16785.74 & 129.5598 \tabularnewline
51 & 0.3616 & 0.397 & 0.2664 & 50068.3337 & 27879.9379 & 166.9729 \tabularnewline
52 & 0.4606 & -0.0154 & 0.2037 & 57.6939 & 20924.3769 & 144.6526 \tabularnewline
53 & 0.508 & -0.3711 & 0.2371 & 33628.2692 & 23465.1554 & 153.1834 \tabularnewline
54 & 0.6083 & 0.3868 & 0.2621 & 29860.242 & 24531.0031 & 156.6238 \tabularnewline
55 & 0.5642 & 0.0662 & 0.2341 & 1165.4992 & 21193.074 & 145.5784 \tabularnewline
56 & 0.6612 & -0.0093 & 0.206 & 19.0819 & 18546.325 & 136.1849 \tabularnewline
57 & 0.7727 & 0.4921 & 0.2378 & 43225.1552 & 21288.4172 & 145.9055 \tabularnewline
58 & 0.7059 & 0.5014 & 0.2642 & 59270.3435 & 25086.6099 & 158.3875 \tabularnewline
59 & 1.3964 & 0.8924 & 0.3213 & 52437.8629 & 27573.0874 & 166.0515 \tabularnewline
60 & 0.743 & -0.0968 & 0.3026 & 2363.4002 & 25472.2802 & 159.6004 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70340&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.2501[/C][C]0.1262[/C][C]0[/C][C]5473.4347[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.2811[/C][C]0.276[/C][C]0.2011[/C][C]28098.0453[/C][C]16785.74[/C][C]129.5598[/C][/ROW]
[ROW][C]51[/C][C]0.3616[/C][C]0.397[/C][C]0.2664[/C][C]50068.3337[/C][C]27879.9379[/C][C]166.9729[/C][/ROW]
[ROW][C]52[/C][C]0.4606[/C][C]-0.0154[/C][C]0.2037[/C][C]57.6939[/C][C]20924.3769[/C][C]144.6526[/C][/ROW]
[ROW][C]53[/C][C]0.508[/C][C]-0.3711[/C][C]0.2371[/C][C]33628.2692[/C][C]23465.1554[/C][C]153.1834[/C][/ROW]
[ROW][C]54[/C][C]0.6083[/C][C]0.3868[/C][C]0.2621[/C][C]29860.242[/C][C]24531.0031[/C][C]156.6238[/C][/ROW]
[ROW][C]55[/C][C]0.5642[/C][C]0.0662[/C][C]0.2341[/C][C]1165.4992[/C][C]21193.074[/C][C]145.5784[/C][/ROW]
[ROW][C]56[/C][C]0.6612[/C][C]-0.0093[/C][C]0.206[/C][C]19.0819[/C][C]18546.325[/C][C]136.1849[/C][/ROW]
[ROW][C]57[/C][C]0.7727[/C][C]0.4921[/C][C]0.2378[/C][C]43225.1552[/C][C]21288.4172[/C][C]145.9055[/C][/ROW]
[ROW][C]58[/C][C]0.7059[/C][C]0.5014[/C][C]0.2642[/C][C]59270.3435[/C][C]25086.6099[/C][C]158.3875[/C][/ROW]
[ROW][C]59[/C][C]1.3964[/C][C]0.8924[/C][C]0.3213[/C][C]52437.8629[/C][C]27573.0874[/C][C]166.0515[/C][/ROW]
[ROW][C]60[/C][C]0.743[/C][C]-0.0968[/C][C]0.3026[/C][C]2363.4002[/C][C]25472.2802[/C][C]159.6004[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70340&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70340&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.25010.126205473.434700
500.28110.2760.201128098.045316785.74129.5598
510.36160.3970.266450068.333727879.9379166.9729
520.4606-0.01540.203757.693920924.3769144.6526
530.508-0.37110.237133628.269223465.1554153.1834
540.60830.38680.262129860.24224531.0031156.6238
550.56420.06620.23411165.499221193.074145.5784
560.6612-0.00930.20619.081918546.325136.1849
570.77270.49210.237843225.155221288.4172145.9055
580.70590.50140.264259270.343525086.6099158.3875
591.39640.89240.321352437.862927573.0874166.0515
600.743-0.09680.30262363.400225472.2802159.6004



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