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 computationWed, 21 Dec 2011 11:14:33 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/21/t1324484105d7ocg0vyawtj9ks.htm/, Retrieved Tue, 07 May 2024 11:42:28 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=158860, Retrieved Tue, 07 May 2024 11:42:28 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact113
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- R PD    [Standard Deviation-Mean Plot] [WS9 3.2 SMP] [2010-12-07 14:36:57] [afe9379cca749d06b3d6872e02cc47ed]
- R  D      [Standard Deviation-Mean Plot] [] [2011-12-04 11:12:53] [ec2187f7727da5d5d939740b21b8b68a]
- RMP         [ARIMA Backward Selection] [] [2011-12-04 16:51:18] [ec2187f7727da5d5d939740b21b8b68a]
-   PD          [ARIMA Backward Selection] [] [2011-12-20 22:46:18] [ec2187f7727da5d5d939740b21b8b68a]
- RMP               [ARIMA Forecasting] [] [2011-12-21 16:14:33] [542c32830549043c4555f1bd78aefedb] [Current]
Feedback Forum

Post a new message
Dataseries X:
90604
97527
111940
100280
100009
95558
98533
92694
97920
110933
110855
111716
96348
105425
114874
104199
101166
99010
101607
97492
106088
113536
112475
115491
97733
102591
114783
100397
97772
96128
91261
90686
97792
108848
109989
109453
93945
98750
119043
104776
103262
106735
101600
99358
105240
114079
121637
111747
99496
104992
124255
108258
106940
104939
105896
107287
110783
122139
125823
120480
103296
117121
129924
118589
118062
113597
117161
112893
119657
136562
140446
138744
120324
118113
130257
125510
117986
118316
122075
117573
122566
135934
138394
137999
118780
117907
142932
132200
125666
127958
127718
124368
135241
144734
142320
141481
120471
123422
145829
134572
132156
140265
137771
134035
144016
151905
155791
148440
129862
134264
151952
143191
137242
136993
134431
132523
133486
140120
137521
112193
94256
99047
109761
102160
104792
104341
112430
113034
114197
127876
135199
123663
112578
117104
139703
114961
134222
128390
134197
135963
135936
146803
143231
131510




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Gwilym Jenkins' @ jenkins.wessa.net

\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 & 'Gwilym Jenkins' @ jenkins.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158860&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]'Gwilym Jenkins' @ jenkins.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158860&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158860&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'Gwilym Jenkins' @ jenkins.wessa.net







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[132])
120112193-------
12194256-------
12299047-------
123109761-------
124102160-------
125104792-------
126104341-------
127112430-------
128113034-------
129114197-------
130127876-------
131135199-------
132123663-------
133112578106977.185999002.5409114951.83090.084300.99910
134117104113057.8169102704.7392123410.89470.22180.53620.9960.0223
135139703128646.7861116206.362141087.21020.04080.96550.99850.7838
136114961120226.3841104439.2182136013.54990.25670.00780.98760.3348
137134222118891.9492100846.8515136937.0470.04790.66530.93720.3022
138128390119619.646599438.4042139800.88870.19720.07810.93110.3473
139134197122135.604899613.3981144657.81140.14690.29310.80080.4471
140135963120701.713796265.299145138.12840.11050.13950.73070.4061
141135936124675.61898390.2141150961.02180.20060.20.78270.5301
142146803135496.6255107375.7108163617.54010.21530.48780.70230.7953
143143231138436.101108671.4499168200.7520.37610.29080.58440.8347
144131510126905.583495546.7536158264.41320.38680.15380.58030.5803

\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[132]) \tabularnewline
120 & 112193 & - & - & - & - & - & - & - \tabularnewline
121 & 94256 & - & - & - & - & - & - & - \tabularnewline
122 & 99047 & - & - & - & - & - & - & - \tabularnewline
123 & 109761 & - & - & - & - & - & - & - \tabularnewline
124 & 102160 & - & - & - & - & - & - & - \tabularnewline
125 & 104792 & - & - & - & - & - & - & - \tabularnewline
126 & 104341 & - & - & - & - & - & - & - \tabularnewline
127 & 112430 & - & - & - & - & - & - & - \tabularnewline
128 & 113034 & - & - & - & - & - & - & - \tabularnewline
129 & 114197 & - & - & - & - & - & - & - \tabularnewline
130 & 127876 & - & - & - & - & - & - & - \tabularnewline
131 & 135199 & - & - & - & - & - & - & - \tabularnewline
132 & 123663 & - & - & - & - & - & - & - \tabularnewline
133 & 112578 & 106977.1859 & 99002.5409 & 114951.8309 & 0.0843 & 0 & 0.9991 & 0 \tabularnewline
134 & 117104 & 113057.8169 & 102704.7392 & 123410.8947 & 0.2218 & 0.5362 & 0.996 & 0.0223 \tabularnewline
135 & 139703 & 128646.7861 & 116206.362 & 141087.2102 & 0.0408 & 0.9655 & 0.9985 & 0.7838 \tabularnewline
136 & 114961 & 120226.3841 & 104439.2182 & 136013.5499 & 0.2567 & 0.0078 & 0.9876 & 0.3348 \tabularnewline
137 & 134222 & 118891.9492 & 100846.8515 & 136937.047 & 0.0479 & 0.6653 & 0.9372 & 0.3022 \tabularnewline
138 & 128390 & 119619.6465 & 99438.4042 & 139800.8887 & 0.1972 & 0.0781 & 0.9311 & 0.3473 \tabularnewline
139 & 134197 & 122135.6048 & 99613.3981 & 144657.8114 & 0.1469 & 0.2931 & 0.8008 & 0.4471 \tabularnewline
140 & 135963 & 120701.7137 & 96265.299 & 145138.1284 & 0.1105 & 0.1395 & 0.7307 & 0.4061 \tabularnewline
141 & 135936 & 124675.618 & 98390.2141 & 150961.0218 & 0.2006 & 0.2 & 0.7827 & 0.5301 \tabularnewline
142 & 146803 & 135496.6255 & 107375.7108 & 163617.5401 & 0.2153 & 0.4878 & 0.7023 & 0.7953 \tabularnewline
143 & 143231 & 138436.101 & 108671.4499 & 168200.752 & 0.3761 & 0.2908 & 0.5844 & 0.8347 \tabularnewline
144 & 131510 & 126905.5834 & 95546.7536 & 158264.4132 & 0.3868 & 0.1538 & 0.5803 & 0.5803 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158860&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[132])[/C][/ROW]
[ROW][C]120[/C][C]112193[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]94256[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]99047[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]109761[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]102160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]104792[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]104341[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]112430[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]113034[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]114197[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]130[/C][C]127876[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]131[/C][C]135199[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]132[/C][C]123663[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]133[/C][C]112578[/C][C]106977.1859[/C][C]99002.5409[/C][C]114951.8309[/C][C]0.0843[/C][C]0[/C][C]0.9991[/C][C]0[/C][/ROW]
[ROW][C]134[/C][C]117104[/C][C]113057.8169[/C][C]102704.7392[/C][C]123410.8947[/C][C]0.2218[/C][C]0.5362[/C][C]0.996[/C][C]0.0223[/C][/ROW]
[ROW][C]135[/C][C]139703[/C][C]128646.7861[/C][C]116206.362[/C][C]141087.2102[/C][C]0.0408[/C][C]0.9655[/C][C]0.9985[/C][C]0.7838[/C][/ROW]
[ROW][C]136[/C][C]114961[/C][C]120226.3841[/C][C]104439.2182[/C][C]136013.5499[/C][C]0.2567[/C][C]0.0078[/C][C]0.9876[/C][C]0.3348[/C][/ROW]
[ROW][C]137[/C][C]134222[/C][C]118891.9492[/C][C]100846.8515[/C][C]136937.047[/C][C]0.0479[/C][C]0.6653[/C][C]0.9372[/C][C]0.3022[/C][/ROW]
[ROW][C]138[/C][C]128390[/C][C]119619.6465[/C][C]99438.4042[/C][C]139800.8887[/C][C]0.1972[/C][C]0.0781[/C][C]0.9311[/C][C]0.3473[/C][/ROW]
[ROW][C]139[/C][C]134197[/C][C]122135.6048[/C][C]99613.3981[/C][C]144657.8114[/C][C]0.1469[/C][C]0.2931[/C][C]0.8008[/C][C]0.4471[/C][/ROW]
[ROW][C]140[/C][C]135963[/C][C]120701.7137[/C][C]96265.299[/C][C]145138.1284[/C][C]0.1105[/C][C]0.1395[/C][C]0.7307[/C][C]0.4061[/C][/ROW]
[ROW][C]141[/C][C]135936[/C][C]124675.618[/C][C]98390.2141[/C][C]150961.0218[/C][C]0.2006[/C][C]0.2[/C][C]0.7827[/C][C]0.5301[/C][/ROW]
[ROW][C]142[/C][C]146803[/C][C]135496.6255[/C][C]107375.7108[/C][C]163617.5401[/C][C]0.2153[/C][C]0.4878[/C][C]0.7023[/C][C]0.7953[/C][/ROW]
[ROW][C]143[/C][C]143231[/C][C]138436.101[/C][C]108671.4499[/C][C]168200.752[/C][C]0.3761[/C][C]0.2908[/C][C]0.5844[/C][C]0.8347[/C][/ROW]
[ROW][C]144[/C][C]131510[/C][C]126905.5834[/C][C]95546.7536[/C][C]158264.4132[/C][C]0.3868[/C][C]0.1538[/C][C]0.5803[/C][C]0.5803[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158860&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158860&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[132])
120112193-------
12194256-------
12299047-------
123109761-------
124102160-------
125104792-------
126104341-------
127112430-------
128113034-------
129114197-------
130127876-------
131135199-------
132123663-------
133112578106977.185999002.5409114951.83090.084300.99910
134117104113057.8169102704.7392123410.89470.22180.53620.9960.0223
135139703128646.7861116206.362141087.21020.04080.96550.99850.7838
136114961120226.3841104439.2182136013.54990.25670.00780.98760.3348
137134222118891.9492100846.8515136937.0470.04790.66530.93720.3022
138128390119619.646599438.4042139800.88870.19720.07810.93110.3473
139134197122135.604899613.3981144657.81140.14690.29310.80080.4471
140135963120701.713796265.299145138.12840.11050.13950.73070.4061
141135936124675.61898390.2141150961.02180.20060.20.78270.5301
142146803135496.6255107375.7108163617.54010.21530.48780.70230.7953
143143231138436.101108671.4499168200.7520.37610.29080.58440.8347
144131510126905.583495546.7536158264.41320.38680.15380.58030.5803







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1330.0380.0524031369118.498500
1340.04670.03580.044116371597.301723870357.90014885.73
1350.04930.08590.058122239865.752356660193.85087527.2966
1360.067-0.04380.054527724269.295649426212.7127030.3778
1370.07740.12890.0694235010456.312586543061.43219302.8523
1380.08610.07330.0776919101.249784939068.06849216.2394
1390.09410.09880.0741145477254.803693587380.45919674.0571
1400.10330.12640.0807232906860.7922111002315.500810535.7636
1410.10760.09030.0817126796203.9012112757191.989710618.7189
1420.10590.08340.0819127834104.9776114264883.288510689.4754
1430.10970.03460.077622991056.6213105967262.682410294.0402
1440.12610.03630.074221200651.917198903378.45199945.0178

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
133 & 0.038 & 0.0524 & 0 & 31369118.4985 & 0 & 0 \tabularnewline
134 & 0.0467 & 0.0358 & 0.0441 & 16371597.3017 & 23870357.9001 & 4885.73 \tabularnewline
135 & 0.0493 & 0.0859 & 0.058 & 122239865.7523 & 56660193.8508 & 7527.2966 \tabularnewline
136 & 0.067 & -0.0438 & 0.0545 & 27724269.2956 & 49426212.712 & 7030.3778 \tabularnewline
137 & 0.0774 & 0.1289 & 0.0694 & 235010456.3125 & 86543061.4321 & 9302.8523 \tabularnewline
138 & 0.0861 & 0.0733 & 0.07 & 76919101.2497 & 84939068.0684 & 9216.2394 \tabularnewline
139 & 0.0941 & 0.0988 & 0.0741 & 145477254.8036 & 93587380.4591 & 9674.0571 \tabularnewline
140 & 0.1033 & 0.1264 & 0.0807 & 232906860.7922 & 111002315.5008 & 10535.7636 \tabularnewline
141 & 0.1076 & 0.0903 & 0.0817 & 126796203.9012 & 112757191.9897 & 10618.7189 \tabularnewline
142 & 0.1059 & 0.0834 & 0.0819 & 127834104.9776 & 114264883.2885 & 10689.4754 \tabularnewline
143 & 0.1097 & 0.0346 & 0.0776 & 22991056.6213 & 105967262.6824 & 10294.0402 \tabularnewline
144 & 0.1261 & 0.0363 & 0.0742 & 21200651.9171 & 98903378.4519 & 9945.0178 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158860&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]133[/C][C]0.038[/C][C]0.0524[/C][C]0[/C][C]31369118.4985[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]134[/C][C]0.0467[/C][C]0.0358[/C][C]0.0441[/C][C]16371597.3017[/C][C]23870357.9001[/C][C]4885.73[/C][/ROW]
[ROW][C]135[/C][C]0.0493[/C][C]0.0859[/C][C]0.058[/C][C]122239865.7523[/C][C]56660193.8508[/C][C]7527.2966[/C][/ROW]
[ROW][C]136[/C][C]0.067[/C][C]-0.0438[/C][C]0.0545[/C][C]27724269.2956[/C][C]49426212.712[/C][C]7030.3778[/C][/ROW]
[ROW][C]137[/C][C]0.0774[/C][C]0.1289[/C][C]0.0694[/C][C]235010456.3125[/C][C]86543061.4321[/C][C]9302.8523[/C][/ROW]
[ROW][C]138[/C][C]0.0861[/C][C]0.0733[/C][C]0.07[/C][C]76919101.2497[/C][C]84939068.0684[/C][C]9216.2394[/C][/ROW]
[ROW][C]139[/C][C]0.0941[/C][C]0.0988[/C][C]0.0741[/C][C]145477254.8036[/C][C]93587380.4591[/C][C]9674.0571[/C][/ROW]
[ROW][C]140[/C][C]0.1033[/C][C]0.1264[/C][C]0.0807[/C][C]232906860.7922[/C][C]111002315.5008[/C][C]10535.7636[/C][/ROW]
[ROW][C]141[/C][C]0.1076[/C][C]0.0903[/C][C]0.0817[/C][C]126796203.9012[/C][C]112757191.9897[/C][C]10618.7189[/C][/ROW]
[ROW][C]142[/C][C]0.1059[/C][C]0.0834[/C][C]0.0819[/C][C]127834104.9776[/C][C]114264883.2885[/C][C]10689.4754[/C][/ROW]
[ROW][C]143[/C][C]0.1097[/C][C]0.0346[/C][C]0.0776[/C][C]22991056.6213[/C][C]105967262.6824[/C][C]10294.0402[/C][/ROW]
[ROW][C]144[/C][C]0.1261[/C][C]0.0363[/C][C]0.0742[/C][C]21200651.9171[/C][C]98903378.4519[/C][C]9945.0178[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158860&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158860&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
1330.0380.0524031369118.498500
1340.04670.03580.044116371597.301723870357.90014885.73
1350.04930.08590.058122239865.752356660193.85087527.2966
1360.067-0.04380.054527724269.295649426212.7127030.3778
1370.07740.12890.0694235010456.312586543061.43219302.8523
1380.08610.07330.0776919101.249784939068.06849216.2394
1390.09410.09880.0741145477254.803693587380.45919674.0571
1400.10330.12640.0807232906860.7922111002315.500810535.7636
1410.10760.09030.0817126796203.9012112757191.989710618.7189
1420.10590.08340.0819127834104.9776114264883.288510689.4754
1430.10970.03460.077622991056.6213105967262.682410294.0402
1440.12610.03630.074221200651.917198903378.45199945.0178



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