Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationWed, 29 Dec 2010 19:11:03 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/29/t12936497482ecxiigyb1qxpq9.htm/, Retrieved Fri, 03 May 2024 08:18:05 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=117042, Retrieved Fri, 03 May 2024 08:18:05 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact87
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Paper] [2010-12-29 19:11:03] [d5e0edb7e0239841e94676417b2a1e2e] [Current]
Feedback Forum

Post a new message
Dataseries X:
9782
9938
10111
10259
10419
10622
11173
11542
11538
11837
12060
12423
12791
12891
13098
13418
13614
13653
13980
14087
14332
14232
14226
14186
14310
14152
14127
14163
13964
13811
14440
14724
14790
14961
15117
15452
16080
16284
16524
16782
16663
16678
17448
17745
17789
17864
18079
18483
19037
19344
19590
19862
20207
20593
21253
21507
21528
21818
22205
22621
23006
23178
23358
23519
23725
23789
24472
24773
24477
24669
24827




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117042&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]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117042&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117042&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'RServer@AstonUniversity' @ vre.aston.ac.uk







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[59])
4718079-------
4818483-------
4919037-------
5019344-------
5119590-------
5219862-------
5320207-------
5420593-------
5521253-------
5621507-------
5721528-------
5821818-------
5922205-------
602262122571.108522276.104722866.11230.37010.992510.9925
612300623055.655722567.63723543.67450.4210.959610.9997
622317823270.154822593.339823946.96990.39480.777910.999
632335823514.583322645.910324383.25620.36190.776210.9984
642351923783.706422720.993224846.41950.31270.783810.9982
652372523930.177422672.405325187.94950.37460.739210.9964
662378924088.721122635.936925541.50540.3430.688210.9945
672447224671.382523024.532226318.23280.40620.853210.9983
682477324960.555623121.323726799.78740.42080.69870.99990.9983
692447725078.692623049.365527108.01970.28060.61610.99970.9972
702466925257.097523040.452527473.74240.30150.75480.99880.9965
712482725474.292123073.511727875.07250.29860.74460.99620.9962

\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[59]) \tabularnewline
47 & 18079 & - & - & - & - & - & - & - \tabularnewline
48 & 18483 & - & - & - & - & - & - & - \tabularnewline
49 & 19037 & - & - & - & - & - & - & - \tabularnewline
50 & 19344 & - & - & - & - & - & - & - \tabularnewline
51 & 19590 & - & - & - & - & - & - & - \tabularnewline
52 & 19862 & - & - & - & - & - & - & - \tabularnewline
53 & 20207 & - & - & - & - & - & - & - \tabularnewline
54 & 20593 & - & - & - & - & - & - & - \tabularnewline
55 & 21253 & - & - & - & - & - & - & - \tabularnewline
56 & 21507 & - & - & - & - & - & - & - \tabularnewline
57 & 21528 & - & - & - & - & - & - & - \tabularnewline
58 & 21818 & - & - & - & - & - & - & - \tabularnewline
59 & 22205 & - & - & - & - & - & - & - \tabularnewline
60 & 22621 & 22571.1085 & 22276.1047 & 22866.1123 & 0.3701 & 0.9925 & 1 & 0.9925 \tabularnewline
61 & 23006 & 23055.6557 & 22567.637 & 23543.6745 & 0.421 & 0.9596 & 1 & 0.9997 \tabularnewline
62 & 23178 & 23270.1548 & 22593.3398 & 23946.9699 & 0.3948 & 0.7779 & 1 & 0.999 \tabularnewline
63 & 23358 & 23514.5833 & 22645.9103 & 24383.2562 & 0.3619 & 0.7762 & 1 & 0.9984 \tabularnewline
64 & 23519 & 23783.7064 & 22720.9932 & 24846.4195 & 0.3127 & 0.7838 & 1 & 0.9982 \tabularnewline
65 & 23725 & 23930.1774 & 22672.4053 & 25187.9495 & 0.3746 & 0.7392 & 1 & 0.9964 \tabularnewline
66 & 23789 & 24088.7211 & 22635.9369 & 25541.5054 & 0.343 & 0.6882 & 1 & 0.9945 \tabularnewline
67 & 24472 & 24671.3825 & 23024.5322 & 26318.2328 & 0.4062 & 0.8532 & 1 & 0.9983 \tabularnewline
68 & 24773 & 24960.5556 & 23121.3237 & 26799.7874 & 0.4208 & 0.6987 & 0.9999 & 0.9983 \tabularnewline
69 & 24477 & 25078.6926 & 23049.3655 & 27108.0197 & 0.2806 & 0.6161 & 0.9997 & 0.9972 \tabularnewline
70 & 24669 & 25257.0975 & 23040.4525 & 27473.7424 & 0.3015 & 0.7548 & 0.9988 & 0.9965 \tabularnewline
71 & 24827 & 25474.2921 & 23073.5117 & 27875.0725 & 0.2986 & 0.7446 & 0.9962 & 0.9962 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117042&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[59])[/C][/ROW]
[ROW][C]47[/C][C]18079[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]18483[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]19037[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]19344[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]19590[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]19862[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]20207[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]20593[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]21253[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]21507[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]21528[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]21818[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]22205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]22621[/C][C]22571.1085[/C][C]22276.1047[/C][C]22866.1123[/C][C]0.3701[/C][C]0.9925[/C][C]1[/C][C]0.9925[/C][/ROW]
[ROW][C]61[/C][C]23006[/C][C]23055.6557[/C][C]22567.637[/C][C]23543.6745[/C][C]0.421[/C][C]0.9596[/C][C]1[/C][C]0.9997[/C][/ROW]
[ROW][C]62[/C][C]23178[/C][C]23270.1548[/C][C]22593.3398[/C][C]23946.9699[/C][C]0.3948[/C][C]0.7779[/C][C]1[/C][C]0.999[/C][/ROW]
[ROW][C]63[/C][C]23358[/C][C]23514.5833[/C][C]22645.9103[/C][C]24383.2562[/C][C]0.3619[/C][C]0.7762[/C][C]1[/C][C]0.9984[/C][/ROW]
[ROW][C]64[/C][C]23519[/C][C]23783.7064[/C][C]22720.9932[/C][C]24846.4195[/C][C]0.3127[/C][C]0.7838[/C][C]1[/C][C]0.9982[/C][/ROW]
[ROW][C]65[/C][C]23725[/C][C]23930.1774[/C][C]22672.4053[/C][C]25187.9495[/C][C]0.3746[/C][C]0.7392[/C][C]1[/C][C]0.9964[/C][/ROW]
[ROW][C]66[/C][C]23789[/C][C]24088.7211[/C][C]22635.9369[/C][C]25541.5054[/C][C]0.343[/C][C]0.6882[/C][C]1[/C][C]0.9945[/C][/ROW]
[ROW][C]67[/C][C]24472[/C][C]24671.3825[/C][C]23024.5322[/C][C]26318.2328[/C][C]0.4062[/C][C]0.8532[/C][C]1[/C][C]0.9983[/C][/ROW]
[ROW][C]68[/C][C]24773[/C][C]24960.5556[/C][C]23121.3237[/C][C]26799.7874[/C][C]0.4208[/C][C]0.6987[/C][C]0.9999[/C][C]0.9983[/C][/ROW]
[ROW][C]69[/C][C]24477[/C][C]25078.6926[/C][C]23049.3655[/C][C]27108.0197[/C][C]0.2806[/C][C]0.6161[/C][C]0.9997[/C][C]0.9972[/C][/ROW]
[ROW][C]70[/C][C]24669[/C][C]25257.0975[/C][C]23040.4525[/C][C]27473.7424[/C][C]0.3015[/C][C]0.7548[/C][C]0.9988[/C][C]0.9965[/C][/ROW]
[ROW][C]71[/C][C]24827[/C][C]25474.2921[/C][C]23073.5117[/C][C]27875.0725[/C][C]0.2986[/C][C]0.7446[/C][C]0.9962[/C][C]0.9962[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117042&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117042&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[59])
4718079-------
4818483-------
4919037-------
5019344-------
5119590-------
5219862-------
5320207-------
5420593-------
5521253-------
5621507-------
5721528-------
5821818-------
5922205-------
602262122571.108522276.104722866.11230.37010.992510.9925
612300623055.655722567.63723543.67450.4210.959610.9997
622317823270.154822593.339823946.96990.39480.777910.999
632335823514.583322645.910324383.25620.36190.776210.9984
642351923783.706422720.993224846.41950.31270.783810.9982
652372523930.177422672.405325187.94950.37460.739210.9964
662378924088.721122635.936925541.50540.3430.688210.9945
672447224671.382523024.532226318.23280.40620.853210.9983
682477324960.555623121.323726799.78740.42080.69870.99990.9983
692447725078.692623049.365527108.01970.28060.61610.99970.9972
702466925257.097523040.452527473.74240.30150.75480.99880.9965
712482725474.292123073.511727875.07250.29860.74460.99620.9962







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
600.00670.002202489.162200
610.0108-0.00220.00222465.69222477.427249.7738
620.0148-0.0040.00288492.51284482.455766.9511
630.0188-0.00670.003724518.31599491.420897.4239
640.0228-0.01110.005270069.461221607.0289146.9933
650.0268-0.00860.005842097.767825022.152158.1839
660.0308-0.01240.006789832.75134280.809185.1508
670.0341-0.00810.006939753.373534964.8796186.989
680.0376-0.00750.00735177.092434988.4588187.052
690.0413-0.0240.0087362033.984367693.0113260.1788
700.0448-0.02330.01345858.615792980.7936304.9275
710.0481-0.02540.0113418987.0474120147.9814346.6237

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
60 & 0.0067 & 0.0022 & 0 & 2489.1622 & 0 & 0 \tabularnewline
61 & 0.0108 & -0.0022 & 0.0022 & 2465.6922 & 2477.4272 & 49.7738 \tabularnewline
62 & 0.0148 & -0.004 & 0.0028 & 8492.5128 & 4482.4557 & 66.9511 \tabularnewline
63 & 0.0188 & -0.0067 & 0.0037 & 24518.3159 & 9491.4208 & 97.4239 \tabularnewline
64 & 0.0228 & -0.0111 & 0.0052 & 70069.4612 & 21607.0289 & 146.9933 \tabularnewline
65 & 0.0268 & -0.0086 & 0.0058 & 42097.7678 & 25022.152 & 158.1839 \tabularnewline
66 & 0.0308 & -0.0124 & 0.0067 & 89832.751 & 34280.809 & 185.1508 \tabularnewline
67 & 0.0341 & -0.0081 & 0.0069 & 39753.3735 & 34964.8796 & 186.989 \tabularnewline
68 & 0.0376 & -0.0075 & 0.007 & 35177.0924 & 34988.4588 & 187.052 \tabularnewline
69 & 0.0413 & -0.024 & 0.0087 & 362033.9843 & 67693.0113 & 260.1788 \tabularnewline
70 & 0.0448 & -0.0233 & 0.01 & 345858.6157 & 92980.7936 & 304.9275 \tabularnewline
71 & 0.0481 & -0.0254 & 0.0113 & 418987.0474 & 120147.9814 & 346.6237 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117042&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]60[/C][C]0.0067[/C][C]0.0022[/C][C]0[/C][C]2489.1622[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]61[/C][C]0.0108[/C][C]-0.0022[/C][C]0.0022[/C][C]2465.6922[/C][C]2477.4272[/C][C]49.7738[/C][/ROW]
[ROW][C]62[/C][C]0.0148[/C][C]-0.004[/C][C]0.0028[/C][C]8492.5128[/C][C]4482.4557[/C][C]66.9511[/C][/ROW]
[ROW][C]63[/C][C]0.0188[/C][C]-0.0067[/C][C]0.0037[/C][C]24518.3159[/C][C]9491.4208[/C][C]97.4239[/C][/ROW]
[ROW][C]64[/C][C]0.0228[/C][C]-0.0111[/C][C]0.0052[/C][C]70069.4612[/C][C]21607.0289[/C][C]146.9933[/C][/ROW]
[ROW][C]65[/C][C]0.0268[/C][C]-0.0086[/C][C]0.0058[/C][C]42097.7678[/C][C]25022.152[/C][C]158.1839[/C][/ROW]
[ROW][C]66[/C][C]0.0308[/C][C]-0.0124[/C][C]0.0067[/C][C]89832.751[/C][C]34280.809[/C][C]185.1508[/C][/ROW]
[ROW][C]67[/C][C]0.0341[/C][C]-0.0081[/C][C]0.0069[/C][C]39753.3735[/C][C]34964.8796[/C][C]186.989[/C][/ROW]
[ROW][C]68[/C][C]0.0376[/C][C]-0.0075[/C][C]0.007[/C][C]35177.0924[/C][C]34988.4588[/C][C]187.052[/C][/ROW]
[ROW][C]69[/C][C]0.0413[/C][C]-0.024[/C][C]0.0087[/C][C]362033.9843[/C][C]67693.0113[/C][C]260.1788[/C][/ROW]
[ROW][C]70[/C][C]0.0448[/C][C]-0.0233[/C][C]0.01[/C][C]345858.6157[/C][C]92980.7936[/C][C]304.9275[/C][/ROW]
[ROW][C]71[/C][C]0.0481[/C][C]-0.0254[/C][C]0.0113[/C][C]418987.0474[/C][C]120147.9814[/C][C]346.6237[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117042&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117042&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
600.00670.002202489.162200
610.0108-0.00220.00222465.69222477.427249.7738
620.0148-0.0040.00288492.51284482.455766.9511
630.0188-0.00670.003724518.31599491.420897.4239
640.0228-0.01110.005270069.461221607.0289146.9933
650.0268-0.00860.005842097.767825022.152158.1839
660.0308-0.01240.006789832.75134280.809185.1508
670.0341-0.00810.006939753.373534964.8796186.989
680.0376-0.00750.00735177.092434988.4588187.052
690.0413-0.0240.0087362033.984367693.0113260.1788
700.0448-0.02330.01345858.615792980.7936304.9275
710.0481-0.02540.0113418987.0474120147.9814346.6237



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