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, 12 Dec 2008 05:06: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/12/t12290836823splg0d7g2lts1q.htm/, Retrieved Fri, 17 May 2024 18:31:37 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=32595, Retrieved Fri, 17 May 2024 18:31:37 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact194
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Variance Reduction Matrix] [VRM - vaste rente...] [2008-12-12 10:51:08] [c5a66f1c8528a963efc2b82a8519f117]
- RM D  [Standard Deviation-Mean Plot] [SDMP inschrijving...] [2008-12-12 11:03:14] [c5a66f1c8528a963efc2b82a8519f117]
- RM      [Variance Reduction Matrix] [VRM - inschrijvin...] [2008-12-12 11:08:27] [c5a66f1c8528a963efc2b82a8519f117]
- RMP       [(Partial) Autocorrelation Function] [ACF - inschrijvin...] [2008-12-12 11:14:36] [c5a66f1c8528a963efc2b82a8519f117]
-   P         [(Partial) Autocorrelation Function] [ACF - inschrijvin...] [2008-12-12 11:32:48] [c5a66f1c8528a963efc2b82a8519f117]
-               [(Partial) Autocorrelation Function] [ACF - inschrijvin...] [2008-12-12 11:37:19] [c5a66f1c8528a963efc2b82a8519f117]
- RM              [ARIMA Backward Selection] [ARIMA backward se...] [2008-12-12 11:51:13] [c5a66f1c8528a963efc2b82a8519f117]
- RM                [ARIMA Forecasting] [ARIMA forecasting...] [2008-12-12 11:57:42] [c5a66f1c8528a963efc2b82a8519f117]
F                       [ARIMA Forecasting] [ARIMA forecasting...] [2008-12-12 12:06:55] [b4fc5040f26b33db57f84cfb8d1d2b82] [Current]
-  MPD                    [ARIMA Forecasting] [ARIMA forecasting...] [2009-12-16 20:44:06] [37a8d600db9abe09a2528d150ccff095]
-  MPD                    [ARIMA Forecasting] [Arima forecast - ...] [2009-12-16 20:56:07] [37a8d600db9abe09a2528d150ccff095]
Feedback Forum
2008-12-21 18:12:35 [Ciska Tanghe] [reply
Zeer goede oplossing van de workshop. Ik heb één opmerking. Dit is wat je schreef: 'Aan de p-value (H0: Y(t) = F(t) ) kunnen we zien of hier een significant verschil is tussen de voorspelde waarden en de werkelijke waarden. De p-value ligt overal onder de 50%. We kunnen dus besluiten dat de voorspelling meestal binnen het betrouwbaarheidsinterval ligt en dus slechts lichtjes afwijkt van de werkelijke waarden.'

Als de p-value kleiner is dan 5% is de werkelijke waarde significant verschillend van de voorspelde waarde. Alle p-waarden zijn groter dan 5%. Nemen we bijvoorbeeld de p-waarde bij coëfficiënt 51. De p-value is gelijk aan 48.31%. De kans dat er een vergissing gebeurd bij het verwerpen van de nulhypothese is gelijk aan 48.31%. Daaruit volgt dat de voorspelde waarde en de werkelijke waarde niet significant verschillend zijn van elkaar, aangezien deze groter is dan 5%. Een afwijking is aan het toeval te wijken.
2008-12-23 08:22:36 [Philippe Versluys] [reply
De p-value (H0: Y(t) = F(t) )zijn allemaal hoger dan 5% dus NIET significant, want de kans dat je vergist bij het verwerpen van de HO is groter dan 5% en dat mag niet. Knap werk
2008-12-23 17:26:48 [Veerle Jackers] [reply
Dit had je misschien ook best uitgelegd in je paper, het is toch vrij belangrijk.

Best ook de eerste grafiek ter verduidelijking in je document gezet.

Post a new message
Dataseries X:
17704
15548
28029
29383
36438
32034
22679
24319
18004
17537
20366
22782
19169
13807
29743
25591
29096
26482
22405
27044
17970
18730
19684
19785
18479
10698
31956
29506
34506
27165
26736
23691
18157
17328
18205
20995
17382
9367
31124
26551
30651
25859
25100
25778
20418
18688
20424
24776
19814
12738
31566
30111
30019
31934
25826
26835
20205
17789
20520
22518
15572




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time10 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 10 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=32595&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]10 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=32595&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=32595&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 time10 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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])
3717382-------
389367-------
3931124-------
4026551-------
4130651-------
4225859-------
4325100-------
4425778-------
4520418-------
4618688-------
4720424-------
4824776-------
4919814-------
50127389388.88488630.764210319.9685000.51840
513156631004.100222169.1256970.24020.48310.9160.49640.8009
523011124926.137519120.351437481.84880.20910.150.39990.7876
533001928287.497420867.116447139.14390.42860.42480.40290.8108
543193425146.373219239.677738048.70250.15120.22960.45690.791
552582623942.916718578.914635046.07210.36980.07920.41910.767
562683528189.789720818.521746824.06620.44330.59820.60010.8108
572020521556.645517203.469129701.89480.37250.1020.6080.6625
581778919999.956316257.043426581.02460.25510.47570.6520.5221
592052021943.864217432.745230519.97570.37240.82880.63580.6868
602251825752.135619564.267339650.79190.32420.76970.55470.7988
611557221183.855616991.720628892.33970.07680.36720.63620.6362

\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 & 17382 & - & - & - & - & - & - & - \tabularnewline
38 & 9367 & - & - & - & - & - & - & - \tabularnewline
39 & 31124 & - & - & - & - & - & - & - \tabularnewline
40 & 26551 & - & - & - & - & - & - & - \tabularnewline
41 & 30651 & - & - & - & - & - & - & - \tabularnewline
42 & 25859 & - & - & - & - & - & - & - \tabularnewline
43 & 25100 & - & - & - & - & - & - & - \tabularnewline
44 & 25778 & - & - & - & - & - & - & - \tabularnewline
45 & 20418 & - & - & - & - & - & - & - \tabularnewline
46 & 18688 & - & - & - & - & - & - & - \tabularnewline
47 & 20424 & - & - & - & - & - & - & - \tabularnewline
48 & 24776 & - & - & - & - & - & - & - \tabularnewline
49 & 19814 & - & - & - & - & - & - & - \tabularnewline
50 & 12738 & 9388.8848 & 8630.7642 & 10319.9685 & 0 & 0 & 0.5184 & 0 \tabularnewline
51 & 31566 & 31004.1002 & 22169.12 & 56970.2402 & 0.4831 & 0.916 & 0.4964 & 0.8009 \tabularnewline
52 & 30111 & 24926.1375 & 19120.3514 & 37481.8488 & 0.2091 & 0.15 & 0.3999 & 0.7876 \tabularnewline
53 & 30019 & 28287.4974 & 20867.1164 & 47139.1439 & 0.4286 & 0.4248 & 0.4029 & 0.8108 \tabularnewline
54 & 31934 & 25146.3732 & 19239.6777 & 38048.7025 & 0.1512 & 0.2296 & 0.4569 & 0.791 \tabularnewline
55 & 25826 & 23942.9167 & 18578.9146 & 35046.0721 & 0.3698 & 0.0792 & 0.4191 & 0.767 \tabularnewline
56 & 26835 & 28189.7897 & 20818.5217 & 46824.0662 & 0.4433 & 0.5982 & 0.6001 & 0.8108 \tabularnewline
57 & 20205 & 21556.6455 & 17203.4691 & 29701.8948 & 0.3725 & 0.102 & 0.608 & 0.6625 \tabularnewline
58 & 17789 & 19999.9563 & 16257.0434 & 26581.0246 & 0.2551 & 0.4757 & 0.652 & 0.5221 \tabularnewline
59 & 20520 & 21943.8642 & 17432.7452 & 30519.9757 & 0.3724 & 0.8288 & 0.6358 & 0.6868 \tabularnewline
60 & 22518 & 25752.1356 & 19564.2673 & 39650.7919 & 0.3242 & 0.7697 & 0.5547 & 0.7988 \tabularnewline
61 & 15572 & 21183.8556 & 16991.7206 & 28892.3397 & 0.0768 & 0.3672 & 0.6362 & 0.6362 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=32595&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]17382[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]9367[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]31124[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]26551[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]30651[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]25859[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]25100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]25778[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]20418[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]18688[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]20424[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]24776[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]19814[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]12738[/C][C]9388.8848[/C][C]8630.7642[/C][C]10319.9685[/C][C]0[/C][C]0[/C][C]0.5184[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]31566[/C][C]31004.1002[/C][C]22169.12[/C][C]56970.2402[/C][C]0.4831[/C][C]0.916[/C][C]0.4964[/C][C]0.8009[/C][/ROW]
[ROW][C]52[/C][C]30111[/C][C]24926.1375[/C][C]19120.3514[/C][C]37481.8488[/C][C]0.2091[/C][C]0.15[/C][C]0.3999[/C][C]0.7876[/C][/ROW]
[ROW][C]53[/C][C]30019[/C][C]28287.4974[/C][C]20867.1164[/C][C]47139.1439[/C][C]0.4286[/C][C]0.4248[/C][C]0.4029[/C][C]0.8108[/C][/ROW]
[ROW][C]54[/C][C]31934[/C][C]25146.3732[/C][C]19239.6777[/C][C]38048.7025[/C][C]0.1512[/C][C]0.2296[/C][C]0.4569[/C][C]0.791[/C][/ROW]
[ROW][C]55[/C][C]25826[/C][C]23942.9167[/C][C]18578.9146[/C][C]35046.0721[/C][C]0.3698[/C][C]0.0792[/C][C]0.4191[/C][C]0.767[/C][/ROW]
[ROW][C]56[/C][C]26835[/C][C]28189.7897[/C][C]20818.5217[/C][C]46824.0662[/C][C]0.4433[/C][C]0.5982[/C][C]0.6001[/C][C]0.8108[/C][/ROW]
[ROW][C]57[/C][C]20205[/C][C]21556.6455[/C][C]17203.4691[/C][C]29701.8948[/C][C]0.3725[/C][C]0.102[/C][C]0.608[/C][C]0.6625[/C][/ROW]
[ROW][C]58[/C][C]17789[/C][C]19999.9563[/C][C]16257.0434[/C][C]26581.0246[/C][C]0.2551[/C][C]0.4757[/C][C]0.652[/C][C]0.5221[/C][/ROW]
[ROW][C]59[/C][C]20520[/C][C]21943.8642[/C][C]17432.7452[/C][C]30519.9757[/C][C]0.3724[/C][C]0.8288[/C][C]0.6358[/C][C]0.6868[/C][/ROW]
[ROW][C]60[/C][C]22518[/C][C]25752.1356[/C][C]19564.2673[/C][C]39650.7919[/C][C]0.3242[/C][C]0.7697[/C][C]0.5547[/C][C]0.7988[/C][/ROW]
[ROW][C]61[/C][C]15572[/C][C]21183.8556[/C][C]16991.7206[/C][C]28892.3397[/C][C]0.0768[/C][C]0.3672[/C][C]0.6362[/C][C]0.6362[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=32595&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=32595&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])
3717382-------
389367-------
3931124-------
4026551-------
4130651-------
4225859-------
4325100-------
4425778-------
4520418-------
4618688-------
4720424-------
4824776-------
4919814-------
50127389388.88488630.764210319.9685000.51840
513156631004.100222169.1256970.24020.48310.9160.49640.8009
523011124926.137519120.351437481.84880.20910.150.39990.7876
533001928287.497420867.116447139.14390.42860.42480.40290.8108
543193425146.373219239.677738048.70250.15120.22960.45690.791
552582623942.916718578.914635046.07210.36980.07920.41910.767
562683528189.789720818.521746824.06620.44330.59820.60010.8108
572020521556.645517203.469129701.89480.37250.1020.6080.6625
581778919999.956316257.043426581.02460.25510.47570.6520.5221
592052021943.864217432.745230519.97570.37240.82880.63580.6868
602251825752.135619564.267339650.79190.32420.76970.55470.7988
611557221183.855616991.720628892.33970.07680.36720.63620.6362







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.05060.35670.029711216572.5821934714.3818966.8063
510.42730.01810.0015315731.361726310.9468162.2065
520.2570.2080.017326882799.21462240233.26791496.7409
530.340.06120.00512998101.1476249841.7623499.8417
540.26180.26990.022546071877.65043839323.13751959.4191
550.23660.07860.00663546002.8177295500.2348543.5993
560.3373-0.04810.0041835455.0546152954.5879391.0941
570.1928-0.06270.00521826945.6591152245.4716390.1865
580.1679-0.11050.00924888327.8397407360.6533638.2481
590.1994-0.06490.00542027389.3612168949.1134411.0342
600.2754-0.12560.010510459633.3143871636.1095933.6145
610.1857-0.26490.022131492923.81152624410.31761620.0032

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0506 & 0.3567 & 0.0297 & 11216572.5821 & 934714.3818 & 966.8063 \tabularnewline
51 & 0.4273 & 0.0181 & 0.0015 & 315731.3617 & 26310.9468 & 162.2065 \tabularnewline
52 & 0.257 & 0.208 & 0.0173 & 26882799.2146 & 2240233.2679 & 1496.7409 \tabularnewline
53 & 0.34 & 0.0612 & 0.0051 & 2998101.1476 & 249841.7623 & 499.8417 \tabularnewline
54 & 0.2618 & 0.2699 & 0.0225 & 46071877.6504 & 3839323.1375 & 1959.4191 \tabularnewline
55 & 0.2366 & 0.0786 & 0.0066 & 3546002.8177 & 295500.2348 & 543.5993 \tabularnewline
56 & 0.3373 & -0.0481 & 0.004 & 1835455.0546 & 152954.5879 & 391.0941 \tabularnewline
57 & 0.1928 & -0.0627 & 0.0052 & 1826945.6591 & 152245.4716 & 390.1865 \tabularnewline
58 & 0.1679 & -0.1105 & 0.0092 & 4888327.8397 & 407360.6533 & 638.2481 \tabularnewline
59 & 0.1994 & -0.0649 & 0.0054 & 2027389.3612 & 168949.1134 & 411.0342 \tabularnewline
60 & 0.2754 & -0.1256 & 0.0105 & 10459633.3143 & 871636.1095 & 933.6145 \tabularnewline
61 & 0.1857 & -0.2649 & 0.0221 & 31492923.8115 & 2624410.3176 & 1620.0032 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=32595&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.0506[/C][C]0.3567[/C][C]0.0297[/C][C]11216572.5821[/C][C]934714.3818[/C][C]966.8063[/C][/ROW]
[ROW][C]51[/C][C]0.4273[/C][C]0.0181[/C][C]0.0015[/C][C]315731.3617[/C][C]26310.9468[/C][C]162.2065[/C][/ROW]
[ROW][C]52[/C][C]0.257[/C][C]0.208[/C][C]0.0173[/C][C]26882799.2146[/C][C]2240233.2679[/C][C]1496.7409[/C][/ROW]
[ROW][C]53[/C][C]0.34[/C][C]0.0612[/C][C]0.0051[/C][C]2998101.1476[/C][C]249841.7623[/C][C]499.8417[/C][/ROW]
[ROW][C]54[/C][C]0.2618[/C][C]0.2699[/C][C]0.0225[/C][C]46071877.6504[/C][C]3839323.1375[/C][C]1959.4191[/C][/ROW]
[ROW][C]55[/C][C]0.2366[/C][C]0.0786[/C][C]0.0066[/C][C]3546002.8177[/C][C]295500.2348[/C][C]543.5993[/C][/ROW]
[ROW][C]56[/C][C]0.3373[/C][C]-0.0481[/C][C]0.004[/C][C]1835455.0546[/C][C]152954.5879[/C][C]391.0941[/C][/ROW]
[ROW][C]57[/C][C]0.1928[/C][C]-0.0627[/C][C]0.0052[/C][C]1826945.6591[/C][C]152245.4716[/C][C]390.1865[/C][/ROW]
[ROW][C]58[/C][C]0.1679[/C][C]-0.1105[/C][C]0.0092[/C][C]4888327.8397[/C][C]407360.6533[/C][C]638.2481[/C][/ROW]
[ROW][C]59[/C][C]0.1994[/C][C]-0.0649[/C][C]0.0054[/C][C]2027389.3612[/C][C]168949.1134[/C][C]411.0342[/C][/ROW]
[ROW][C]60[/C][C]0.2754[/C][C]-0.1256[/C][C]0.0105[/C][C]10459633.3143[/C][C]871636.1095[/C][C]933.6145[/C][/ROW]
[ROW][C]61[/C][C]0.1857[/C][C]-0.2649[/C][C]0.0221[/C][C]31492923.8115[/C][C]2624410.3176[/C][C]1620.0032[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=32595&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=32595&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.05060.35670.029711216572.5821934714.3818966.8063
510.42730.01810.0015315731.361726310.9468162.2065
520.2570.2080.017326882799.21462240233.26791496.7409
530.340.06120.00512998101.1476249841.7623499.8417
540.26180.26990.022546071877.65043839323.13751959.4191
550.23660.07860.00663546002.8177295500.2348543.5993
560.3373-0.04810.0041835455.0546152954.5879391.0941
570.1928-0.06270.00521826945.6591152245.4716390.1865
580.1679-0.11050.00924888327.8397407360.6533638.2481
590.1994-0.06490.00542027389.3612168949.1134411.0342
600.2754-0.12560.010510459633.3143871636.1095933.6145
610.1857-0.26490.022131492923.81152624410.31761620.0032



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