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, 04 Dec 2009 08:34:13 -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/04/t1259940908a741huinoiqo9vo.htm/, Retrieved Sun, 28 Apr 2024 07:32:16 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=63773, Retrieved Sun, 28 Apr 2024 07:32:16 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact109
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [ARIMA Forecasting] [2009-12-04 15:34:13] [2622964eb3e61db9b0dfd11950e3a18c] [Current]
Feedback Forum

Post a new message
Dataseries X:
5560
3922
3759
4138
4634
3996
4308
4429
5219
4929
5755
5592
4163
4962
5208
4755
4491
5732
5731
5040
6102
4904
5369
5578
4619
4731
5011
5299
4146
4625
4736
4219
5116
4205
4121
5103
4300
4578
3809
5526
4247
3830
4394
4826
4409
4569
4106
4794
3914
3793
4405
4022
4100
4788
3163
3585
3903
4178
3863
4187




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63773&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])
365103-------
374300-------
384578-------
393809-------
405526-------
414247-------
423830-------
434394-------
444826-------
454409-------
464569-------
474106-------
484794-------
4939144512.91143492.80165693.5960.16010.32040.63810.3204
5037934375.82523342.94615579.72620.17130.77390.3710.248
5144054611.82373500.06715912.27740.37760.89140.88690.3918
5240224505.73643250.28236014.53910.26490.55210.09250.354
5341004467.0863168.76696041.23420.32380.71030.6080.342
5447884547.12183178.01226220.02690.38890.69980.79960.3862
5531634507.40693064.19366296.35630.07040.37930.54940.3768
5635854497.18053004.53386364.010.16910.91940.3650.3777
5739034524.10462972.6126481.09140.2670.82650.54590.3935
5841784509.39572902.98936556.74750.37550.71920.47720.3926
5938634506.95932853.06476632.73230.27630.61920.64420.3956
6041874515.95012812.27436723.72470.38510.71890.40250.4025

\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 & 5103 & - & - & - & - & - & - & - \tabularnewline
37 & 4300 & - & - & - & - & - & - & - \tabularnewline
38 & 4578 & - & - & - & - & - & - & - \tabularnewline
39 & 3809 & - & - & - & - & - & - & - \tabularnewline
40 & 5526 & - & - & - & - & - & - & - \tabularnewline
41 & 4247 & - & - & - & - & - & - & - \tabularnewline
42 & 3830 & - & - & - & - & - & - & - \tabularnewline
43 & 4394 & - & - & - & - & - & - & - \tabularnewline
44 & 4826 & - & - & - & - & - & - & - \tabularnewline
45 & 4409 & - & - & - & - & - & - & - \tabularnewline
46 & 4569 & - & - & - & - & - & - & - \tabularnewline
47 & 4106 & - & - & - & - & - & - & - \tabularnewline
48 & 4794 & - & - & - & - & - & - & - \tabularnewline
49 & 3914 & 4512.9114 & 3492.8016 & 5693.596 & 0.1601 & 0.3204 & 0.6381 & 0.3204 \tabularnewline
50 & 3793 & 4375.8252 & 3342.9461 & 5579.7262 & 0.1713 & 0.7739 & 0.371 & 0.248 \tabularnewline
51 & 4405 & 4611.8237 & 3500.0671 & 5912.2774 & 0.3776 & 0.8914 & 0.8869 & 0.3918 \tabularnewline
52 & 4022 & 4505.7364 & 3250.2823 & 6014.5391 & 0.2649 & 0.5521 & 0.0925 & 0.354 \tabularnewline
53 & 4100 & 4467.086 & 3168.7669 & 6041.2342 & 0.3238 & 0.7103 & 0.608 & 0.342 \tabularnewline
54 & 4788 & 4547.1218 & 3178.0122 & 6220.0269 & 0.3889 & 0.6998 & 0.7996 & 0.3862 \tabularnewline
55 & 3163 & 4507.4069 & 3064.1936 & 6296.3563 & 0.0704 & 0.3793 & 0.5494 & 0.3768 \tabularnewline
56 & 3585 & 4497.1805 & 3004.5338 & 6364.01 & 0.1691 & 0.9194 & 0.365 & 0.3777 \tabularnewline
57 & 3903 & 4524.1046 & 2972.612 & 6481.0914 & 0.267 & 0.8265 & 0.5459 & 0.3935 \tabularnewline
58 & 4178 & 4509.3957 & 2902.9893 & 6556.7475 & 0.3755 & 0.7192 & 0.4772 & 0.3926 \tabularnewline
59 & 3863 & 4506.9593 & 2853.0647 & 6632.7323 & 0.2763 & 0.6192 & 0.6442 & 0.3956 \tabularnewline
60 & 4187 & 4515.9501 & 2812.2743 & 6723.7247 & 0.3851 & 0.7189 & 0.4025 & 0.4025 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=63773&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]5103[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]4300[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]4578[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3809[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]5526[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]4247[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]3830[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]4394[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]4826[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4409[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]4569[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4106[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]4794[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]3914[/C][C]4512.9114[/C][C]3492.8016[/C][C]5693.596[/C][C]0.1601[/C][C]0.3204[/C][C]0.6381[/C][C]0.3204[/C][/ROW]
[ROW][C]50[/C][C]3793[/C][C]4375.8252[/C][C]3342.9461[/C][C]5579.7262[/C][C]0.1713[/C][C]0.7739[/C][C]0.371[/C][C]0.248[/C][/ROW]
[ROW][C]51[/C][C]4405[/C][C]4611.8237[/C][C]3500.0671[/C][C]5912.2774[/C][C]0.3776[/C][C]0.8914[/C][C]0.8869[/C][C]0.3918[/C][/ROW]
[ROW][C]52[/C][C]4022[/C][C]4505.7364[/C][C]3250.2823[/C][C]6014.5391[/C][C]0.2649[/C][C]0.5521[/C][C]0.0925[/C][C]0.354[/C][/ROW]
[ROW][C]53[/C][C]4100[/C][C]4467.086[/C][C]3168.7669[/C][C]6041.2342[/C][C]0.3238[/C][C]0.7103[/C][C]0.608[/C][C]0.342[/C][/ROW]
[ROW][C]54[/C][C]4788[/C][C]4547.1218[/C][C]3178.0122[/C][C]6220.0269[/C][C]0.3889[/C][C]0.6998[/C][C]0.7996[/C][C]0.3862[/C][/ROW]
[ROW][C]55[/C][C]3163[/C][C]4507.4069[/C][C]3064.1936[/C][C]6296.3563[/C][C]0.0704[/C][C]0.3793[/C][C]0.5494[/C][C]0.3768[/C][/ROW]
[ROW][C]56[/C][C]3585[/C][C]4497.1805[/C][C]3004.5338[/C][C]6364.01[/C][C]0.1691[/C][C]0.9194[/C][C]0.365[/C][C]0.3777[/C][/ROW]
[ROW][C]57[/C][C]3903[/C][C]4524.1046[/C][C]2972.612[/C][C]6481.0914[/C][C]0.267[/C][C]0.8265[/C][C]0.5459[/C][C]0.3935[/C][/ROW]
[ROW][C]58[/C][C]4178[/C][C]4509.3957[/C][C]2902.9893[/C][C]6556.7475[/C][C]0.3755[/C][C]0.7192[/C][C]0.4772[/C][C]0.3926[/C][/ROW]
[ROW][C]59[/C][C]3863[/C][C]4506.9593[/C][C]2853.0647[/C][C]6632.7323[/C][C]0.2763[/C][C]0.6192[/C][C]0.6442[/C][C]0.3956[/C][/ROW]
[ROW][C]60[/C][C]4187[/C][C]4515.9501[/C][C]2812.2743[/C][C]6723.7247[/C][C]0.3851[/C][C]0.7189[/C][C]0.4025[/C][C]0.4025[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=63773&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63773&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])
365103-------
374300-------
384578-------
393809-------
405526-------
414247-------
423830-------
434394-------
444826-------
454409-------
464569-------
474106-------
484794-------
4939144512.91143492.80165693.5960.16010.32040.63810.3204
5037934375.82523342.94615579.72620.17130.77390.3710.248
5144054611.82373500.06715912.27740.37760.89140.88690.3918
5240224505.73643250.28236014.53910.26490.55210.09250.354
5341004467.0863168.76696041.23420.32380.71030.6080.342
5447884547.12183178.01226220.02690.38890.69980.79960.3862
5531634507.40693064.19366296.35630.07040.37930.54940.3768
5635854497.18053004.53386364.010.16910.91940.3650.3777
5739034524.10462972.6126481.09140.2670.82650.54590.3935
5841784509.39572902.98936556.74750.37550.71920.47720.3926
5938634506.95932853.06476632.73230.27630.61920.64420.3956
6041874515.95012812.27436723.72470.38510.71890.40250.4025







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.1335-0.13270.0111358694.864429891.2387172.8908
500.1404-0.13320.0111339685.209728307.1008168.2471
510.1439-0.04480.003742776.03313564.669459.7049
520.1708-0.10740.0089234000.924519500.077139.6427
530.1798-0.08220.0068134752.128211229.344105.9686
540.18770.0530.004458022.32224835.193569.5356
550.2025-0.29830.02491807430.0127150619.1677388.0969
560.2118-0.20280.0169832073.243969339.437263.3238
570.2207-0.13730.0114385770.928532147.5774179.2975
580.2316-0.07350.0061109823.09769151.924895.6657
590.2406-0.14290.0119414683.633834556.9695185.895
600.2494-0.07280.0061108208.18699017.348994.9597

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1335 & -0.1327 & 0.0111 & 358694.8644 & 29891.2387 & 172.8908 \tabularnewline
50 & 0.1404 & -0.1332 & 0.0111 & 339685.2097 & 28307.1008 & 168.2471 \tabularnewline
51 & 0.1439 & -0.0448 & 0.0037 & 42776.0331 & 3564.6694 & 59.7049 \tabularnewline
52 & 0.1708 & -0.1074 & 0.0089 & 234000.9245 & 19500.077 & 139.6427 \tabularnewline
53 & 0.1798 & -0.0822 & 0.0068 & 134752.1282 & 11229.344 & 105.9686 \tabularnewline
54 & 0.1877 & 0.053 & 0.0044 & 58022.3222 & 4835.1935 & 69.5356 \tabularnewline
55 & 0.2025 & -0.2983 & 0.0249 & 1807430.0127 & 150619.1677 & 388.0969 \tabularnewline
56 & 0.2118 & -0.2028 & 0.0169 & 832073.2439 & 69339.437 & 263.3238 \tabularnewline
57 & 0.2207 & -0.1373 & 0.0114 & 385770.9285 & 32147.5774 & 179.2975 \tabularnewline
58 & 0.2316 & -0.0735 & 0.0061 & 109823.0976 & 9151.9248 & 95.6657 \tabularnewline
59 & 0.2406 & -0.1429 & 0.0119 & 414683.6338 & 34556.9695 & 185.895 \tabularnewline
60 & 0.2494 & -0.0728 & 0.0061 & 108208.1869 & 9017.3489 & 94.9597 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=63773&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.1335[/C][C]-0.1327[/C][C]0.0111[/C][C]358694.8644[/C][C]29891.2387[/C][C]172.8908[/C][/ROW]
[ROW][C]50[/C][C]0.1404[/C][C]-0.1332[/C][C]0.0111[/C][C]339685.2097[/C][C]28307.1008[/C][C]168.2471[/C][/ROW]
[ROW][C]51[/C][C]0.1439[/C][C]-0.0448[/C][C]0.0037[/C][C]42776.0331[/C][C]3564.6694[/C][C]59.7049[/C][/ROW]
[ROW][C]52[/C][C]0.1708[/C][C]-0.1074[/C][C]0.0089[/C][C]234000.9245[/C][C]19500.077[/C][C]139.6427[/C][/ROW]
[ROW][C]53[/C][C]0.1798[/C][C]-0.0822[/C][C]0.0068[/C][C]134752.1282[/C][C]11229.344[/C][C]105.9686[/C][/ROW]
[ROW][C]54[/C][C]0.1877[/C][C]0.053[/C][C]0.0044[/C][C]58022.3222[/C][C]4835.1935[/C][C]69.5356[/C][/ROW]
[ROW][C]55[/C][C]0.2025[/C][C]-0.2983[/C][C]0.0249[/C][C]1807430.0127[/C][C]150619.1677[/C][C]388.0969[/C][/ROW]
[ROW][C]56[/C][C]0.2118[/C][C]-0.2028[/C][C]0.0169[/C][C]832073.2439[/C][C]69339.437[/C][C]263.3238[/C][/ROW]
[ROW][C]57[/C][C]0.2207[/C][C]-0.1373[/C][C]0.0114[/C][C]385770.9285[/C][C]32147.5774[/C][C]179.2975[/C][/ROW]
[ROW][C]58[/C][C]0.2316[/C][C]-0.0735[/C][C]0.0061[/C][C]109823.0976[/C][C]9151.9248[/C][C]95.6657[/C][/ROW]
[ROW][C]59[/C][C]0.2406[/C][C]-0.1429[/C][C]0.0119[/C][C]414683.6338[/C][C]34556.9695[/C][C]185.895[/C][/ROW]
[ROW][C]60[/C][C]0.2494[/C][C]-0.0728[/C][C]0.0061[/C][C]108208.1869[/C][C]9017.3489[/C][C]94.9597[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=63773&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=63773&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.1335-0.13270.0111358694.864429891.2387172.8908
500.1404-0.13320.0111339685.209728307.1008168.2471
510.1439-0.04480.003742776.03313564.669459.7049
520.1708-0.10740.0089234000.924519500.077139.6427
530.1798-0.08220.0068134752.128211229.344105.9686
540.18770.0530.004458022.32224835.193569.5356
550.2025-0.29830.02491807430.0127150619.1677388.0969
560.2118-0.20280.0169832073.243969339.437263.3238
570.2207-0.13730.0114385770.928532147.5774179.2975
580.2316-0.07350.0061109823.09769151.924895.6657
590.2406-0.14290.0119414683.633834556.9695185.895
600.2494-0.07280.0061108208.18699017.348994.9597



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