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 computationTue, 16 Dec 2008 09:40:55 -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/16/t1229445681r0p0ong67olgk8z.htm/, Retrieved Wed, 15 May 2024 15:05:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=34027, Retrieved Wed, 15 May 2024 15:05:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact169
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [Uitvoer.Nederland] [2008-12-03 15:11:10] [988ab43f527fc78aae41c84649095267]
-   P   [Univariate Data Series] [Export From Belgi...] [2008-12-03 15:52:29] [988ab43f527fc78aae41c84649095267]
- RMP     [ARIMA Forecasting] [ARIMA Forecasting] [2008-12-11 16:07:50] [988ab43f527fc78aae41c84649095267]
-   P         [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 16:40:55] [5d823194959040fa9b19b8c8302177e6] [Current]
-   PD          [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 18:42:50] [988ab43f527fc78aae41c84649095267]
-   PD          [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 18:45:50] [988ab43f527fc78aae41c84649095267]
-    D          [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 18:47:50] [988ab43f527fc78aae41c84649095267]
-   PD          [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 18:49:00] [988ab43f527fc78aae41c84649095267]
-   PD          [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 18:51:34] [988ab43f527fc78aae41c84649095267]
-   PD          [ARIMA Forecasting] [ARIMA Forecasting...] [2008-12-16 18:52:54] [988ab43f527fc78aae41c84649095267]
Feedback Forum

Post a new message
Dataseries X:
2236
2084.9
2409.5
2199.3
2203.5
2254.1
1975.8
1742.2
2520.6
2438.1
2126.3
2267.5
2201.1
2128.5
2596
2458.2
2210.5
2621.2
2231.4
2103.6
2685.8
2539.3
2462.4
2693.3
2307.7
2385.9
2737.6
2653.9
2545.4
2848.8
2359.5
2488.3
2861.1
2717.9
2844
2749
2652.9
2660.2
3187.1
2774.1
3158.2
3244.6
2665.5
2820.8
2983.4
3077.4
3024.8
2731.8
3046.2
2834.8
3292.8
2946.1
3196.9
3284.2
3003
2979
3137.4
3630.2
3270.7
2942.3




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'George Udny Yule' @ 72.249.76.132

\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 & 'George Udny Yule' @ 72.249.76.132 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34027&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]'George Udny Yule' @ 72.249.76.132[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34027&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34027&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'George Udny Yule' @ 72.249.76.132







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])
362749-------
372652.9-------
382660.2-------
393187.1-------
402774.1-------
413158.2-------
423244.6-------
432665.5-------
442820.8-------
452983.4-------
463077.4-------
473024.8-------
482731.8-------
493046.22849.77442453.18583246.36310.16580.72010.83470.7201
502834.82748.12452351.53583144.71310.33420.07040.66810.5322
513292.83500.04943103.46083896.63810.15290.99950.9390.9999
522946.12831.12452434.53593227.71310.28490.01130.6110.6882
533196.93452.09943055.51083848.68810.10360.99380.92680.9998
543284.23519.42453122.83593916.01310.12250.94450.91281
5530032894.84962498.26093291.43820.29650.02720.87150.7898
5629792968.17462571.5863364.76320.47870.43170.76680.8786
573137.43028.77442632.18583425.3630.29570.59720.58870.9289
583630.23283.02442886.43583679.6130.04310.76410.84520.9968
593270.73053.62452657.03593450.21310.14170.00220.55660.9441
602942.32797.49952400.91093194.08810.23710.00970.62730.6273

\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 & 2749 & - & - & - & - & - & - & - \tabularnewline
37 & 2652.9 & - & - & - & - & - & - & - \tabularnewline
38 & 2660.2 & - & - & - & - & - & - & - \tabularnewline
39 & 3187.1 & - & - & - & - & - & - & - \tabularnewline
40 & 2774.1 & - & - & - & - & - & - & - \tabularnewline
41 & 3158.2 & - & - & - & - & - & - & - \tabularnewline
42 & 3244.6 & - & - & - & - & - & - & - \tabularnewline
43 & 2665.5 & - & - & - & - & - & - & - \tabularnewline
44 & 2820.8 & - & - & - & - & - & - & - \tabularnewline
45 & 2983.4 & - & - & - & - & - & - & - \tabularnewline
46 & 3077.4 & - & - & - & - & - & - & - \tabularnewline
47 & 3024.8 & - & - & - & - & - & - & - \tabularnewline
48 & 2731.8 & - & - & - & - & - & - & - \tabularnewline
49 & 3046.2 & 2849.7744 & 2453.1858 & 3246.3631 & 0.1658 & 0.7201 & 0.8347 & 0.7201 \tabularnewline
50 & 2834.8 & 2748.1245 & 2351.5358 & 3144.7131 & 0.3342 & 0.0704 & 0.6681 & 0.5322 \tabularnewline
51 & 3292.8 & 3500.0494 & 3103.4608 & 3896.6381 & 0.1529 & 0.9995 & 0.939 & 0.9999 \tabularnewline
52 & 2946.1 & 2831.1245 & 2434.5359 & 3227.7131 & 0.2849 & 0.0113 & 0.611 & 0.6882 \tabularnewline
53 & 3196.9 & 3452.0994 & 3055.5108 & 3848.6881 & 0.1036 & 0.9938 & 0.9268 & 0.9998 \tabularnewline
54 & 3284.2 & 3519.4245 & 3122.8359 & 3916.0131 & 0.1225 & 0.9445 & 0.9128 & 1 \tabularnewline
55 & 3003 & 2894.8496 & 2498.2609 & 3291.4382 & 0.2965 & 0.0272 & 0.8715 & 0.7898 \tabularnewline
56 & 2979 & 2968.1746 & 2571.586 & 3364.7632 & 0.4787 & 0.4317 & 0.7668 & 0.8786 \tabularnewline
57 & 3137.4 & 3028.7744 & 2632.1858 & 3425.363 & 0.2957 & 0.5972 & 0.5887 & 0.9289 \tabularnewline
58 & 3630.2 & 3283.0244 & 2886.4358 & 3679.613 & 0.0431 & 0.7641 & 0.8452 & 0.9968 \tabularnewline
59 & 3270.7 & 3053.6245 & 2657.0359 & 3450.2131 & 0.1417 & 0.0022 & 0.5566 & 0.9441 \tabularnewline
60 & 2942.3 & 2797.4995 & 2400.9109 & 3194.0881 & 0.2371 & 0.0097 & 0.6273 & 0.6273 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34027&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]2749[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2652.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2660.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3187.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]2774.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]3158.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]3244.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]2665.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]2820.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]2983.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]3077.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]3024.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]2731.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]3046.2[/C][C]2849.7744[/C][C]2453.1858[/C][C]3246.3631[/C][C]0.1658[/C][C]0.7201[/C][C]0.8347[/C][C]0.7201[/C][/ROW]
[ROW][C]50[/C][C]2834.8[/C][C]2748.1245[/C][C]2351.5358[/C][C]3144.7131[/C][C]0.3342[/C][C]0.0704[/C][C]0.6681[/C][C]0.5322[/C][/ROW]
[ROW][C]51[/C][C]3292.8[/C][C]3500.0494[/C][C]3103.4608[/C][C]3896.6381[/C][C]0.1529[/C][C]0.9995[/C][C]0.939[/C][C]0.9999[/C][/ROW]
[ROW][C]52[/C][C]2946.1[/C][C]2831.1245[/C][C]2434.5359[/C][C]3227.7131[/C][C]0.2849[/C][C]0.0113[/C][C]0.611[/C][C]0.6882[/C][/ROW]
[ROW][C]53[/C][C]3196.9[/C][C]3452.0994[/C][C]3055.5108[/C][C]3848.6881[/C][C]0.1036[/C][C]0.9938[/C][C]0.9268[/C][C]0.9998[/C][/ROW]
[ROW][C]54[/C][C]3284.2[/C][C]3519.4245[/C][C]3122.8359[/C][C]3916.0131[/C][C]0.1225[/C][C]0.9445[/C][C]0.9128[/C][C]1[/C][/ROW]
[ROW][C]55[/C][C]3003[/C][C]2894.8496[/C][C]2498.2609[/C][C]3291.4382[/C][C]0.2965[/C][C]0.0272[/C][C]0.8715[/C][C]0.7898[/C][/ROW]
[ROW][C]56[/C][C]2979[/C][C]2968.1746[/C][C]2571.586[/C][C]3364.7632[/C][C]0.4787[/C][C]0.4317[/C][C]0.7668[/C][C]0.8786[/C][/ROW]
[ROW][C]57[/C][C]3137.4[/C][C]3028.7744[/C][C]2632.1858[/C][C]3425.363[/C][C]0.2957[/C][C]0.5972[/C][C]0.5887[/C][C]0.9289[/C][/ROW]
[ROW][C]58[/C][C]3630.2[/C][C]3283.0244[/C][C]2886.4358[/C][C]3679.613[/C][C]0.0431[/C][C]0.7641[/C][C]0.8452[/C][C]0.9968[/C][/ROW]
[ROW][C]59[/C][C]3270.7[/C][C]3053.6245[/C][C]2657.0359[/C][C]3450.2131[/C][C]0.1417[/C][C]0.0022[/C][C]0.5566[/C][C]0.9441[/C][/ROW]
[ROW][C]60[/C][C]2942.3[/C][C]2797.4995[/C][C]2400.9109[/C][C]3194.0881[/C][C]0.2371[/C][C]0.0097[/C][C]0.6273[/C][C]0.6273[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34027&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34027&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])
362749-------
372652.9-------
382660.2-------
393187.1-------
402774.1-------
413158.2-------
423244.6-------
432665.5-------
442820.8-------
452983.4-------
463077.4-------
473024.8-------
482731.8-------
493046.22849.77442453.18583246.36310.16580.72010.83470.7201
502834.82748.12452351.53583144.71310.33420.07040.66810.5322
513292.83500.04943103.46083896.63810.15290.99950.9390.9999
522946.12831.12452434.53593227.71310.28490.01130.6110.6882
533196.93452.09943055.51083848.68810.10360.99380.92680.9998
543284.23519.42453122.83593916.01310.12250.94450.91281
5530032894.84962498.26093291.43820.29650.02720.87150.7898
5629792968.17462571.5863364.76320.47870.43170.76680.8786
573137.43028.77442632.18583425.3630.29570.59720.58870.9289
583630.23283.02442886.43583679.6130.04310.76410.84520.9968
593270.73053.62452657.03593450.21310.14170.00220.55660.9441
602942.32797.49952400.91093194.08810.23710.00970.62730.6273







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0710.06890.005738582.99963215.2556.7032
500.07360.03150.00267512.6472626.053925.0211
510.0578-0.05920.004942952.33153579.36159.8278
520.07150.04060.003413219.36981101.614133.1906
530.0586-0.07390.006265126.75765427.229873.6697
540.0575-0.06680.005655330.56614610.880567.9035
550.06990.03740.003111696.5183974.709931.2203
560.06820.00363e-04117.18929.76583.125
570.06680.03590.00311799.5239983.293731.3575
580.06160.10570.0088120530.890610044.2409100.221
590.06630.07110.005947121.77483926.814662.6643
600.07230.05180.004320967.18341747.265341.8003

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.071 & 0.0689 & 0.0057 & 38582.9996 & 3215.25 & 56.7032 \tabularnewline
50 & 0.0736 & 0.0315 & 0.0026 & 7512.6472 & 626.0539 & 25.0211 \tabularnewline
51 & 0.0578 & -0.0592 & 0.0049 & 42952.3315 & 3579.361 & 59.8278 \tabularnewline
52 & 0.0715 & 0.0406 & 0.0034 & 13219.3698 & 1101.6141 & 33.1906 \tabularnewline
53 & 0.0586 & -0.0739 & 0.0062 & 65126.7576 & 5427.2298 & 73.6697 \tabularnewline
54 & 0.0575 & -0.0668 & 0.0056 & 55330.5661 & 4610.8805 & 67.9035 \tabularnewline
55 & 0.0699 & 0.0374 & 0.0031 & 11696.5183 & 974.7099 & 31.2203 \tabularnewline
56 & 0.0682 & 0.0036 & 3e-04 & 117.1892 & 9.7658 & 3.125 \tabularnewline
57 & 0.0668 & 0.0359 & 0.003 & 11799.5239 & 983.2937 & 31.3575 \tabularnewline
58 & 0.0616 & 0.1057 & 0.0088 & 120530.8906 & 10044.2409 & 100.221 \tabularnewline
59 & 0.0663 & 0.0711 & 0.0059 & 47121.7748 & 3926.8146 & 62.6643 \tabularnewline
60 & 0.0723 & 0.0518 & 0.0043 & 20967.1834 & 1747.2653 & 41.8003 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34027&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.071[/C][C]0.0689[/C][C]0.0057[/C][C]38582.9996[/C][C]3215.25[/C][C]56.7032[/C][/ROW]
[ROW][C]50[/C][C]0.0736[/C][C]0.0315[/C][C]0.0026[/C][C]7512.6472[/C][C]626.0539[/C][C]25.0211[/C][/ROW]
[ROW][C]51[/C][C]0.0578[/C][C]-0.0592[/C][C]0.0049[/C][C]42952.3315[/C][C]3579.361[/C][C]59.8278[/C][/ROW]
[ROW][C]52[/C][C]0.0715[/C][C]0.0406[/C][C]0.0034[/C][C]13219.3698[/C][C]1101.6141[/C][C]33.1906[/C][/ROW]
[ROW][C]53[/C][C]0.0586[/C][C]-0.0739[/C][C]0.0062[/C][C]65126.7576[/C][C]5427.2298[/C][C]73.6697[/C][/ROW]
[ROW][C]54[/C][C]0.0575[/C][C]-0.0668[/C][C]0.0056[/C][C]55330.5661[/C][C]4610.8805[/C][C]67.9035[/C][/ROW]
[ROW][C]55[/C][C]0.0699[/C][C]0.0374[/C][C]0.0031[/C][C]11696.5183[/C][C]974.7099[/C][C]31.2203[/C][/ROW]
[ROW][C]56[/C][C]0.0682[/C][C]0.0036[/C][C]3e-04[/C][C]117.1892[/C][C]9.7658[/C][C]3.125[/C][/ROW]
[ROW][C]57[/C][C]0.0668[/C][C]0.0359[/C][C]0.003[/C][C]11799.5239[/C][C]983.2937[/C][C]31.3575[/C][/ROW]
[ROW][C]58[/C][C]0.0616[/C][C]0.1057[/C][C]0.0088[/C][C]120530.8906[/C][C]10044.2409[/C][C]100.221[/C][/ROW]
[ROW][C]59[/C][C]0.0663[/C][C]0.0711[/C][C]0.0059[/C][C]47121.7748[/C][C]3926.8146[/C][C]62.6643[/C][/ROW]
[ROW][C]60[/C][C]0.0723[/C][C]0.0518[/C][C]0.0043[/C][C]20967.1834[/C][C]1747.2653[/C][C]41.8003[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34027&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34027&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.0710.06890.005738582.99963215.2556.7032
500.07360.03150.00267512.6472626.053925.0211
510.0578-0.05920.004942952.33153579.36159.8278
520.07150.04060.003413219.36981101.614133.1906
530.0586-0.07390.006265126.75765427.229873.6697
540.0575-0.06680.005655330.56614610.880567.9035
550.06990.03740.003111696.5183974.709931.2203
560.06820.00363e-04117.18929.76583.125
570.06680.03590.00311799.5239983.293731.3575
580.06160.10570.0088120530.890610044.2409100.221
590.06630.07110.005947121.77483926.814662.6643
600.07230.05180.004320967.18341747.265341.8003



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