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, 22 Dec 2008 08:10: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/2008/Dec/22/t12299587571q5oy8xhtiamw47.htm/, Retrieved Mon, 13 May 2024 05:30:03 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=36092, Retrieved Mon, 13 May 2024 05:30:03 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact227
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [Univariate Data Series] [Airline data] [2007-10-18 09:58:47] [42daae401fd3def69a25014f2252b4c2]
- R PD  [Univariate Data Series] [Tijdreeks 2 Buite...] [2008-12-11 16:25:30] [2d4aec5ed1856c4828162be37be304d9]
- RMP     [Central Tendency] [Central tendency ...] [2008-12-11 17:41:16] [2d4aec5ed1856c4828162be37be304d9]
- RMP       [Blocked Bootstrap Plot - Central Tendency] [Blocked Bootstrap...] [2008-12-12 08:14:08] [2d4aec5ed1856c4828162be37be304d9]
- RMP         [Tukey lambda PPCC Plot] [Tukey Lambda PPCC...] [2008-12-12 08:45:26] [2d4aec5ed1856c4828162be37be304d9]
- RMP           [Univariate Explorative Data Analysis] [Lag plot + ACF Ti...] [2008-12-12 08:54:04] [2d4aec5ed1856c4828162be37be304d9]
- RMP             [Variance Reduction Matrix] [VRM tijdreeks 2] [2008-12-12 10:58:24] [2d4aec5ed1856c4828162be37be304d9]
- RMP               [(Partial) Autocorrelation Function] [P(ACF) Tijdreeks ...] [2008-12-12 12:17:09] [2d4aec5ed1856c4828162be37be304d9]
- RMP                 [ARIMA Backward Selection] [ARIMA Backward Se...] [2008-12-12 12:29:19] [2d4aec5ed1856c4828162be37be304d9]
- RMP                     [ARIMA Forecasting] [Arima forecast (p...] [2008-12-22 15:10:16] [d7f41258beeebb8716e3f5d39f3cdc01] [Current]
Feedback Forum

Post a new message
Dataseries X:
2220.6
2161.5
1863.6
1955.1
1907.4
1889.4
2246.3
2213
1965
2285.6
1983.8
1872.4
2371.4
2287
2198.2
2330.4
2014.4
2066.1
2355.8
2232.5
2091.7
2376.5
1931.9
2025.7
2404.9
2316.1
2368.1
2282.5
2158.6
2174.8
2594.1
2281.4
2547.9
2606.3
2190.8
2262.3
2423.8
2520.4
2482.9
2215.9
2441.9
2333.8
2670.2
2431
2559.3
2661.4
2404.6
2378.3
2489.2
2941
2700.9
2335.6
2770
2764.2
2784.9
2898.8
2853.4
3022.6
2851.4
2630.8




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36092&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[48])
362262.3-------
372423.8-------
382520.4-------
392482.9-------
402215.9-------
412441.9-------
422333.8-------
432670.2-------
442431-------
452559.3-------
462661.4-------
472404.6-------
482378.3-------
492489.22533.17622296.97472778.53550.36270.8920.80890.892
5029412668.13732424.59572920.91450.01720.91730.8740.9877
512700.92588.51122335.05642852.3060.20180.00440.78370.9408
522335.62318.62012050.95342599.26050.45280.00380.76340.3384
5327702550.84872266.99712847.93780.07410.92220.76390.8725
542764.22424.96672136.61922727.73170.0140.01280.72250.6187
552784.92765.56772450.6643095.51570.45430.50320.71450.9893
562898.82518.55962210.09842842.9320.01080.05380.70160.8016
572853.42640.97232319.44142978.98470.1090.06750.68210.9361
583022.62741.51182409.14713090.83750.05740.26510.67350.9792
592851.42476.98722154.00782817.76610.01569e-040.66140.7148
602630.82445.77142120.18572789.69840.14580.01040.64970.6497

\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 & 2262.3 & - & - & - & - & - & - & - \tabularnewline
37 & 2423.8 & - & - & - & - & - & - & - \tabularnewline
38 & 2520.4 & - & - & - & - & - & - & - \tabularnewline
39 & 2482.9 & - & - & - & - & - & - & - \tabularnewline
40 & 2215.9 & - & - & - & - & - & - & - \tabularnewline
41 & 2441.9 & - & - & - & - & - & - & - \tabularnewline
42 & 2333.8 & - & - & - & - & - & - & - \tabularnewline
43 & 2670.2 & - & - & - & - & - & - & - \tabularnewline
44 & 2431 & - & - & - & - & - & - & - \tabularnewline
45 & 2559.3 & - & - & - & - & - & - & - \tabularnewline
46 & 2661.4 & - & - & - & - & - & - & - \tabularnewline
47 & 2404.6 & - & - & - & - & - & - & - \tabularnewline
48 & 2378.3 & - & - & - & - & - & - & - \tabularnewline
49 & 2489.2 & 2533.1762 & 2296.9747 & 2778.5355 & 0.3627 & 0.892 & 0.8089 & 0.892 \tabularnewline
50 & 2941 & 2668.1373 & 2424.5957 & 2920.9145 & 0.0172 & 0.9173 & 0.874 & 0.9877 \tabularnewline
51 & 2700.9 & 2588.5112 & 2335.0564 & 2852.306 & 0.2018 & 0.0044 & 0.7837 & 0.9408 \tabularnewline
52 & 2335.6 & 2318.6201 & 2050.9534 & 2599.2605 & 0.4528 & 0.0038 & 0.7634 & 0.3384 \tabularnewline
53 & 2770 & 2550.8487 & 2266.9971 & 2847.9378 & 0.0741 & 0.9222 & 0.7639 & 0.8725 \tabularnewline
54 & 2764.2 & 2424.9667 & 2136.6192 & 2727.7317 & 0.014 & 0.0128 & 0.7225 & 0.6187 \tabularnewline
55 & 2784.9 & 2765.5677 & 2450.664 & 3095.5157 & 0.4543 & 0.5032 & 0.7145 & 0.9893 \tabularnewline
56 & 2898.8 & 2518.5596 & 2210.0984 & 2842.932 & 0.0108 & 0.0538 & 0.7016 & 0.8016 \tabularnewline
57 & 2853.4 & 2640.9723 & 2319.4414 & 2978.9847 & 0.109 & 0.0675 & 0.6821 & 0.9361 \tabularnewline
58 & 3022.6 & 2741.5118 & 2409.1471 & 3090.8375 & 0.0574 & 0.2651 & 0.6735 & 0.9792 \tabularnewline
59 & 2851.4 & 2476.9872 & 2154.0078 & 2817.7661 & 0.0156 & 9e-04 & 0.6614 & 0.7148 \tabularnewline
60 & 2630.8 & 2445.7714 & 2120.1857 & 2789.6984 & 0.1458 & 0.0104 & 0.6497 & 0.6497 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36092&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]2262.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2423.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2520.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]2482.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]2215.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]2441.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]2333.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]2670.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]2431[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]2559.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]2661.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]2404.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]2378.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2489.2[/C][C]2533.1762[/C][C]2296.9747[/C][C]2778.5355[/C][C]0.3627[/C][C]0.892[/C][C]0.8089[/C][C]0.892[/C][/ROW]
[ROW][C]50[/C][C]2941[/C][C]2668.1373[/C][C]2424.5957[/C][C]2920.9145[/C][C]0.0172[/C][C]0.9173[/C][C]0.874[/C][C]0.9877[/C][/ROW]
[ROW][C]51[/C][C]2700.9[/C][C]2588.5112[/C][C]2335.0564[/C][C]2852.306[/C][C]0.2018[/C][C]0.0044[/C][C]0.7837[/C][C]0.9408[/C][/ROW]
[ROW][C]52[/C][C]2335.6[/C][C]2318.6201[/C][C]2050.9534[/C][C]2599.2605[/C][C]0.4528[/C][C]0.0038[/C][C]0.7634[/C][C]0.3384[/C][/ROW]
[ROW][C]53[/C][C]2770[/C][C]2550.8487[/C][C]2266.9971[/C][C]2847.9378[/C][C]0.0741[/C][C]0.9222[/C][C]0.7639[/C][C]0.8725[/C][/ROW]
[ROW][C]54[/C][C]2764.2[/C][C]2424.9667[/C][C]2136.6192[/C][C]2727.7317[/C][C]0.014[/C][C]0.0128[/C][C]0.7225[/C][C]0.6187[/C][/ROW]
[ROW][C]55[/C][C]2784.9[/C][C]2765.5677[/C][C]2450.664[/C][C]3095.5157[/C][C]0.4543[/C][C]0.5032[/C][C]0.7145[/C][C]0.9893[/C][/ROW]
[ROW][C]56[/C][C]2898.8[/C][C]2518.5596[/C][C]2210.0984[/C][C]2842.932[/C][C]0.0108[/C][C]0.0538[/C][C]0.7016[/C][C]0.8016[/C][/ROW]
[ROW][C]57[/C][C]2853.4[/C][C]2640.9723[/C][C]2319.4414[/C][C]2978.9847[/C][C]0.109[/C][C]0.0675[/C][C]0.6821[/C][C]0.9361[/C][/ROW]
[ROW][C]58[/C][C]3022.6[/C][C]2741.5118[/C][C]2409.1471[/C][C]3090.8375[/C][C]0.0574[/C][C]0.2651[/C][C]0.6735[/C][C]0.9792[/C][/ROW]
[ROW][C]59[/C][C]2851.4[/C][C]2476.9872[/C][C]2154.0078[/C][C]2817.7661[/C][C]0.0156[/C][C]9e-04[/C][C]0.6614[/C][C]0.7148[/C][/ROW]
[ROW][C]60[/C][C]2630.8[/C][C]2445.7714[/C][C]2120.1857[/C][C]2789.6984[/C][C]0.1458[/C][C]0.0104[/C][C]0.6497[/C][C]0.6497[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36092&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36092&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])
362262.3-------
372423.8-------
382520.4-------
392482.9-------
402215.9-------
412441.9-------
422333.8-------
432670.2-------
442431-------
452559.3-------
462661.4-------
472404.6-------
482378.3-------
492489.22533.17622296.97472778.53550.36270.8920.80890.892
5029412668.13732424.59572920.91450.01720.91730.8740.9877
512700.92588.51122335.05642852.3060.20180.00440.78370.9408
522335.62318.62012050.95342599.26050.45280.00380.76340.3384
5327702550.84872266.99712847.93780.07410.92220.76390.8725
542764.22424.96672136.61922727.73170.0140.01280.72250.6187
552784.92765.56772450.6643095.51570.45430.50320.71450.9893
562898.82518.55962210.09842842.9320.01080.05380.70160.8016
572853.42640.97232319.44142978.98470.1090.06750.68210.9361
583022.62741.51182409.14713090.83750.05740.26510.67350.9792
592851.42476.98722154.00782817.76610.01569e-040.66140.7148
602630.82445.77142120.18572789.69840.14580.01040.64970.6497







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0494-0.01740.00141933.9039161.158712.6948
500.04830.10230.008574454.04476204.503778.7687
510.0520.04340.003612631.25051052.604232.4439
520.06180.00736e-04288.316224.02644.9017
530.05940.08590.007248027.2924002.274363.2635
540.06370.13990.0117115079.25849589.938297.9282
550.06090.0076e-04373.738731.14495.5808
560.06570.1510.0126144582.733212048.5611109.7659
570.06530.08040.006745125.51163760.459361.3226
580.0650.10250.008579010.58166584.215181.1432
590.07020.15120.0126140184.960611682.08108.0837
600.07170.07570.006334235.56772852.96453.4131

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0494 & -0.0174 & 0.0014 & 1933.9039 & 161.1587 & 12.6948 \tabularnewline
50 & 0.0483 & 0.1023 & 0.0085 & 74454.0447 & 6204.5037 & 78.7687 \tabularnewline
51 & 0.052 & 0.0434 & 0.0036 & 12631.2505 & 1052.6042 & 32.4439 \tabularnewline
52 & 0.0618 & 0.0073 & 6e-04 & 288.3162 & 24.0264 & 4.9017 \tabularnewline
53 & 0.0594 & 0.0859 & 0.0072 & 48027.292 & 4002.2743 & 63.2635 \tabularnewline
54 & 0.0637 & 0.1399 & 0.0117 & 115079.2584 & 9589.9382 & 97.9282 \tabularnewline
55 & 0.0609 & 0.007 & 6e-04 & 373.7387 & 31.1449 & 5.5808 \tabularnewline
56 & 0.0657 & 0.151 & 0.0126 & 144582.7332 & 12048.5611 & 109.7659 \tabularnewline
57 & 0.0653 & 0.0804 & 0.0067 & 45125.5116 & 3760.4593 & 61.3226 \tabularnewline
58 & 0.065 & 0.1025 & 0.0085 & 79010.5816 & 6584.2151 & 81.1432 \tabularnewline
59 & 0.0702 & 0.1512 & 0.0126 & 140184.9606 & 11682.08 & 108.0837 \tabularnewline
60 & 0.0717 & 0.0757 & 0.0063 & 34235.5677 & 2852.964 & 53.4131 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=36092&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.0494[/C][C]-0.0174[/C][C]0.0014[/C][C]1933.9039[/C][C]161.1587[/C][C]12.6948[/C][/ROW]
[ROW][C]50[/C][C]0.0483[/C][C]0.1023[/C][C]0.0085[/C][C]74454.0447[/C][C]6204.5037[/C][C]78.7687[/C][/ROW]
[ROW][C]51[/C][C]0.052[/C][C]0.0434[/C][C]0.0036[/C][C]12631.2505[/C][C]1052.6042[/C][C]32.4439[/C][/ROW]
[ROW][C]52[/C][C]0.0618[/C][C]0.0073[/C][C]6e-04[/C][C]288.3162[/C][C]24.0264[/C][C]4.9017[/C][/ROW]
[ROW][C]53[/C][C]0.0594[/C][C]0.0859[/C][C]0.0072[/C][C]48027.292[/C][C]4002.2743[/C][C]63.2635[/C][/ROW]
[ROW][C]54[/C][C]0.0637[/C][C]0.1399[/C][C]0.0117[/C][C]115079.2584[/C][C]9589.9382[/C][C]97.9282[/C][/ROW]
[ROW][C]55[/C][C]0.0609[/C][C]0.007[/C][C]6e-04[/C][C]373.7387[/C][C]31.1449[/C][C]5.5808[/C][/ROW]
[ROW][C]56[/C][C]0.0657[/C][C]0.151[/C][C]0.0126[/C][C]144582.7332[/C][C]12048.5611[/C][C]109.7659[/C][/ROW]
[ROW][C]57[/C][C]0.0653[/C][C]0.0804[/C][C]0.0067[/C][C]45125.5116[/C][C]3760.4593[/C][C]61.3226[/C][/ROW]
[ROW][C]58[/C][C]0.065[/C][C]0.1025[/C][C]0.0085[/C][C]79010.5816[/C][C]6584.2151[/C][C]81.1432[/C][/ROW]
[ROW][C]59[/C][C]0.0702[/C][C]0.1512[/C][C]0.0126[/C][C]140184.9606[/C][C]11682.08[/C][C]108.0837[/C][/ROW]
[ROW][C]60[/C][C]0.0717[/C][C]0.0757[/C][C]0.0063[/C][C]34235.5677[/C][C]2852.964[/C][C]53.4131[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=36092&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=36092&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.0494-0.01740.00141933.9039161.158712.6948
500.04830.10230.008574454.04476204.503778.7687
510.0520.04340.003612631.25051052.604232.4439
520.06180.00736e-04288.316224.02644.9017
530.05940.08590.007248027.2924002.274363.2635
540.06370.13990.0117115079.25849589.938297.9282
550.06090.0076e-04373.738731.14495.5808
560.06570.1510.0126144582.733212048.5611109.7659
570.06530.08040.006745125.51163760.459361.3226
580.0650.10250.008579010.58166584.215181.1432
590.07020.15120.0126140184.960611682.08108.0837
600.07170.07570.006334235.56772852.96453.4131



Parameters (Session):
par1 = 12 ; par2 = 0.6 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 0 ; par9 = 0 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 0.6 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; 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,fx))
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')