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 computationSun, 20 Dec 2009 08:45:46 -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/20/t1261324003qoq8vy8cohgd269.htm/, Retrieved Sat, 27 Apr 2024 12:53:10 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=69920, Retrieved Sat, 27 Apr 2024 12:53:10 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact137
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD    [ARIMA Forecasting] [] [2009-12-20 15:45:46] [791a4a78a0a7ca497fb8791b982a539e] [Current]
Feedback Forum

Post a new message
Dataseries X:
785.8
819.3
849.4
880.4
900.1
937.2
948.9
952.6
947.3
974.2
1000.8
1032.8
1050.7
1057.3
1075.4
1118.4
1179.8
1227
1257.8
1251.5
1236.3
1170.6
1213.1
1265.5
1300.8
1348.4
1371.9
1403.3
1451.8
1474.2
1438.2
1513.6
1562.2
1546.2
1527.5
1418.7
1448.5
1492.1
1395.4
1403.7
1316.6
1274.5
1264.4
1323.9
1332.1
1250.2
1096.7
1080.8
1039.2
792
746.6
688.8
715.8
672.9
629.5
681.2
755.4
760.6
765.9
836.8
904.9




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69920&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 time3 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[49])
371448.5-------
381492.1-------
391395.4-------
401403.7-------
411316.6-------
421274.5-------
431264.4-------
441323.9-------
451332.1-------
461250.2-------
471096.7-------
481080.8-------
491039.2-------
507921027.7117937.72311117.700300.401200.4012
51746.61014.3637867.07961161.64792e-040.998500.3705
52688.81013.1591820.32821205.995e-040.996600.3956
53715.81004.1782773.39831234.95810.00720.99630.0040.3831
54672.91000.0239736.37671263.67120.00750.98270.02070.3854
55629.51001.5589708.62161294.49620.00640.98610.03930.4006
56681.21002.828683.25011322.40590.02430.9890.02450.4117
57755.41000.8074656.63841344.97650.08110.96560.02960.4135
58760.6992.1996625.0811359.31810.10810.89690.08420.4009
59765.9980.4152591.69931369.13120.13970.86610.27880.3835
60836.8985.3823576.20691394.55770.23830.85350.32380.3983
61904.9981.0437552.38361409.70380.36390.74520.39520.3952

\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[49]) \tabularnewline
37 & 1448.5 & - & - & - & - & - & - & - \tabularnewline
38 & 1492.1 & - & - & - & - & - & - & - \tabularnewline
39 & 1395.4 & - & - & - & - & - & - & - \tabularnewline
40 & 1403.7 & - & - & - & - & - & - & - \tabularnewline
41 & 1316.6 & - & - & - & - & - & - & - \tabularnewline
42 & 1274.5 & - & - & - & - & - & - & - \tabularnewline
43 & 1264.4 & - & - & - & - & - & - & - \tabularnewline
44 & 1323.9 & - & - & - & - & - & - & - \tabularnewline
45 & 1332.1 & - & - & - & - & - & - & - \tabularnewline
46 & 1250.2 & - & - & - & - & - & - & - \tabularnewline
47 & 1096.7 & - & - & - & - & - & - & - \tabularnewline
48 & 1080.8 & - & - & - & - & - & - & - \tabularnewline
49 & 1039.2 & - & - & - & - & - & - & - \tabularnewline
50 & 792 & 1027.7117 & 937.7231 & 1117.7003 & 0 & 0.4012 & 0 & 0.4012 \tabularnewline
51 & 746.6 & 1014.3637 & 867.0796 & 1161.6479 & 2e-04 & 0.9985 & 0 & 0.3705 \tabularnewline
52 & 688.8 & 1013.1591 & 820.3282 & 1205.99 & 5e-04 & 0.9966 & 0 & 0.3956 \tabularnewline
53 & 715.8 & 1004.1782 & 773.3983 & 1234.9581 & 0.0072 & 0.9963 & 0.004 & 0.3831 \tabularnewline
54 & 672.9 & 1000.0239 & 736.3767 & 1263.6712 & 0.0075 & 0.9827 & 0.0207 & 0.3854 \tabularnewline
55 & 629.5 & 1001.5589 & 708.6216 & 1294.4962 & 0.0064 & 0.9861 & 0.0393 & 0.4006 \tabularnewline
56 & 681.2 & 1002.828 & 683.2501 & 1322.4059 & 0.0243 & 0.989 & 0.0245 & 0.4117 \tabularnewline
57 & 755.4 & 1000.8074 & 656.6384 & 1344.9765 & 0.0811 & 0.9656 & 0.0296 & 0.4135 \tabularnewline
58 & 760.6 & 992.1996 & 625.081 & 1359.3181 & 0.1081 & 0.8969 & 0.0842 & 0.4009 \tabularnewline
59 & 765.9 & 980.4152 & 591.6993 & 1369.1312 & 0.1397 & 0.8661 & 0.2788 & 0.3835 \tabularnewline
60 & 836.8 & 985.3823 & 576.2069 & 1394.5577 & 0.2383 & 0.8535 & 0.3238 & 0.3983 \tabularnewline
61 & 904.9 & 981.0437 & 552.3836 & 1409.7038 & 0.3639 & 0.7452 & 0.3952 & 0.3952 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69920&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[49])[/C][/ROW]
[ROW][C]37[/C][C]1448.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]1492.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]1395.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]1403.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]1316.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]1274.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]1264.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]1323.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]1332.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]1250.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]1096.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]1080.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]1039.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]792[/C][C]1027.7117[/C][C]937.7231[/C][C]1117.7003[/C][C]0[/C][C]0.4012[/C][C]0[/C][C]0.4012[/C][/ROW]
[ROW][C]51[/C][C]746.6[/C][C]1014.3637[/C][C]867.0796[/C][C]1161.6479[/C][C]2e-04[/C][C]0.9985[/C][C]0[/C][C]0.3705[/C][/ROW]
[ROW][C]52[/C][C]688.8[/C][C]1013.1591[/C][C]820.3282[/C][C]1205.99[/C][C]5e-04[/C][C]0.9966[/C][C]0[/C][C]0.3956[/C][/ROW]
[ROW][C]53[/C][C]715.8[/C][C]1004.1782[/C][C]773.3983[/C][C]1234.9581[/C][C]0.0072[/C][C]0.9963[/C][C]0.004[/C][C]0.3831[/C][/ROW]
[ROW][C]54[/C][C]672.9[/C][C]1000.0239[/C][C]736.3767[/C][C]1263.6712[/C][C]0.0075[/C][C]0.9827[/C][C]0.0207[/C][C]0.3854[/C][/ROW]
[ROW][C]55[/C][C]629.5[/C][C]1001.5589[/C][C]708.6216[/C][C]1294.4962[/C][C]0.0064[/C][C]0.9861[/C][C]0.0393[/C][C]0.4006[/C][/ROW]
[ROW][C]56[/C][C]681.2[/C][C]1002.828[/C][C]683.2501[/C][C]1322.4059[/C][C]0.0243[/C][C]0.989[/C][C]0.0245[/C][C]0.4117[/C][/ROW]
[ROW][C]57[/C][C]755.4[/C][C]1000.8074[/C][C]656.6384[/C][C]1344.9765[/C][C]0.0811[/C][C]0.9656[/C][C]0.0296[/C][C]0.4135[/C][/ROW]
[ROW][C]58[/C][C]760.6[/C][C]992.1996[/C][C]625.081[/C][C]1359.3181[/C][C]0.1081[/C][C]0.8969[/C][C]0.0842[/C][C]0.4009[/C][/ROW]
[ROW][C]59[/C][C]765.9[/C][C]980.4152[/C][C]591.6993[/C][C]1369.1312[/C][C]0.1397[/C][C]0.8661[/C][C]0.2788[/C][C]0.3835[/C][/ROW]
[ROW][C]60[/C][C]836.8[/C][C]985.3823[/C][C]576.2069[/C][C]1394.5577[/C][C]0.2383[/C][C]0.8535[/C][C]0.3238[/C][C]0.3983[/C][/ROW]
[ROW][C]61[/C][C]904.9[/C][C]981.0437[/C][C]552.3836[/C][C]1409.7038[/C][C]0.3639[/C][C]0.7452[/C][C]0.3952[/C][C]0.3952[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69920&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69920&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[49])
371448.5-------
381492.1-------
391395.4-------
401403.7-------
411316.6-------
421274.5-------
431264.4-------
441323.9-------
451332.1-------
461250.2-------
471096.7-------
481080.8-------
491039.2-------
507921027.7117937.72311117.700300.401200.4012
51746.61014.3637867.07961161.64792e-040.998500.3705
52688.81013.1591820.32821205.995e-040.996600.3956
53715.81004.1782773.39831234.95810.00720.99630.0040.3831
54672.91000.0239736.37671263.67120.00750.98270.02070.3854
55629.51001.5589708.62161294.49620.00640.98610.03930.4006
56681.21002.828683.25011322.40590.02430.9890.02450.4117
57755.41000.8074656.63841344.97650.08110.96560.02960.4135
58760.6992.1996625.0811359.31810.10810.89690.08420.4009
59765.9980.4152591.69931369.13120.13970.86610.27880.3835
60836.8985.3823576.20691394.55770.23830.85350.32380.3983
61904.9981.0437552.38361409.70380.36390.74520.39520.3952







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0447-0.2294055559.993700
510.0741-0.2640.246771697.420963628.7073252.2473
520.0971-0.32010.2712105208.85277488.7555278.368
530.1173-0.28720.275283161.968178907.0587280.904
540.1345-0.32710.2856107010.071984527.6613290.7364
550.1492-0.37150.2999138427.797793511.0174305.7957
560.1626-0.32070.3029103444.576194930.0972308.1073
570.1755-0.24520.295660224.801590591.9352300.9849
580.1888-0.23340.288753638.353586485.9817294.085
590.2023-0.21880.281746016.791882439.0627287.122
600.2119-0.15080.269822076.701276951.5753277.4015
610.2229-0.07760.25385797.863571022.0993266.4997

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0447 & -0.2294 & 0 & 55559.9937 & 0 & 0 \tabularnewline
51 & 0.0741 & -0.264 & 0.2467 & 71697.4209 & 63628.7073 & 252.2473 \tabularnewline
52 & 0.0971 & -0.3201 & 0.2712 & 105208.852 & 77488.7555 & 278.368 \tabularnewline
53 & 0.1173 & -0.2872 & 0.2752 & 83161.9681 & 78907.0587 & 280.904 \tabularnewline
54 & 0.1345 & -0.3271 & 0.2856 & 107010.0719 & 84527.6613 & 290.7364 \tabularnewline
55 & 0.1492 & -0.3715 & 0.2999 & 138427.7977 & 93511.0174 & 305.7957 \tabularnewline
56 & 0.1626 & -0.3207 & 0.3029 & 103444.5761 & 94930.0972 & 308.1073 \tabularnewline
57 & 0.1755 & -0.2452 & 0.2956 & 60224.8015 & 90591.9352 & 300.9849 \tabularnewline
58 & 0.1888 & -0.2334 & 0.2887 & 53638.3535 & 86485.9817 & 294.085 \tabularnewline
59 & 0.2023 & -0.2188 & 0.2817 & 46016.7918 & 82439.0627 & 287.122 \tabularnewline
60 & 0.2119 & -0.1508 & 0.2698 & 22076.7012 & 76951.5753 & 277.4015 \tabularnewline
61 & 0.2229 & -0.0776 & 0.2538 & 5797.8635 & 71022.0993 & 266.4997 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=69920&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]50[/C][C]0.0447[/C][C]-0.2294[/C][C]0[/C][C]55559.9937[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0741[/C][C]-0.264[/C][C]0.2467[/C][C]71697.4209[/C][C]63628.7073[/C][C]252.2473[/C][/ROW]
[ROW][C]52[/C][C]0.0971[/C][C]-0.3201[/C][C]0.2712[/C][C]105208.852[/C][C]77488.7555[/C][C]278.368[/C][/ROW]
[ROW][C]53[/C][C]0.1173[/C][C]-0.2872[/C][C]0.2752[/C][C]83161.9681[/C][C]78907.0587[/C][C]280.904[/C][/ROW]
[ROW][C]54[/C][C]0.1345[/C][C]-0.3271[/C][C]0.2856[/C][C]107010.0719[/C][C]84527.6613[/C][C]290.7364[/C][/ROW]
[ROW][C]55[/C][C]0.1492[/C][C]-0.3715[/C][C]0.2999[/C][C]138427.7977[/C][C]93511.0174[/C][C]305.7957[/C][/ROW]
[ROW][C]56[/C][C]0.1626[/C][C]-0.3207[/C][C]0.3029[/C][C]103444.5761[/C][C]94930.0972[/C][C]308.1073[/C][/ROW]
[ROW][C]57[/C][C]0.1755[/C][C]-0.2452[/C][C]0.2956[/C][C]60224.8015[/C][C]90591.9352[/C][C]300.9849[/C][/ROW]
[ROW][C]58[/C][C]0.1888[/C][C]-0.2334[/C][C]0.2887[/C][C]53638.3535[/C][C]86485.9817[/C][C]294.085[/C][/ROW]
[ROW][C]59[/C][C]0.2023[/C][C]-0.2188[/C][C]0.2817[/C][C]46016.7918[/C][C]82439.0627[/C][C]287.122[/C][/ROW]
[ROW][C]60[/C][C]0.2119[/C][C]-0.1508[/C][C]0.2698[/C][C]22076.7012[/C][C]76951.5753[/C][C]277.4015[/C][/ROW]
[ROW][C]61[/C][C]0.2229[/C][C]-0.0776[/C][C]0.2538[/C][C]5797.8635[/C][C]71022.0993[/C][C]266.4997[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=69920&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=69920&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
500.0447-0.2294055559.993700
510.0741-0.2640.246771697.420963628.7073252.2473
520.0971-0.32010.2712105208.85277488.7555278.368
530.1173-0.28720.275283161.968178907.0587280.904
540.1345-0.32710.2856107010.071984527.6613290.7364
550.1492-0.37150.2999138427.797793511.0174305.7957
560.1626-0.32070.3029103444.576194930.0972308.1073
570.1755-0.24520.295660224.801590591.9352300.9849
580.1888-0.23340.288753638.353586485.9817294.085
590.2023-0.21880.281746016.791882439.0627287.122
600.2119-0.15080.269822076.701276951.5753277.4015
610.2229-0.07760.25385797.863571022.0993266.4997



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