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 computationTue, 20 Dec 2011 10:47:34 -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/20/t1324396065wfir7k1njravhdx.htm/, Retrieved Mon, 06 May 2024 00:09:32 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=158012, Retrieved Mon, 06 May 2024 00:09:32 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact145
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [web traffic] [2010-10-19 15:13:07] [b98453cac15ba1066b407e146608df68]
- RMP   [Variance Reduction Matrix] [Traffic] [2010-11-29 09:57:15] [b98453cac15ba1066b407e146608df68]
- RM      [Standard Deviation-Mean Plot] [Traffic] [2010-11-29 11:05:08] [b98453cac15ba1066b407e146608df68]
- RMP       [ARIMA Forecasting] [Traffic] [2010-11-29 21:10:32] [b98453cac15ba1066b407e146608df68]
- R PD        [ARIMA Forecasting] [] [2011-12-06 10:39:07] [aba4febe8a2e49e81bdc61a6c01f5c21]
-   PD            [ARIMA Forecasting] [] [2011-12-20 15:47:34] [3627de22d386f4cb93d383ef7c1ade7f] [Current]
- R                 [ARIMA Forecasting] [ARIMA Forecasting CV] [2011-12-20 15:48:10] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RMPD                [Kendall tau Correlation Matrix] [Paper Pearson Cor...] [2011-12-21 09:24:40] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RMPD                [Kendall tau Correlation Matrix] [Paper Kendall Tau...] [2011-12-21 09:28:32] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RMPD                [Multiple Regression] [Paper Multiple Re...] [2011-12-21 09:30:56] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RMPD                [Recursive Partitioning (Regression Trees)] [Paper Recursive p...] [2011-12-21 09:38:44] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RMPD                [(Partial) Autocorrelation Function] [Paper ACF] [2011-12-21 09:45:21] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RMPD                [Spectral Analysis] [Paper spectral an...] [2011-12-21 09:47:42] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RMPD                [Variance Reduction Matrix] [Paper variance re...] [2011-12-21 09:52:02] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RMPD                [Standard Deviation-Mean Plot] [Paper standard de...] [2011-12-21 09:54:23] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RMPD                [ARIMA Backward Selection] [paper arima forec...] [2011-12-21 10:17:35] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RMPD                [ARIMA Backward Selection] [paper arima backw...] [2011-12-21 10:36:30] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RM                    [ARIMA Forecasting] [paper arima forec...] [2011-12-21 10:55:20] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RM D                  [(Partial) Autocorrelation Function] [Paper ACF wisselk...] [2011-12-21 11:30:33] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RM D                  [Decomposition by Loess] [Paper Decompositi...] [2011-12-21 11:37:38] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RM D                  [Decomposition by Loess] [Paper Decompositi...] [2011-12-21 11:44:07] [aba4febe8a2e49e81bdc61a6c01f5c21]
- RM D                  [Decomposition by Loess] [Paper Decompositi...] [2011-12-21 11:45:20] [aba4febe8a2e49e81bdc61a6c01f5c21]
Feedback Forum

Post a new message
Dataseries X:
396
297
559
967
270
143
1562
109
371
656
511
655
465
525
885
497
1436
612
865
385
567
639
963
398
410
966
801
892
513
469
683
643
535
625
264
992
238
818
937
70
507
260
503
927
1269
537
910
532
345
918
1635
330
557
1178
740
452
218
764
255
454
866
574
1276
379
825
798
663
1069
921
858
711
503
382
464
717
690
462
657
385
577
619
479
817
752
430
451
537
519
1000
637
465
437
711
299
248
1162
714
905
649
512
472
905
786
489
479
617
925
351
1144
669
707
458
214
599
572
897
819
720
273
508
506
451
699
407
465
245
370
316
603
154
229
577
192
617
411
975
146
705
184
200
274
502
382
964
537
438
369
417
276
514
822
389
466
1255
694
1024
400
397
350
719
1277
356
457
1402
600
480
595
436
230
651
1367
564
716
747
467
671
861
319
612
433
434
503
85
564
824
74
259
69
535
239
438
459
426
288
498
454
376
225
555
252
208
130
481
389
565
173
278
609
422
445
387
339
181
245
384
212
399
229
224
203
333
384
636
185
93
581
248
304
344
407
170
312
507
224
340
168
443
204
367
210
335
364
178
206
279
387
490
238
343
232
530
291
67
397
467
178
175
299
154
106
189
194
135
201
207
280
260
227
239
333
428
230
292
350
186
326
155
75
361
261
299
300
450
183
238
165
234
176
329




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158012&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[277])
276326-------
277155-------
27875540.40818.8778652094.0320.49940.50050.50050.5005
27936122109.03282.764856440465.99730.49970.50030.50030.5003
280261197570611.95716.916593.24060.9750.0250.0250.025
281299Inf35.812535.8125NaNNaNNaNNaN
282300Inf35.812535.8125NaNNaNNaNNaN
283450Inf35.812535.8125NaNNaNNaNNaN
284183Inf35.812535.8125NaNNaNNaNNaN
285238Inf35.812535.8125NaNNaNNaNNaN
286165Inf35.812535.8125NaNNaNNaNNaN
287234Inf35.812535.8125NaNNaNNaNNaN
288176Inf35.812535.8125NaNNaNNaNNaN
289329Inf35.812535.8125NaNNaNNaNNaN

\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[277]) \tabularnewline
276 & 326 & - & - & - & - & - & - & - \tabularnewline
277 & 155 & - & - & - & - & - & - & - \tabularnewline
278 & 75 & 540.4081 & 8.8778 & 652094.032 & 0.4994 & 0.5005 & 0.5005 & 0.5005 \tabularnewline
279 & 361 & 22109.0328 & 2.7648 & 56440465.9973 & 0.4997 & 0.5003 & 0.5003 & 0.5003 \tabularnewline
280 & 261 & 197570611.9571 & 6.916 & 593.2406 & 0.975 & 0.025 & 0.025 & 0.025 \tabularnewline
281 & 299 & Inf & 35.8125 & 35.8125 & NaN & NaN & NaN & NaN \tabularnewline
282 & 300 & Inf & 35.8125 & 35.8125 & NaN & NaN & NaN & NaN \tabularnewline
283 & 450 & Inf & 35.8125 & 35.8125 & NaN & NaN & NaN & NaN \tabularnewline
284 & 183 & Inf & 35.8125 & 35.8125 & NaN & NaN & NaN & NaN \tabularnewline
285 & 238 & Inf & 35.8125 & 35.8125 & NaN & NaN & NaN & NaN \tabularnewline
286 & 165 & Inf & 35.8125 & 35.8125 & NaN & NaN & NaN & NaN \tabularnewline
287 & 234 & Inf & 35.8125 & 35.8125 & NaN & NaN & NaN & NaN \tabularnewline
288 & 176 & Inf & 35.8125 & 35.8125 & NaN & NaN & NaN & NaN \tabularnewline
289 & 329 & Inf & 35.8125 & 35.8125 & NaN & NaN & NaN & NaN \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158012&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[277])[/C][/ROW]
[ROW][C]276[/C][C]326[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]277[/C][C]155[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]278[/C][C]75[/C][C]540.4081[/C][C]8.8778[/C][C]652094.032[/C][C]0.4994[/C][C]0.5005[/C][C]0.5005[/C][C]0.5005[/C][/ROW]
[ROW][C]279[/C][C]361[/C][C]22109.0328[/C][C]2.7648[/C][C]56440465.9973[/C][C]0.4997[/C][C]0.5003[/C][C]0.5003[/C][C]0.5003[/C][/ROW]
[ROW][C]280[/C][C]261[/C][C]197570611.9571[/C][C]6.916[/C][C]593.2406[/C][C]0.975[/C][C]0.025[/C][C]0.025[/C][C]0.025[/C][/ROW]
[ROW][C]281[/C][C]299[/C][C]Inf[/C][C]35.8125[/C][C]35.8125[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][/ROW]
[ROW][C]282[/C][C]300[/C][C]Inf[/C][C]35.8125[/C][C]35.8125[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][/ROW]
[ROW][C]283[/C][C]450[/C][C]Inf[/C][C]35.8125[/C][C]35.8125[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][/ROW]
[ROW][C]284[/C][C]183[/C][C]Inf[/C][C]35.8125[/C][C]35.8125[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][/ROW]
[ROW][C]285[/C][C]238[/C][C]Inf[/C][C]35.8125[/C][C]35.8125[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][/ROW]
[ROW][C]286[/C][C]165[/C][C]Inf[/C][C]35.8125[/C][C]35.8125[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][/ROW]
[ROW][C]287[/C][C]234[/C][C]Inf[/C][C]35.8125[/C][C]35.8125[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][/ROW]
[ROW][C]288[/C][C]176[/C][C]Inf[/C][C]35.8125[/C][C]35.8125[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][/ROW]
[ROW][C]289[/C][C]329[/C][C]Inf[/C][C]35.8125[/C][C]35.8125[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158012&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158012&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[277])
276326-------
277155-------
27875540.40818.8778652094.0320.49940.50050.50050.5005
27936122109.03282.764856440465.99730.49970.50030.50030.5003
280261197570611.95716.916593.24060.9750.0250.0250.025
281299Inf35.812535.8125NaNNaNNaNNaN
282300Inf35.812535.8125NaNNaNNaNNaN
283450Inf35.812535.8125NaNNaNNaNNaN
284183Inf35.812535.8125NaNNaNNaNNaN
285238Inf35.812535.8125NaNNaNNaNNaN
286165Inf35.812535.8125NaNNaNNaNNaN
287234Inf35.812535.8125NaNNaNNaNNaN
288176Inf35.812535.8125NaNNaNNaNNaN
289329Inf35.812535.8125NaNNaNNaNNaN







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
278615.1375-0.86120216604.741100
2791301.9509-0.98370.9224472976930.9936236596767.867415381.7024
280-0.5102-10.94833903404357729480013011348016829446114067296.0003
281NaNNaNNaNInfInfInf
282NaNNaNNaNInfInfInf
283NaNNaNNaNInfInfInf
284NaNNaNNaNInfInfInf
285NaNNaNNaNInfInfInf
286NaNNaNNaNInfInfInf
287NaNNaNNaNInfInfInf
288NaNNaNNaNInfInfInf
289NaNNaNNaNInfInfInf

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
278 & 615.1375 & -0.8612 & 0 & 216604.7411 & 0 & 0 \tabularnewline
279 & 1301.9509 & -0.9837 & 0.9224 & 472976930.9936 & 236596767.8674 & 15381.7024 \tabularnewline
280 & -0.5102 & -1 & 0.9483 & 39034043577294800 & 13011348016829446 & 114067296.0003 \tabularnewline
281 & NaN & NaN & NaN & Inf & Inf & Inf \tabularnewline
282 & NaN & NaN & NaN & Inf & Inf & Inf \tabularnewline
283 & NaN & NaN & NaN & Inf & Inf & Inf \tabularnewline
284 & NaN & NaN & NaN & Inf & Inf & Inf \tabularnewline
285 & NaN & NaN & NaN & Inf & Inf & Inf \tabularnewline
286 & NaN & NaN & NaN & Inf & Inf & Inf \tabularnewline
287 & NaN & NaN & NaN & Inf & Inf & Inf \tabularnewline
288 & NaN & NaN & NaN & Inf & Inf & Inf \tabularnewline
289 & NaN & NaN & NaN & Inf & Inf & Inf \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=158012&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]278[/C][C]615.1375[/C][C]-0.8612[/C][C]0[/C][C]216604.7411[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]279[/C][C]1301.9509[/C][C]-0.9837[/C][C]0.9224[/C][C]472976930.9936[/C][C]236596767.8674[/C][C]15381.7024[/C][/ROW]
[ROW][C]280[/C][C]-0.5102[/C][C]-1[/C][C]0.9483[/C][C]39034043577294800[/C][C]13011348016829446[/C][C]114067296.0003[/C][/ROW]
[ROW][C]281[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]Inf[/C][C]Inf[/C][C]Inf[/C][/ROW]
[ROW][C]282[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]Inf[/C][C]Inf[/C][C]Inf[/C][/ROW]
[ROW][C]283[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]Inf[/C][C]Inf[/C][C]Inf[/C][/ROW]
[ROW][C]284[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]Inf[/C][C]Inf[/C][C]Inf[/C][/ROW]
[ROW][C]285[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]Inf[/C][C]Inf[/C][C]Inf[/C][/ROW]
[ROW][C]286[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]Inf[/C][C]Inf[/C][C]Inf[/C][/ROW]
[ROW][C]287[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]Inf[/C][C]Inf[/C][C]Inf[/C][/ROW]
[ROW][C]288[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]Inf[/C][C]Inf[/C][C]Inf[/C][/ROW]
[ROW][C]289[/C][C]NaN[/C][C]NaN[/C][C]NaN[/C][C]Inf[/C][C]Inf[/C][C]Inf[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=158012&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=158012&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
278615.1375-0.86120216604.741100
2791301.9509-0.98370.9224472976930.9936236596767.867415381.7024
280-0.5102-10.94833903404357729480013011348016829446114067296.0003
281NaNNaNNaNInfInfInf
282NaNNaNNaNInfInfInf
283NaNNaNNaNInfInfInf
284NaNNaNNaNInfInfInf
285NaNNaNNaNInfInfInf
286NaNNaNNaNInfInfInf
287NaNNaNNaNInfInfInf
288NaNNaNNaNInfInfInf
289NaNNaNNaNInfInfInf



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