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 computationFri, 16 Dec 2016 16:44:06 +0100
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Dec/16/t1481903195tpvhxaxl0p3dlxs.htm/, Retrieved Thu, 02 May 2024 14:31:03 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300389, Retrieved Thu, 02 May 2024 14:31:03 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact71
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2016-12-16 15:44:06] [9b171b8beffcb53bb49a1e7c02b89c12] [Current]
Feedback Forum

Post a new message
Dataseries X:
4865
5025
5135
5235
5290
5335
5350
5360
5350
5320
5285
5235
5185
5120
5065
4995
4990
4960
4955
4960
4965
4980
5005
5040
5095
5165
5215
5275
5320
5370
5445
5535
5585
5650
5695
5715
5935
6010
6085
6155
6210
6270
6370
6440
6490
6580
6655
6695
6905
7070
7200
7315
7225
7300
7335
7340
7320
7275
7220
7160
7015
6870
6610
6430
6330
6240
6210
6185
6185
6185
6205
6250
6310
6405
6515
6655
6795
6945
7100
7260




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input view raw input (R code)  \tabularnewline
Raw Outputview raw output of R engine  \tabularnewline
Computing time1 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300389&T=0

[TABLE]
[ROW]
Summary of computational transaction[/C][/ROW] [ROW]Raw Input[/C] view raw input (R code) [/C][/ROW] [ROW]Raw Output[/C]view raw output of R engine [/C][/ROW] [ROW]Computing time[/C]1 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=300389&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300389&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 Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R ServerBig Analytics Cloud Computing Center







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[68])
676210-------
686185-------
6961856157.29116052.38716262.19520.30230.30230.30230.3023
7061856138.59675937.28186339.91150.32570.32570.32570.3257
7162056113.72795792.43546435.02040.28880.33190.33190.3319
7262506091.87325624.10236559.64410.25380.31770.31770.3482
7363106069.8625445.46086694.26310.22550.28590.28590.3589
7464056046.63195246.92146846.34250.18990.25930.25930.3673
7565156024.80755036.93447012.68070.16540.22530.22530.3753
7666556002.04524813.64277190.44760.14080.19880.19880.3814
7767955979.63014577.74327381.5170.12710.17250.17250.387
7869455957.28574331.20627583.36510.11690.15630.15630.3919
7971005934.69974073.23787796.16150.10990.14370.14370.3961
8072605912.34153805.17448019.50850.1050.13460.13460.3999

\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[68]) \tabularnewline
67 & 6210 & - & - & - & - & - & - & - \tabularnewline
68 & 6185 & - & - & - & - & - & - & - \tabularnewline
69 & 6185 & 6157.2911 & 6052.3871 & 6262.1952 & 0.3023 & 0.3023 & 0.3023 & 0.3023 \tabularnewline
70 & 6185 & 6138.5967 & 5937.2818 & 6339.9115 & 0.3257 & 0.3257 & 0.3257 & 0.3257 \tabularnewline
71 & 6205 & 6113.7279 & 5792.4354 & 6435.0204 & 0.2888 & 0.3319 & 0.3319 & 0.3319 \tabularnewline
72 & 6250 & 6091.8732 & 5624.1023 & 6559.6441 & 0.2538 & 0.3177 & 0.3177 & 0.3482 \tabularnewline
73 & 6310 & 6069.862 & 5445.4608 & 6694.2631 & 0.2255 & 0.2859 & 0.2859 & 0.3589 \tabularnewline
74 & 6405 & 6046.6319 & 5246.9214 & 6846.3425 & 0.1899 & 0.2593 & 0.2593 & 0.3673 \tabularnewline
75 & 6515 & 6024.8075 & 5036.9344 & 7012.6807 & 0.1654 & 0.2253 & 0.2253 & 0.3753 \tabularnewline
76 & 6655 & 6002.0452 & 4813.6427 & 7190.4476 & 0.1408 & 0.1988 & 0.1988 & 0.3814 \tabularnewline
77 & 6795 & 5979.6301 & 4577.7432 & 7381.517 & 0.1271 & 0.1725 & 0.1725 & 0.387 \tabularnewline
78 & 6945 & 5957.2857 & 4331.2062 & 7583.3651 & 0.1169 & 0.1563 & 0.1563 & 0.3919 \tabularnewline
79 & 7100 & 5934.6997 & 4073.2378 & 7796.1615 & 0.1099 & 0.1437 & 0.1437 & 0.3961 \tabularnewline
80 & 7260 & 5912.3415 & 3805.1744 & 8019.5085 & 0.105 & 0.1346 & 0.1346 & 0.3999 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300389&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[68])[/C][/ROW]
[ROW][C]67[/C][C]6210[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]68[/C][C]6185[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]69[/C][C]6185[/C][C]6157.2911[/C][C]6052.3871[/C][C]6262.1952[/C][C]0.3023[/C][C]0.3023[/C][C]0.3023[/C][C]0.3023[/C][/ROW]
[ROW][C]70[/C][C]6185[/C][C]6138.5967[/C][C]5937.2818[/C][C]6339.9115[/C][C]0.3257[/C][C]0.3257[/C][C]0.3257[/C][C]0.3257[/C][/ROW]
[ROW][C]71[/C][C]6205[/C][C]6113.7279[/C][C]5792.4354[/C][C]6435.0204[/C][C]0.2888[/C][C]0.3319[/C][C]0.3319[/C][C]0.3319[/C][/ROW]
[ROW][C]72[/C][C]6250[/C][C]6091.8732[/C][C]5624.1023[/C][C]6559.6441[/C][C]0.2538[/C][C]0.3177[/C][C]0.3177[/C][C]0.3482[/C][/ROW]
[ROW][C]73[/C][C]6310[/C][C]6069.862[/C][C]5445.4608[/C][C]6694.2631[/C][C]0.2255[/C][C]0.2859[/C][C]0.2859[/C][C]0.3589[/C][/ROW]
[ROW][C]74[/C][C]6405[/C][C]6046.6319[/C][C]5246.9214[/C][C]6846.3425[/C][C]0.1899[/C][C]0.2593[/C][C]0.2593[/C][C]0.3673[/C][/ROW]
[ROW][C]75[/C][C]6515[/C][C]6024.8075[/C][C]5036.9344[/C][C]7012.6807[/C][C]0.1654[/C][C]0.2253[/C][C]0.2253[/C][C]0.3753[/C][/ROW]
[ROW][C]76[/C][C]6655[/C][C]6002.0452[/C][C]4813.6427[/C][C]7190.4476[/C][C]0.1408[/C][C]0.1988[/C][C]0.1988[/C][C]0.3814[/C][/ROW]
[ROW][C]77[/C][C]6795[/C][C]5979.6301[/C][C]4577.7432[/C][C]7381.517[/C][C]0.1271[/C][C]0.1725[/C][C]0.1725[/C][C]0.387[/C][/ROW]
[ROW][C]78[/C][C]6945[/C][C]5957.2857[/C][C]4331.2062[/C][C]7583.3651[/C][C]0.1169[/C][C]0.1563[/C][C]0.1563[/C][C]0.3919[/C][/ROW]
[ROW][C]79[/C][C]7100[/C][C]5934.6997[/C][C]4073.2378[/C][C]7796.1615[/C][C]0.1099[/C][C]0.1437[/C][C]0.1437[/C][C]0.3961[/C][/ROW]
[ROW][C]80[/C][C]7260[/C][C]5912.3415[/C][C]3805.1744[/C][C]8019.5085[/C][C]0.105[/C][C]0.1346[/C][C]0.1346[/C][C]0.3999[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300389&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300389&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[68])
676210-------
686185-------
6961856157.29116052.38716262.19520.30230.30230.30230.3023
7061856138.59675937.28186339.91150.32570.32570.32570.3257
7162056113.72795792.43546435.02040.28880.33190.33190.3319
7262506091.87325624.10236559.64410.25380.31770.31770.3482
7363106069.8625445.46086694.26310.22550.28590.28590.3589
7464056046.63195246.92146846.34250.18990.25930.25930.3673
7565156024.80755036.93447012.68070.16540.22530.22530.3753
7666556002.04524813.64277190.44760.14080.19880.19880.3814
7767955979.63014577.74327381.5170.12710.17250.17250.387
7869455957.28574331.20627583.36510.11690.15630.15630.3919
7971005934.69974073.23787796.16150.10990.14370.14370.3961
8072605912.34153805.17448019.50850.1050.13460.13460.3999







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
690.00870.00450.00450.0045767.7809000.28350.2835
700.01670.00750.0060.0062153.26971460.525338.21680.47480.3792
710.02680.01470.00890.00898330.5973750.549261.24170.93390.5641
720.03920.02530.0130.013125004.09469063.935695.20471.6180.8276
730.05250.03810.0180.018357666.280318784.4045137.05622.45721.1535
740.06750.0560.02430.0248128427.678937058.2836192.50533.6671.5724
750.08370.07520.03160.0324240288.64366091.1921257.08215.01592.0644
760.1010.09810.03990.0413426349.9758111123.54333.3526.68142.6415
770.11960.120.04880.0509664828.0608172646.2646415.50728.34333.275
780.13930.14220.05820.0611975579.6253252939.6006502.93110.10683.9582
790.160.16410.06780.07181357924.8966353392.8094594.468511.9244.6824
800.18180.18560.07760.08291816183.5605475292.0386689.414313.795.4413

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
69 & 0.0087 & 0.0045 & 0.0045 & 0.0045 & 767.7809 & 0 & 0 & 0.2835 & 0.2835 \tabularnewline
70 & 0.0167 & 0.0075 & 0.006 & 0.006 & 2153.2697 & 1460.5253 & 38.2168 & 0.4748 & 0.3792 \tabularnewline
71 & 0.0268 & 0.0147 & 0.0089 & 0.0089 & 8330.597 & 3750.5492 & 61.2417 & 0.9339 & 0.5641 \tabularnewline
72 & 0.0392 & 0.0253 & 0.013 & 0.0131 & 25004.0946 & 9063.9356 & 95.2047 & 1.618 & 0.8276 \tabularnewline
73 & 0.0525 & 0.0381 & 0.018 & 0.0183 & 57666.2803 & 18784.4045 & 137.0562 & 2.4572 & 1.1535 \tabularnewline
74 & 0.0675 & 0.056 & 0.0243 & 0.0248 & 128427.6789 & 37058.2836 & 192.5053 & 3.667 & 1.5724 \tabularnewline
75 & 0.0837 & 0.0752 & 0.0316 & 0.0324 & 240288.643 & 66091.1921 & 257.0821 & 5.0159 & 2.0644 \tabularnewline
76 & 0.101 & 0.0981 & 0.0399 & 0.0413 & 426349.9758 & 111123.54 & 333.352 & 6.6814 & 2.6415 \tabularnewline
77 & 0.1196 & 0.12 & 0.0488 & 0.0509 & 664828.0608 & 172646.2646 & 415.5072 & 8.3433 & 3.275 \tabularnewline
78 & 0.1393 & 0.1422 & 0.0582 & 0.0611 & 975579.6253 & 252939.6006 & 502.931 & 10.1068 & 3.9582 \tabularnewline
79 & 0.16 & 0.1641 & 0.0678 & 0.0718 & 1357924.8966 & 353392.8094 & 594.4685 & 11.924 & 4.6824 \tabularnewline
80 & 0.1818 & 0.1856 & 0.0776 & 0.0829 & 1816183.5605 & 475292.0386 & 689.4143 & 13.79 & 5.4413 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300389&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]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]69[/C][C]0.0087[/C][C]0.0045[/C][C]0.0045[/C][C]0.0045[/C][C]767.7809[/C][C]0[/C][C]0[/C][C]0.2835[/C][C]0.2835[/C][/ROW]
[ROW][C]70[/C][C]0.0167[/C][C]0.0075[/C][C]0.006[/C][C]0.006[/C][C]2153.2697[/C][C]1460.5253[/C][C]38.2168[/C][C]0.4748[/C][C]0.3792[/C][/ROW]
[ROW][C]71[/C][C]0.0268[/C][C]0.0147[/C][C]0.0089[/C][C]0.0089[/C][C]8330.597[/C][C]3750.5492[/C][C]61.2417[/C][C]0.9339[/C][C]0.5641[/C][/ROW]
[ROW][C]72[/C][C]0.0392[/C][C]0.0253[/C][C]0.013[/C][C]0.0131[/C][C]25004.0946[/C][C]9063.9356[/C][C]95.2047[/C][C]1.618[/C][C]0.8276[/C][/ROW]
[ROW][C]73[/C][C]0.0525[/C][C]0.0381[/C][C]0.018[/C][C]0.0183[/C][C]57666.2803[/C][C]18784.4045[/C][C]137.0562[/C][C]2.4572[/C][C]1.1535[/C][/ROW]
[ROW][C]74[/C][C]0.0675[/C][C]0.056[/C][C]0.0243[/C][C]0.0248[/C][C]128427.6789[/C][C]37058.2836[/C][C]192.5053[/C][C]3.667[/C][C]1.5724[/C][/ROW]
[ROW][C]75[/C][C]0.0837[/C][C]0.0752[/C][C]0.0316[/C][C]0.0324[/C][C]240288.643[/C][C]66091.1921[/C][C]257.0821[/C][C]5.0159[/C][C]2.0644[/C][/ROW]
[ROW][C]76[/C][C]0.101[/C][C]0.0981[/C][C]0.0399[/C][C]0.0413[/C][C]426349.9758[/C][C]111123.54[/C][C]333.352[/C][C]6.6814[/C][C]2.6415[/C][/ROW]
[ROW][C]77[/C][C]0.1196[/C][C]0.12[/C][C]0.0488[/C][C]0.0509[/C][C]664828.0608[/C][C]172646.2646[/C][C]415.5072[/C][C]8.3433[/C][C]3.275[/C][/ROW]
[ROW][C]78[/C][C]0.1393[/C][C]0.1422[/C][C]0.0582[/C][C]0.0611[/C][C]975579.6253[/C][C]252939.6006[/C][C]502.931[/C][C]10.1068[/C][C]3.9582[/C][/ROW]
[ROW][C]79[/C][C]0.16[/C][C]0.1641[/C][C]0.0678[/C][C]0.0718[/C][C]1357924.8966[/C][C]353392.8094[/C][C]594.4685[/C][C]11.924[/C][C]4.6824[/C][/ROW]
[ROW][C]80[/C][C]0.1818[/C][C]0.1856[/C][C]0.0776[/C][C]0.0829[/C][C]1816183.5605[/C][C]475292.0386[/C][C]689.4143[/C][C]13.79[/C][C]5.4413[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300389&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300389&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.PEMAPEsMAPESq.EMSERMSEScaledEMASE
690.00870.00450.00450.0045767.7809000.28350.2835
700.01670.00750.0060.0062153.26971460.525338.21680.47480.3792
710.02680.01470.00890.00898330.5973750.549261.24170.93390.5641
720.03920.02530.0130.013125004.09469063.935695.20471.6180.8276
730.05250.03810.0180.018357666.280318784.4045137.05622.45721.1535
740.06750.0560.02430.0248128427.678937058.2836192.50533.6671.5724
750.08370.07520.03160.0324240288.64366091.1921257.08215.01592.0644
760.1010.09810.03990.0413426349.9758111123.54333.3526.68142.6415
770.11960.120.04880.0509664828.0608172646.2646415.50728.34333.275
780.13930.14220.05820.0611975579.6253252939.6006502.93110.10683.9582
790.160.16410.06780.07181357924.8966353392.8094594.468511.9244.6824
800.18180.18560.07760.08291816183.5605475292.0386689.414313.795.4413



Parameters (Session):
par1 = Default ; par2 = 1 ; par3 = 1 ; par4 = 0 ; par5 = 12 ; par6 = White Noise ; par7 = 0.95 ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 2 ; par4 = 0 ; par5 = 1 ; par6 = 3 ; par7 = 1 ; par8 = 0 ; 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*2
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,fx))
(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.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- 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)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+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.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[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.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[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',10,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,'sMAPE',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.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',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.smape1[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.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')