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 computationThu, 10 Dec 2009 10:53:28 -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/10/t1260467689985ny8gsxpoyt6f.htm/, Retrieved Fri, 19 Apr 2024 17:32:01 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65652, Retrieved Fri, 19 Apr 2024 17:32:01 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact160
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2009-11-02 12:15:55] [1eab65e90adf64584b8e6f0da23ff414]
-   PD  [Univariate Data Series] [] [2009-11-21 13:50:52] [2f674a53c3d7aaa1bcf80e66074d3c9b]
-   PD    [Univariate Data Series] [] [2009-12-03 09:50:08] [2f674a53c3d7aaa1bcf80e66074d3c9b]
- RMP       [ARIMA Forecasting] [] [2009-12-10 17:40:05] [2f674a53c3d7aaa1bcf80e66074d3c9b]
-   P           [ARIMA Forecasting] [] [2009-12-10 17:53:28] [5858ea01c9bd81debbf921a11363ad90] [Current]
-                 [ARIMA Forecasting] [] [2009-12-11 11:57:05] [ff47dd0689925b5f8d992b55e66ceb45]
Feedback Forum

Post a new message
Dataseries X:
21790
13253
37702
30364
32609
30212
29965
28352
25814
22414
20506
28806
22228
13971
36845
35338
35022
34777
26887
23970
22780
17351
21382
24561
17409
11514
31514
27071
29462
26105
22397
23843
21705
18089
20764
25316
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
11509
25447
24090
27786
26195
20516
22759
19028
16971
20036
22485
18730




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65652&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[97])
8519814-------
8612738-------
8731566-------
8830111-------
8930019-------
9031934-------
9125826-------
9226835-------
9320205-------
9417789-------
9520520-------
9622518-------
9715572-------
981150911759.124410248.362213630.34350.396700.15260
992544727856.447222599.111335186.87920.259710.16060.9995
1002409025584.380920698.696932428.47660.33430.51570.09740.9979
1012778628709.104622738.179537382.37010.41740.85170.38360.9985
1022619525973.486920726.949133496.83320.4770.31840.06020.9966
1032051622733.357918319.481628958.16480.24250.13790.16510.9879
1042275923091.362718527.500229575.31680.460.78190.12890.9885
1051902818744.38115325.859223448.60010.4530.04720.27140.9069
1061697117026.183814022.409621109.62720.48940.16830.35710.7574
1072003618641.394515199.227323400.43880.28290.75430.21960.8969
1082248521537.943417287.204227573.40930.37920.68710.37510.9737
1091873017091.652114018.035821299.21740.22270.0060.76050.7605

\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[97]) \tabularnewline
85 & 19814 & - & - & - & - & - & - & - \tabularnewline
86 & 12738 & - & - & - & - & - & - & - \tabularnewline
87 & 31566 & - & - & - & - & - & - & - \tabularnewline
88 & 30111 & - & - & - & - & - & - & - \tabularnewline
89 & 30019 & - & - & - & - & - & - & - \tabularnewline
90 & 31934 & - & - & - & - & - & - & - \tabularnewline
91 & 25826 & - & - & - & - & - & - & - \tabularnewline
92 & 26835 & - & - & - & - & - & - & - \tabularnewline
93 & 20205 & - & - & - & - & - & - & - \tabularnewline
94 & 17789 & - & - & - & - & - & - & - \tabularnewline
95 & 20520 & - & - & - & - & - & - & - \tabularnewline
96 & 22518 & - & - & - & - & - & - & - \tabularnewline
97 & 15572 & - & - & - & - & - & - & - \tabularnewline
98 & 11509 & 11759.1244 & 10248.3622 & 13630.3435 & 0.3967 & 0 & 0.1526 & 0 \tabularnewline
99 & 25447 & 27856.4472 & 22599.1113 & 35186.8792 & 0.2597 & 1 & 0.1606 & 0.9995 \tabularnewline
100 & 24090 & 25584.3809 & 20698.6969 & 32428.4766 & 0.3343 & 0.5157 & 0.0974 & 0.9979 \tabularnewline
101 & 27786 & 28709.1046 & 22738.1795 & 37382.3701 & 0.4174 & 0.8517 & 0.3836 & 0.9985 \tabularnewline
102 & 26195 & 25973.4869 & 20726.9491 & 33496.8332 & 0.477 & 0.3184 & 0.0602 & 0.9966 \tabularnewline
103 & 20516 & 22733.3579 & 18319.4816 & 28958.1648 & 0.2425 & 0.1379 & 0.1651 & 0.9879 \tabularnewline
104 & 22759 & 23091.3627 & 18527.5002 & 29575.3168 & 0.46 & 0.7819 & 0.1289 & 0.9885 \tabularnewline
105 & 19028 & 18744.381 & 15325.8592 & 23448.6001 & 0.453 & 0.0472 & 0.2714 & 0.9069 \tabularnewline
106 & 16971 & 17026.1838 & 14022.4096 & 21109.6272 & 0.4894 & 0.1683 & 0.3571 & 0.7574 \tabularnewline
107 & 20036 & 18641.3945 & 15199.2273 & 23400.4388 & 0.2829 & 0.7543 & 0.2196 & 0.8969 \tabularnewline
108 & 22485 & 21537.9434 & 17287.2042 & 27573.4093 & 0.3792 & 0.6871 & 0.3751 & 0.9737 \tabularnewline
109 & 18730 & 17091.6521 & 14018.0358 & 21299.2174 & 0.2227 & 0.006 & 0.7605 & 0.7605 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65652&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[97])[/C][/ROW]
[ROW][C]85[/C][C]19814[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]12738[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]31566[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]30111[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]30019[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]31934[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]25826[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]92[/C][C]26835[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]20205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]17789[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]20520[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]22518[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]15572[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]11509[/C][C]11759.1244[/C][C]10248.3622[/C][C]13630.3435[/C][C]0.3967[/C][C]0[/C][C]0.1526[/C][C]0[/C][/ROW]
[ROW][C]99[/C][C]25447[/C][C]27856.4472[/C][C]22599.1113[/C][C]35186.8792[/C][C]0.2597[/C][C]1[/C][C]0.1606[/C][C]0.9995[/C][/ROW]
[ROW][C]100[/C][C]24090[/C][C]25584.3809[/C][C]20698.6969[/C][C]32428.4766[/C][C]0.3343[/C][C]0.5157[/C][C]0.0974[/C][C]0.9979[/C][/ROW]
[ROW][C]101[/C][C]27786[/C][C]28709.1046[/C][C]22738.1795[/C][C]37382.3701[/C][C]0.4174[/C][C]0.8517[/C][C]0.3836[/C][C]0.9985[/C][/ROW]
[ROW][C]102[/C][C]26195[/C][C]25973.4869[/C][C]20726.9491[/C][C]33496.8332[/C][C]0.477[/C][C]0.3184[/C][C]0.0602[/C][C]0.9966[/C][/ROW]
[ROW][C]103[/C][C]20516[/C][C]22733.3579[/C][C]18319.4816[/C][C]28958.1648[/C][C]0.2425[/C][C]0.1379[/C][C]0.1651[/C][C]0.9879[/C][/ROW]
[ROW][C]104[/C][C]22759[/C][C]23091.3627[/C][C]18527.5002[/C][C]29575.3168[/C][C]0.46[/C][C]0.7819[/C][C]0.1289[/C][C]0.9885[/C][/ROW]
[ROW][C]105[/C][C]19028[/C][C]18744.381[/C][C]15325.8592[/C][C]23448.6001[/C][C]0.453[/C][C]0.0472[/C][C]0.2714[/C][C]0.9069[/C][/ROW]
[ROW][C]106[/C][C]16971[/C][C]17026.1838[/C][C]14022.4096[/C][C]21109.6272[/C][C]0.4894[/C][C]0.1683[/C][C]0.3571[/C][C]0.7574[/C][/ROW]
[ROW][C]107[/C][C]20036[/C][C]18641.3945[/C][C]15199.2273[/C][C]23400.4388[/C][C]0.2829[/C][C]0.7543[/C][C]0.2196[/C][C]0.8969[/C][/ROW]
[ROW][C]108[/C][C]22485[/C][C]21537.9434[/C][C]17287.2042[/C][C]27573.4093[/C][C]0.3792[/C][C]0.6871[/C][C]0.3751[/C][C]0.9737[/C][/ROW]
[ROW][C]109[/C][C]18730[/C][C]17091.6521[/C][C]14018.0358[/C][C]21299.2174[/C][C]0.2227[/C][C]0.006[/C][C]0.7605[/C][C]0.7605[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65652&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65652&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[97])
8519814-------
8612738-------
8731566-------
8830111-------
8930019-------
9031934-------
9125826-------
9226835-------
9320205-------
9417789-------
9520520-------
9622518-------
9715572-------
981150911759.124410248.362213630.34350.396700.15260
992544727856.447222599.111335186.87920.259710.16060.9995
1002409025584.380920698.696932428.47660.33430.51570.09740.9979
1012778628709.104622738.179537382.37010.41740.85170.38360.9985
1022619525973.486920726.949133496.83320.4770.31840.06020.9966
1032051622733.357918319.481628958.16480.24250.13790.16510.9879
1042275923091.362718527.500229575.31680.460.78190.12890.9885
1051902818744.38115325.859223448.60010.4530.04720.27140.9069
1061697117026.183814022.409621109.62720.48940.16830.35710.7574
1072003618641.394515199.227323400.43880.28290.75430.21960.8969
1082248521537.943417287.204227573.40930.37920.68710.37510.9737
1091873017091.652114018.035821299.21740.22270.0060.76050.7605







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
980.0812-0.0213062562.215500
990.1343-0.08650.05395805435.84422933999.02981712.892
1000.1365-0.05840.05542233174.1812700390.74691643.2866
1010.1541-0.03220.0496852122.13442238323.59381496.1028
1020.14780.00850.041449068.04251800472.48351341.8169
1030.1397-0.09750.05074916676.19072319839.76811523.102
1040.1433-0.01440.0455110464.96142004214.79571415.7029
1050.1280.01510.041780439.72151763742.91141328.0598
1060.1224-0.00320.03753045.24831568109.83771252.2419
1070.13030.07480.04121944924.45531605791.29951267.1982
1080.1430.0440.0414896916.19791541348.10841241.5104
1090.12560.09590.0462684183.87121636584.4221279.2906

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
98 & 0.0812 & -0.0213 & 0 & 62562.2155 & 0 & 0 \tabularnewline
99 & 0.1343 & -0.0865 & 0.0539 & 5805435.8442 & 2933999.0298 & 1712.892 \tabularnewline
100 & 0.1365 & -0.0584 & 0.0554 & 2233174.181 & 2700390.7469 & 1643.2866 \tabularnewline
101 & 0.1541 & -0.0322 & 0.0496 & 852122.1344 & 2238323.5938 & 1496.1028 \tabularnewline
102 & 0.1478 & 0.0085 & 0.0414 & 49068.0425 & 1800472.4835 & 1341.8169 \tabularnewline
103 & 0.1397 & -0.0975 & 0.0507 & 4916676.1907 & 2319839.7681 & 1523.102 \tabularnewline
104 & 0.1433 & -0.0144 & 0.0455 & 110464.9614 & 2004214.7957 & 1415.7029 \tabularnewline
105 & 0.128 & 0.0151 & 0.0417 & 80439.7215 & 1763742.9114 & 1328.0598 \tabularnewline
106 & 0.1224 & -0.0032 & 0.0375 & 3045.2483 & 1568109.8377 & 1252.2419 \tabularnewline
107 & 0.1303 & 0.0748 & 0.0412 & 1944924.4553 & 1605791.2995 & 1267.1982 \tabularnewline
108 & 0.143 & 0.044 & 0.0414 & 896916.1979 & 1541348.1084 & 1241.5104 \tabularnewline
109 & 0.1256 & 0.0959 & 0.046 & 2684183.8712 & 1636584.422 & 1279.2906 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65652&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]98[/C][C]0.0812[/C][C]-0.0213[/C][C]0[/C][C]62562.2155[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]99[/C][C]0.1343[/C][C]-0.0865[/C][C]0.0539[/C][C]5805435.8442[/C][C]2933999.0298[/C][C]1712.892[/C][/ROW]
[ROW][C]100[/C][C]0.1365[/C][C]-0.0584[/C][C]0.0554[/C][C]2233174.181[/C][C]2700390.7469[/C][C]1643.2866[/C][/ROW]
[ROW][C]101[/C][C]0.1541[/C][C]-0.0322[/C][C]0.0496[/C][C]852122.1344[/C][C]2238323.5938[/C][C]1496.1028[/C][/ROW]
[ROW][C]102[/C][C]0.1478[/C][C]0.0085[/C][C]0.0414[/C][C]49068.0425[/C][C]1800472.4835[/C][C]1341.8169[/C][/ROW]
[ROW][C]103[/C][C]0.1397[/C][C]-0.0975[/C][C]0.0507[/C][C]4916676.1907[/C][C]2319839.7681[/C][C]1523.102[/C][/ROW]
[ROW][C]104[/C][C]0.1433[/C][C]-0.0144[/C][C]0.0455[/C][C]110464.9614[/C][C]2004214.7957[/C][C]1415.7029[/C][/ROW]
[ROW][C]105[/C][C]0.128[/C][C]0.0151[/C][C]0.0417[/C][C]80439.7215[/C][C]1763742.9114[/C][C]1328.0598[/C][/ROW]
[ROW][C]106[/C][C]0.1224[/C][C]-0.0032[/C][C]0.0375[/C][C]3045.2483[/C][C]1568109.8377[/C][C]1252.2419[/C][/ROW]
[ROW][C]107[/C][C]0.1303[/C][C]0.0748[/C][C]0.0412[/C][C]1944924.4553[/C][C]1605791.2995[/C][C]1267.1982[/C][/ROW]
[ROW][C]108[/C][C]0.143[/C][C]0.044[/C][C]0.0414[/C][C]896916.1979[/C][C]1541348.1084[/C][C]1241.5104[/C][/ROW]
[ROW][C]109[/C][C]0.1256[/C][C]0.0959[/C][C]0.046[/C][C]2684183.8712[/C][C]1636584.422[/C][C]1279.2906[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65652&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65652&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
980.0812-0.0213062562.215500
990.1343-0.08650.05395805435.84422933999.02981712.892
1000.1365-0.05840.05542233174.1812700390.74691643.2866
1010.1541-0.03220.0496852122.13442238323.59381496.1028
1020.14780.00850.041449068.04251800472.48351341.8169
1030.1397-0.09750.05074916676.19072319839.76811523.102
1040.1433-0.01440.0455110464.96142004214.79571415.7029
1050.1280.01510.041780439.72151763742.91141328.0598
1060.1224-0.00320.03753045.24831568109.83771252.2419
1070.13030.07480.04121944924.45531605791.29951267.1982
1080.1430.0440.0414896916.19791541348.10841241.5104
1090.12560.09590.0462684183.87121636584.4221279.2906



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