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 computationMon, 20 Dec 2010 12:39:19 +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/20/t1292848998lnb1ln4yp3iooaz.htm/, Retrieved Fri, 03 May 2024 18:03:38 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=112882, Retrieved Fri, 03 May 2024 18:03:38 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact104
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [] [2010-12-20 11:55:01] [22937c5b58c14f6c22964f32d64ff823]
- RMP     [ARIMA Forecasting] [] [2010-12-20 12:39:19] [5f45e5b827d1a020c3ecc9d930121b4e] [Current]
Feedback Forum

Post a new message
Dataseries X:
5
4
5
6
6
6
7
8
7
8
7
8
8
9
9
8
9
9
10
11
12
13
13
13
14
14
15
15
16
16
17
18
19
20
22
20
22
25
24
25
28
26
27
26
25
27
28
30
31
32
34
34
33
32
34
36
37
40
38
38
36
40
40
42
44
45
47
49
47
49
52
50
50
57
58
58
58
61
61
64
68
40
34
46
36
34
45
55
50
56
72
76
78
77
90
88
97
93
84
67
72
75
71
75
90
78
73
62
65
61
58
33
39
56
79
82
79
73
87
85
83
82
83
92
95
97
87
84
84
89
103
106
109
106
105
115
120
124
121
131
139
133
119
123
120
128
134
126
115
106
99
100
99
99
100
100
108
109
115
114
108
113
118
122
118
121
118
121
121
112
119
116
110
111
106
108




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=112882&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]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=112882&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=112882&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'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[156])
155100-------
156100-------
15710810082.1189120.86850.22620.50.50.5
15810910074.6106131.87390.290.31140.31140.5
15911510069.2963140.73420.23520.33250.33250.5
16011410065.0952148.49090.28570.27220.27220.5
16110810061.5848155.56350.38890.31070.31070.5
16211310058.5537162.1630.34090.40040.40040.5
16311810055.8794168.4120.3030.35480.35480.5
16412210053.4831174.38930.28110.31770.31770.5
16511810051.3109180.14870.32990.29530.29530.5
16612110049.324185.7290.31560.34030.34030.5
16711810047.4933191.15930.34940.32580.32580.5
16812110045.7966196.46210.33480.35730.35730.5
16912110044.216201.65480.34280.34280.34280.5
17011210042.7373206.75190.41280.34990.34990.5
17111910041.349211.76490.36950.41670.41670.5
17211610040.0413216.70360.39410.37480.37480.5
17311010038.806221.57610.4360.39820.39820.5
17411110037.6362226.38920.43230.43840.43840.5
17510610036.5261231.14910.46430.43470.43470.5
17610810035.4704235.86070.45410.46550.46550.5

\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[156]) \tabularnewline
155 & 100 & - & - & - & - & - & - & - \tabularnewline
156 & 100 & - & - & - & - & - & - & - \tabularnewline
157 & 108 & 100 & 82.1189 & 120.8685 & 0.2262 & 0.5 & 0.5 & 0.5 \tabularnewline
158 & 109 & 100 & 74.6106 & 131.8739 & 0.29 & 0.3114 & 0.3114 & 0.5 \tabularnewline
159 & 115 & 100 & 69.2963 & 140.7342 & 0.2352 & 0.3325 & 0.3325 & 0.5 \tabularnewline
160 & 114 & 100 & 65.0952 & 148.4909 & 0.2857 & 0.2722 & 0.2722 & 0.5 \tabularnewline
161 & 108 & 100 & 61.5848 & 155.5635 & 0.3889 & 0.3107 & 0.3107 & 0.5 \tabularnewline
162 & 113 & 100 & 58.5537 & 162.163 & 0.3409 & 0.4004 & 0.4004 & 0.5 \tabularnewline
163 & 118 & 100 & 55.8794 & 168.412 & 0.303 & 0.3548 & 0.3548 & 0.5 \tabularnewline
164 & 122 & 100 & 53.4831 & 174.3893 & 0.2811 & 0.3177 & 0.3177 & 0.5 \tabularnewline
165 & 118 & 100 & 51.3109 & 180.1487 & 0.3299 & 0.2953 & 0.2953 & 0.5 \tabularnewline
166 & 121 & 100 & 49.324 & 185.729 & 0.3156 & 0.3403 & 0.3403 & 0.5 \tabularnewline
167 & 118 & 100 & 47.4933 & 191.1593 & 0.3494 & 0.3258 & 0.3258 & 0.5 \tabularnewline
168 & 121 & 100 & 45.7966 & 196.4621 & 0.3348 & 0.3573 & 0.3573 & 0.5 \tabularnewline
169 & 121 & 100 & 44.216 & 201.6548 & 0.3428 & 0.3428 & 0.3428 & 0.5 \tabularnewline
170 & 112 & 100 & 42.7373 & 206.7519 & 0.4128 & 0.3499 & 0.3499 & 0.5 \tabularnewline
171 & 119 & 100 & 41.349 & 211.7649 & 0.3695 & 0.4167 & 0.4167 & 0.5 \tabularnewline
172 & 116 & 100 & 40.0413 & 216.7036 & 0.3941 & 0.3748 & 0.3748 & 0.5 \tabularnewline
173 & 110 & 100 & 38.806 & 221.5761 & 0.436 & 0.3982 & 0.3982 & 0.5 \tabularnewline
174 & 111 & 100 & 37.6362 & 226.3892 & 0.4323 & 0.4384 & 0.4384 & 0.5 \tabularnewline
175 & 106 & 100 & 36.5261 & 231.1491 & 0.4643 & 0.4347 & 0.4347 & 0.5 \tabularnewline
176 & 108 & 100 & 35.4704 & 235.8607 & 0.4541 & 0.4655 & 0.4655 & 0.5 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=112882&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[156])[/C][/ROW]
[ROW][C]155[/C][C]100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]156[/C][C]100[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]157[/C][C]108[/C][C]100[/C][C]82.1189[/C][C]120.8685[/C][C]0.2262[/C][C]0.5[/C][C]0.5[/C][C]0.5[/C][/ROW]
[ROW][C]158[/C][C]109[/C][C]100[/C][C]74.6106[/C][C]131.8739[/C][C]0.29[/C][C]0.3114[/C][C]0.3114[/C][C]0.5[/C][/ROW]
[ROW][C]159[/C][C]115[/C][C]100[/C][C]69.2963[/C][C]140.7342[/C][C]0.2352[/C][C]0.3325[/C][C]0.3325[/C][C]0.5[/C][/ROW]
[ROW][C]160[/C][C]114[/C][C]100[/C][C]65.0952[/C][C]148.4909[/C][C]0.2857[/C][C]0.2722[/C][C]0.2722[/C][C]0.5[/C][/ROW]
[ROW][C]161[/C][C]108[/C][C]100[/C][C]61.5848[/C][C]155.5635[/C][C]0.3889[/C][C]0.3107[/C][C]0.3107[/C][C]0.5[/C][/ROW]
[ROW][C]162[/C][C]113[/C][C]100[/C][C]58.5537[/C][C]162.163[/C][C]0.3409[/C][C]0.4004[/C][C]0.4004[/C][C]0.5[/C][/ROW]
[ROW][C]163[/C][C]118[/C][C]100[/C][C]55.8794[/C][C]168.412[/C][C]0.303[/C][C]0.3548[/C][C]0.3548[/C][C]0.5[/C][/ROW]
[ROW][C]164[/C][C]122[/C][C]100[/C][C]53.4831[/C][C]174.3893[/C][C]0.2811[/C][C]0.3177[/C][C]0.3177[/C][C]0.5[/C][/ROW]
[ROW][C]165[/C][C]118[/C][C]100[/C][C]51.3109[/C][C]180.1487[/C][C]0.3299[/C][C]0.2953[/C][C]0.2953[/C][C]0.5[/C][/ROW]
[ROW][C]166[/C][C]121[/C][C]100[/C][C]49.324[/C][C]185.729[/C][C]0.3156[/C][C]0.3403[/C][C]0.3403[/C][C]0.5[/C][/ROW]
[ROW][C]167[/C][C]118[/C][C]100[/C][C]47.4933[/C][C]191.1593[/C][C]0.3494[/C][C]0.3258[/C][C]0.3258[/C][C]0.5[/C][/ROW]
[ROW][C]168[/C][C]121[/C][C]100[/C][C]45.7966[/C][C]196.4621[/C][C]0.3348[/C][C]0.3573[/C][C]0.3573[/C][C]0.5[/C][/ROW]
[ROW][C]169[/C][C]121[/C][C]100[/C][C]44.216[/C][C]201.6548[/C][C]0.3428[/C][C]0.3428[/C][C]0.3428[/C][C]0.5[/C][/ROW]
[ROW][C]170[/C][C]112[/C][C]100[/C][C]42.7373[/C][C]206.7519[/C][C]0.4128[/C][C]0.3499[/C][C]0.3499[/C][C]0.5[/C][/ROW]
[ROW][C]171[/C][C]119[/C][C]100[/C][C]41.349[/C][C]211.7649[/C][C]0.3695[/C][C]0.4167[/C][C]0.4167[/C][C]0.5[/C][/ROW]
[ROW][C]172[/C][C]116[/C][C]100[/C][C]40.0413[/C][C]216.7036[/C][C]0.3941[/C][C]0.3748[/C][C]0.3748[/C][C]0.5[/C][/ROW]
[ROW][C]173[/C][C]110[/C][C]100[/C][C]38.806[/C][C]221.5761[/C][C]0.436[/C][C]0.3982[/C][C]0.3982[/C][C]0.5[/C][/ROW]
[ROW][C]174[/C][C]111[/C][C]100[/C][C]37.6362[/C][C]226.3892[/C][C]0.4323[/C][C]0.4384[/C][C]0.4384[/C][C]0.5[/C][/ROW]
[ROW][C]175[/C][C]106[/C][C]100[/C][C]36.5261[/C][C]231.1491[/C][C]0.4643[/C][C]0.4347[/C][C]0.4347[/C][C]0.5[/C][/ROW]
[ROW][C]176[/C][C]108[/C][C]100[/C][C]35.4704[/C][C]235.8607[/C][C]0.4541[/C][C]0.4655[/C][C]0.4655[/C][C]0.5[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=112882&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=112882&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[156])
155100-------
156100-------
15710810082.1189120.86850.22620.50.50.5
15810910074.6106131.87390.290.31140.31140.5
15911510069.2963140.73420.23520.33250.33250.5
16011410065.0952148.49090.28570.27220.27220.5
16110810061.5848155.56350.38890.31070.31070.5
16211310058.5537162.1630.34090.40040.40040.5
16311810055.8794168.4120.3030.35480.35480.5
16412210053.4831174.38930.28110.31770.31770.5
16511810051.3109180.14870.32990.29530.29530.5
16612110049.324185.7290.31560.34030.34030.5
16711810047.4933191.15930.34940.32580.32580.5
16812110045.7966196.46210.33480.35730.35730.5
16912110044.216201.65480.34280.34280.34280.5
17011210042.7373206.75190.41280.34990.34990.5
17111910041.349211.76490.36950.41670.41670.5
17211610040.0413216.70360.39410.37480.37480.5
17311010038.806221.57610.4360.39820.39820.5
17411110037.6362226.38920.43230.43840.43840.5
17510610036.5261231.14910.46430.43470.43470.5
17610810035.4704235.86070.45410.46550.46550.5







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1570.10650.0806400
1580.16260.090.0858172.58.5147
1590.20780.150.1067225123.333311.1056
1600.24740.140.115196141.511.8954
1610.28350.080.1086412611.225
1620.31720.130.1117169133.166711.5398
1630.3490.180.1214324160.428612.666
1640.37950.220.1338484200.87514.173
1650.40890.180.1389324214.555614.6477
1660.43740.210.146441237.215.4013
1670.46510.180.1491324245.090915.6554
1680.49220.210.1542441261.416716.1684
1690.51860.210.1585441275.230816.5901
1700.54470.120.1557144265.857116.3051
1710.57020.190.158361272.216.4985
1720.59540.160.1581256271.187516.4678
1730.62030.10.1547100261.117616.1591
1740.64480.110.1522121253.333315.9164
1750.66910.060.147436241.894715.553
1760.69320.080.1446423315.2643

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
157 & 0.1065 & 0.08 & 0 & 64 & 0 & 0 \tabularnewline
158 & 0.1626 & 0.09 & 0.085 & 81 & 72.5 & 8.5147 \tabularnewline
159 & 0.2078 & 0.15 & 0.1067 & 225 & 123.3333 & 11.1056 \tabularnewline
160 & 0.2474 & 0.14 & 0.115 & 196 & 141.5 & 11.8954 \tabularnewline
161 & 0.2835 & 0.08 & 0.108 & 64 & 126 & 11.225 \tabularnewline
162 & 0.3172 & 0.13 & 0.1117 & 169 & 133.1667 & 11.5398 \tabularnewline
163 & 0.349 & 0.18 & 0.1214 & 324 & 160.4286 & 12.666 \tabularnewline
164 & 0.3795 & 0.22 & 0.1338 & 484 & 200.875 & 14.173 \tabularnewline
165 & 0.4089 & 0.18 & 0.1389 & 324 & 214.5556 & 14.6477 \tabularnewline
166 & 0.4374 & 0.21 & 0.146 & 441 & 237.2 & 15.4013 \tabularnewline
167 & 0.4651 & 0.18 & 0.1491 & 324 & 245.0909 & 15.6554 \tabularnewline
168 & 0.4922 & 0.21 & 0.1542 & 441 & 261.4167 & 16.1684 \tabularnewline
169 & 0.5186 & 0.21 & 0.1585 & 441 & 275.2308 & 16.5901 \tabularnewline
170 & 0.5447 & 0.12 & 0.1557 & 144 & 265.8571 & 16.3051 \tabularnewline
171 & 0.5702 & 0.19 & 0.158 & 361 & 272.2 & 16.4985 \tabularnewline
172 & 0.5954 & 0.16 & 0.1581 & 256 & 271.1875 & 16.4678 \tabularnewline
173 & 0.6203 & 0.1 & 0.1547 & 100 & 261.1176 & 16.1591 \tabularnewline
174 & 0.6448 & 0.11 & 0.1522 & 121 & 253.3333 & 15.9164 \tabularnewline
175 & 0.6691 & 0.06 & 0.1474 & 36 & 241.8947 & 15.553 \tabularnewline
176 & 0.6932 & 0.08 & 0.144 & 64 & 233 & 15.2643 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=112882&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]157[/C][C]0.1065[/C][C]0.08[/C][C]0[/C][C]64[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]158[/C][C]0.1626[/C][C]0.09[/C][C]0.085[/C][C]81[/C][C]72.5[/C][C]8.5147[/C][/ROW]
[ROW][C]159[/C][C]0.2078[/C][C]0.15[/C][C]0.1067[/C][C]225[/C][C]123.3333[/C][C]11.1056[/C][/ROW]
[ROW][C]160[/C][C]0.2474[/C][C]0.14[/C][C]0.115[/C][C]196[/C][C]141.5[/C][C]11.8954[/C][/ROW]
[ROW][C]161[/C][C]0.2835[/C][C]0.08[/C][C]0.108[/C][C]64[/C][C]126[/C][C]11.225[/C][/ROW]
[ROW][C]162[/C][C]0.3172[/C][C]0.13[/C][C]0.1117[/C][C]169[/C][C]133.1667[/C][C]11.5398[/C][/ROW]
[ROW][C]163[/C][C]0.349[/C][C]0.18[/C][C]0.1214[/C][C]324[/C][C]160.4286[/C][C]12.666[/C][/ROW]
[ROW][C]164[/C][C]0.3795[/C][C]0.22[/C][C]0.1338[/C][C]484[/C][C]200.875[/C][C]14.173[/C][/ROW]
[ROW][C]165[/C][C]0.4089[/C][C]0.18[/C][C]0.1389[/C][C]324[/C][C]214.5556[/C][C]14.6477[/C][/ROW]
[ROW][C]166[/C][C]0.4374[/C][C]0.21[/C][C]0.146[/C][C]441[/C][C]237.2[/C][C]15.4013[/C][/ROW]
[ROW][C]167[/C][C]0.4651[/C][C]0.18[/C][C]0.1491[/C][C]324[/C][C]245.0909[/C][C]15.6554[/C][/ROW]
[ROW][C]168[/C][C]0.4922[/C][C]0.21[/C][C]0.1542[/C][C]441[/C][C]261.4167[/C][C]16.1684[/C][/ROW]
[ROW][C]169[/C][C]0.5186[/C][C]0.21[/C][C]0.1585[/C][C]441[/C][C]275.2308[/C][C]16.5901[/C][/ROW]
[ROW][C]170[/C][C]0.5447[/C][C]0.12[/C][C]0.1557[/C][C]144[/C][C]265.8571[/C][C]16.3051[/C][/ROW]
[ROW][C]171[/C][C]0.5702[/C][C]0.19[/C][C]0.158[/C][C]361[/C][C]272.2[/C][C]16.4985[/C][/ROW]
[ROW][C]172[/C][C]0.5954[/C][C]0.16[/C][C]0.1581[/C][C]256[/C][C]271.1875[/C][C]16.4678[/C][/ROW]
[ROW][C]173[/C][C]0.6203[/C][C]0.1[/C][C]0.1547[/C][C]100[/C][C]261.1176[/C][C]16.1591[/C][/ROW]
[ROW][C]174[/C][C]0.6448[/C][C]0.11[/C][C]0.1522[/C][C]121[/C][C]253.3333[/C][C]15.9164[/C][/ROW]
[ROW][C]175[/C][C]0.6691[/C][C]0.06[/C][C]0.1474[/C][C]36[/C][C]241.8947[/C][C]15.553[/C][/ROW]
[ROW][C]176[/C][C]0.6932[/C][C]0.08[/C][C]0.144[/C][C]64[/C][C]233[/C][C]15.2643[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=112882&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=112882&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
1570.10650.0806400
1580.16260.090.0858172.58.5147
1590.20780.150.1067225123.333311.1056
1600.24740.140.115196141.511.8954
1610.28350.080.1086412611.225
1620.31720.130.1117169133.166711.5398
1630.3490.180.1214324160.428612.666
1640.37950.220.1338484200.87514.173
1650.40890.180.1389324214.555614.6477
1660.43740.210.146441237.215.4013
1670.46510.180.1491324245.090915.6554
1680.49220.210.1542441261.416716.1684
1690.51860.210.1585441275.230816.5901
1700.54470.120.1557144265.857116.3051
1710.57020.190.158361272.216.4985
1720.59540.160.1581256271.187516.4678
1730.62030.10.1547100261.117616.1591
1740.64480.110.1522121253.333315.9164
1750.66910.060.147436241.894715.553
1760.69320.080.1446423315.2643



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