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, 21 Dec 2009 06:50:54 -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/21/t1261403569i65g6t6szddcc8p.htm/, Retrieved Sun, 05 May 2024 20:20:49 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=70158, Retrieved Sun, 05 May 2024 20:20:49 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact119
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-07 09:54:52] [b98453cac15ba1066b407e146608df68]
- R PD    [ARIMA Forecasting] [ARIMA forecasting] [2009-12-21 13:50:54] [371dc2189c569d90e2c1567f632c3ec0] [Current]
Feedback Forum

Post a new message
Dataseries X:
441
449
452
462
455
461
461
463
462
456
455
456
472
472
471
465
459
465
468
467
463
460
462
461
476
476
471
453
443
442
444
438
427
424
416
406
431
434
418
412
404
409
412
406
398
397
385
390
413
413
401
397
397
409
419
424
428
430
424
433
456




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time6 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 & 6 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70158&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]6 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=70158&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70158&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 time6 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[49])
37431-------
38434-------
39418-------
40412-------
41404-------
42409-------
43412-------
44406-------
45398-------
46397-------
47385-------
48390-------
49413-------
50413414.4045403.5443425.26470.39990.60012e-040.6001
51401403.152387.5014418.80260.39380.10870.03150.1087
52397401.7377382.1913421.28420.31740.52950.15170.1294
53397396.444372.0128420.87520.48220.48220.27220.0921
54409404.4292374.5404434.31810.38220.68690.38220.287
55419408.3039372.6103443.99750.27850.48480.41960.3983
56424404.6217363.1755446.06790.17970.24830.4740.346
57428399.214352.2777446.15030.11470.15030.52020.2824
58430397.9754345.9288450.0220.11390.12910.51470.2858
59424390.4376333.6831447.19210.12320.08590.57450.2179
60433397.2352336.1513458.31920.12560.19520.59180.3065
61456416.3602351.2776481.44290.11630.30810.54030.5403

\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[49]) \tabularnewline
37 & 431 & - & - & - & - & - & - & - \tabularnewline
38 & 434 & - & - & - & - & - & - & - \tabularnewline
39 & 418 & - & - & - & - & - & - & - \tabularnewline
40 & 412 & - & - & - & - & - & - & - \tabularnewline
41 & 404 & - & - & - & - & - & - & - \tabularnewline
42 & 409 & - & - & - & - & - & - & - \tabularnewline
43 & 412 & - & - & - & - & - & - & - \tabularnewline
44 & 406 & - & - & - & - & - & - & - \tabularnewline
45 & 398 & - & - & - & - & - & - & - \tabularnewline
46 & 397 & - & - & - & - & - & - & - \tabularnewline
47 & 385 & - & - & - & - & - & - & - \tabularnewline
48 & 390 & - & - & - & - & - & - & - \tabularnewline
49 & 413 & - & - & - & - & - & - & - \tabularnewline
50 & 413 & 414.4045 & 403.5443 & 425.2647 & 0.3999 & 0.6001 & 2e-04 & 0.6001 \tabularnewline
51 & 401 & 403.152 & 387.5014 & 418.8026 & 0.3938 & 0.1087 & 0.0315 & 0.1087 \tabularnewline
52 & 397 & 401.7377 & 382.1913 & 421.2842 & 0.3174 & 0.5295 & 0.1517 & 0.1294 \tabularnewline
53 & 397 & 396.444 & 372.0128 & 420.8752 & 0.4822 & 0.4822 & 0.2722 & 0.0921 \tabularnewline
54 & 409 & 404.4292 & 374.5404 & 434.3181 & 0.3822 & 0.6869 & 0.3822 & 0.287 \tabularnewline
55 & 419 & 408.3039 & 372.6103 & 443.9975 & 0.2785 & 0.4848 & 0.4196 & 0.3983 \tabularnewline
56 & 424 & 404.6217 & 363.1755 & 446.0679 & 0.1797 & 0.2483 & 0.474 & 0.346 \tabularnewline
57 & 428 & 399.214 & 352.2777 & 446.1503 & 0.1147 & 0.1503 & 0.5202 & 0.2824 \tabularnewline
58 & 430 & 397.9754 & 345.9288 & 450.022 & 0.1139 & 0.1291 & 0.5147 & 0.2858 \tabularnewline
59 & 424 & 390.4376 & 333.6831 & 447.1921 & 0.1232 & 0.0859 & 0.5745 & 0.2179 \tabularnewline
60 & 433 & 397.2352 & 336.1513 & 458.3192 & 0.1256 & 0.1952 & 0.5918 & 0.3065 \tabularnewline
61 & 456 & 416.3602 & 351.2776 & 481.4429 & 0.1163 & 0.3081 & 0.5403 & 0.5403 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70158&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[49])[/C][/ROW]
[ROW][C]37[/C][C]431[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]434[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]418[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]412[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]404[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]409[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]412[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]406[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]398[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]397[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]385[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]390[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]413[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]413[/C][C]414.4045[/C][C]403.5443[/C][C]425.2647[/C][C]0.3999[/C][C]0.6001[/C][C]2e-04[/C][C]0.6001[/C][/ROW]
[ROW][C]51[/C][C]401[/C][C]403.152[/C][C]387.5014[/C][C]418.8026[/C][C]0.3938[/C][C]0.1087[/C][C]0.0315[/C][C]0.1087[/C][/ROW]
[ROW][C]52[/C][C]397[/C][C]401.7377[/C][C]382.1913[/C][C]421.2842[/C][C]0.3174[/C][C]0.5295[/C][C]0.1517[/C][C]0.1294[/C][/ROW]
[ROW][C]53[/C][C]397[/C][C]396.444[/C][C]372.0128[/C][C]420.8752[/C][C]0.4822[/C][C]0.4822[/C][C]0.2722[/C][C]0.0921[/C][/ROW]
[ROW][C]54[/C][C]409[/C][C]404.4292[/C][C]374.5404[/C][C]434.3181[/C][C]0.3822[/C][C]0.6869[/C][C]0.3822[/C][C]0.287[/C][/ROW]
[ROW][C]55[/C][C]419[/C][C]408.3039[/C][C]372.6103[/C][C]443.9975[/C][C]0.2785[/C][C]0.4848[/C][C]0.4196[/C][C]0.3983[/C][/ROW]
[ROW][C]56[/C][C]424[/C][C]404.6217[/C][C]363.1755[/C][C]446.0679[/C][C]0.1797[/C][C]0.2483[/C][C]0.474[/C][C]0.346[/C][/ROW]
[ROW][C]57[/C][C]428[/C][C]399.214[/C][C]352.2777[/C][C]446.1503[/C][C]0.1147[/C][C]0.1503[/C][C]0.5202[/C][C]0.2824[/C][/ROW]
[ROW][C]58[/C][C]430[/C][C]397.9754[/C][C]345.9288[/C][C]450.022[/C][C]0.1139[/C][C]0.1291[/C][C]0.5147[/C][C]0.2858[/C][/ROW]
[ROW][C]59[/C][C]424[/C][C]390.4376[/C][C]333.6831[/C][C]447.1921[/C][C]0.1232[/C][C]0.0859[/C][C]0.5745[/C][C]0.2179[/C][/ROW]
[ROW][C]60[/C][C]433[/C][C]397.2352[/C][C]336.1513[/C][C]458.3192[/C][C]0.1256[/C][C]0.1952[/C][C]0.5918[/C][C]0.3065[/C][/ROW]
[ROW][C]61[/C][C]456[/C][C]416.3602[/C][C]351.2776[/C][C]481.4429[/C][C]0.1163[/C][C]0.3081[/C][C]0.5403[/C][C]0.5403[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70158&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70158&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[49])
37431-------
38434-------
39418-------
40412-------
41404-------
42409-------
43412-------
44406-------
45398-------
46397-------
47385-------
48390-------
49413-------
50413414.4045403.5443425.26470.39990.60012e-040.6001
51401403.152387.5014418.80260.39380.10870.03150.1087
52397401.7377382.1913421.28420.31740.52950.15170.1294
53397396.444372.0128420.87520.48220.48220.27220.0921
54409404.4292374.5404434.31810.38220.68690.38220.287
55419408.3039372.6103443.99750.27850.48480.41960.3983
56424404.6217363.1755446.06790.17970.24830.4740.346
57428399.214352.2777446.15030.11470.15030.52020.2824
58430397.9754345.9288450.0220.11390.12910.51470.2858
59424390.4376333.6831447.19210.12320.08590.57450.2179
60433397.2352336.1513458.31920.12560.19520.59180.3065
61456416.3602351.2776481.44290.11630.30810.54030.5403







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.0134-0.003401.972600
510.0198-0.00530.00444.63123.30191.8171
520.0248-0.01180.006822.4469.68333.1118
530.03140.00140.00550.30917.33972.7092
540.03770.01130.006620.89210.05023.1702
550.04460.02620.0099114.406427.44295.2386
560.05230.04790.0153375.517577.16788.7845
570.060.07210.0224828.6311171.100713.0805
580.06670.08050.02891025.5759266.042416.3108
590.07420.0860.03461126.4335352.081518.7638
600.07850.090.03961279.1188436.357620.8892
610.07980.09520.04431571.3108530.937123.0421

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.0134 & -0.0034 & 0 & 1.9726 & 0 & 0 \tabularnewline
51 & 0.0198 & -0.0053 & 0.0044 & 4.6312 & 3.3019 & 1.8171 \tabularnewline
52 & 0.0248 & -0.0118 & 0.0068 & 22.446 & 9.6833 & 3.1118 \tabularnewline
53 & 0.0314 & 0.0014 & 0.0055 & 0.3091 & 7.3397 & 2.7092 \tabularnewline
54 & 0.0377 & 0.0113 & 0.0066 & 20.892 & 10.0502 & 3.1702 \tabularnewline
55 & 0.0446 & 0.0262 & 0.0099 & 114.4064 & 27.4429 & 5.2386 \tabularnewline
56 & 0.0523 & 0.0479 & 0.0153 & 375.5175 & 77.1678 & 8.7845 \tabularnewline
57 & 0.06 & 0.0721 & 0.0224 & 828.6311 & 171.1007 & 13.0805 \tabularnewline
58 & 0.0667 & 0.0805 & 0.0289 & 1025.5759 & 266.0424 & 16.3108 \tabularnewline
59 & 0.0742 & 0.086 & 0.0346 & 1126.4335 & 352.0815 & 18.7638 \tabularnewline
60 & 0.0785 & 0.09 & 0.0396 & 1279.1188 & 436.3576 & 20.8892 \tabularnewline
61 & 0.0798 & 0.0952 & 0.0443 & 1571.3108 & 530.9371 & 23.0421 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=70158&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]50[/C][C]0.0134[/C][C]-0.0034[/C][C]0[/C][C]1.9726[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]0.0198[/C][C]-0.0053[/C][C]0.0044[/C][C]4.6312[/C][C]3.3019[/C][C]1.8171[/C][/ROW]
[ROW][C]52[/C][C]0.0248[/C][C]-0.0118[/C][C]0.0068[/C][C]22.446[/C][C]9.6833[/C][C]3.1118[/C][/ROW]
[ROW][C]53[/C][C]0.0314[/C][C]0.0014[/C][C]0.0055[/C][C]0.3091[/C][C]7.3397[/C][C]2.7092[/C][/ROW]
[ROW][C]54[/C][C]0.0377[/C][C]0.0113[/C][C]0.0066[/C][C]20.892[/C][C]10.0502[/C][C]3.1702[/C][/ROW]
[ROW][C]55[/C][C]0.0446[/C][C]0.0262[/C][C]0.0099[/C][C]114.4064[/C][C]27.4429[/C][C]5.2386[/C][/ROW]
[ROW][C]56[/C][C]0.0523[/C][C]0.0479[/C][C]0.0153[/C][C]375.5175[/C][C]77.1678[/C][C]8.7845[/C][/ROW]
[ROW][C]57[/C][C]0.06[/C][C]0.0721[/C][C]0.0224[/C][C]828.6311[/C][C]171.1007[/C][C]13.0805[/C][/ROW]
[ROW][C]58[/C][C]0.0667[/C][C]0.0805[/C][C]0.0289[/C][C]1025.5759[/C][C]266.0424[/C][C]16.3108[/C][/ROW]
[ROW][C]59[/C][C]0.0742[/C][C]0.086[/C][C]0.0346[/C][C]1126.4335[/C][C]352.0815[/C][C]18.7638[/C][/ROW]
[ROW][C]60[/C][C]0.0785[/C][C]0.09[/C][C]0.0396[/C][C]1279.1188[/C][C]436.3576[/C][C]20.8892[/C][/ROW]
[ROW][C]61[/C][C]0.0798[/C][C]0.0952[/C][C]0.0443[/C][C]1571.3108[/C][C]530.9371[/C][C]23.0421[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=70158&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=70158&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
500.0134-0.003401.972600
510.0198-0.00530.00444.63123.30191.8171
520.0248-0.01180.006822.4469.68333.1118
530.03140.00140.00550.30917.33972.7092
540.03770.01130.006620.89210.05023.1702
550.04460.02620.0099114.406427.44295.2386
560.05230.04790.0153375.517577.16788.7845
570.060.07210.0224828.6311171.100713.0805
580.06670.08050.02891025.5759266.042416.3108
590.07420.0860.03461126.4335352.081518.7638
600.07850.090.03961279.1188436.357620.8892
610.07980.09520.04431571.3108530.937123.0421



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