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 2016 00:32:48 +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/21/t1482276802czrv6ufsgx13pfg.htm/, Retrieved Mon, 06 May 2024 22:16:33 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=301834, Retrieved Mon, 06 May 2024 22:16:33 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact105
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Exponential Smoothing] [] [2016-12-18 12:31:12] [683f400e1b95307fc738e729f07c4fce]
- R  D  [Exponential Smoothing] [] [2016-12-18 13:29:07] [683f400e1b95307fc738e729f07c4fce]
- RMP       [ARIMA Forecasting] [] [2016-12-20 23:32:48] [404ac5ee4f7301873f6a96ef36861981] [Current]
Feedback Forum

Post a new message
Dataseries X:
2280
3640
3950
3860
3500
4740
3690
4810
6150
4530
4760
4670
3510
2990
3240
2700
2610
3280
3170
3440
4710
4320
3650
3340
3050
2960
2810
2670
2440
2580
2520
2860
3500
3460
3310
3050
2730
2760
2800
2490
2310
2350
2370
2560
2740
2830
3010
2500
2630
2270
2410
2210
2330
2690
3150
2330
2260
2330
2240
2230
2270
2220
2290
2240
2110
2240
2230
2320
2320
2540
2530
2400
2470
2290
2110
2050
2170
2070
2330
2190
2260
2300
2220
2220
2380
2280
2150
2190
2080
2120
2140
2130
2210
2210
2190
2160
2290
2270
2200
2120
2050
2080
2180
2070
2170
2240
2320
2250




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301834&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[97])
942210-------
952190-------
962160-------
972290-------
9822702215.2961478.81052951.78160.44210.42120.52680.4212
9922002175.12471141.03073209.21870.48120.42860.51140.4138
10021202224.5081939.19393509.82230.43670.51490.46020.4602
10120502156.0349577.88623734.18360.44760.51780.44370.4339
10220802173.3195344.96194001.67710.46020.55260.48860.4502
10321802210.7082171.42814249.98830.48820.550.53470.4696
10420702176.0999-112.52724464.7270.46380.49870.5430.4611
10521702207.5351-302.31784717.3880.48830.54280.53970.4743
10622402248.081-473.35784969.51980.49770.52240.51960.488
10723202208.589-784.92785202.10580.47090.49180.53620.4787
10822502193.527-1051.08425438.13820.48640.46960.50570.4768

\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[97]) \tabularnewline
94 & 2210 & - & - & - & - & - & - & - \tabularnewline
95 & 2190 & - & - & - & - & - & - & - \tabularnewline
96 & 2160 & - & - & - & - & - & - & - \tabularnewline
97 & 2290 & - & - & - & - & - & - & - \tabularnewline
98 & 2270 & 2215.296 & 1478.8105 & 2951.7816 & 0.4421 & 0.4212 & 0.5268 & 0.4212 \tabularnewline
99 & 2200 & 2175.1247 & 1141.0307 & 3209.2187 & 0.4812 & 0.4286 & 0.5114 & 0.4138 \tabularnewline
100 & 2120 & 2224.5081 & 939.1939 & 3509.8223 & 0.4367 & 0.5149 & 0.4602 & 0.4602 \tabularnewline
101 & 2050 & 2156.0349 & 577.8862 & 3734.1836 & 0.4476 & 0.5178 & 0.4437 & 0.4339 \tabularnewline
102 & 2080 & 2173.3195 & 344.9619 & 4001.6771 & 0.4602 & 0.5526 & 0.4886 & 0.4502 \tabularnewline
103 & 2180 & 2210.7082 & 171.4281 & 4249.9883 & 0.4882 & 0.55 & 0.5347 & 0.4696 \tabularnewline
104 & 2070 & 2176.0999 & -112.5272 & 4464.727 & 0.4638 & 0.4987 & 0.543 & 0.4611 \tabularnewline
105 & 2170 & 2207.5351 & -302.3178 & 4717.388 & 0.4883 & 0.5428 & 0.5397 & 0.4743 \tabularnewline
106 & 2240 & 2248.081 & -473.3578 & 4969.5198 & 0.4977 & 0.5224 & 0.5196 & 0.488 \tabularnewline
107 & 2320 & 2208.589 & -784.9278 & 5202.1058 & 0.4709 & 0.4918 & 0.5362 & 0.4787 \tabularnewline
108 & 2250 & 2193.527 & -1051.0842 & 5438.1382 & 0.4864 & 0.4696 & 0.5057 & 0.4768 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301834&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[97])[/C][/ROW]
[ROW][C]94[/C][C]2210[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]95[/C][C]2190[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]96[/C][C]2160[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]2290[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]2270[/C][C]2215.296[/C][C]1478.8105[/C][C]2951.7816[/C][C]0.4421[/C][C]0.4212[/C][C]0.5268[/C][C]0.4212[/C][/ROW]
[ROW][C]99[/C][C]2200[/C][C]2175.1247[/C][C]1141.0307[/C][C]3209.2187[/C][C]0.4812[/C][C]0.4286[/C][C]0.5114[/C][C]0.4138[/C][/ROW]
[ROW][C]100[/C][C]2120[/C][C]2224.5081[/C][C]939.1939[/C][C]3509.8223[/C][C]0.4367[/C][C]0.5149[/C][C]0.4602[/C][C]0.4602[/C][/ROW]
[ROW][C]101[/C][C]2050[/C][C]2156.0349[/C][C]577.8862[/C][C]3734.1836[/C][C]0.4476[/C][C]0.5178[/C][C]0.4437[/C][C]0.4339[/C][/ROW]
[ROW][C]102[/C][C]2080[/C][C]2173.3195[/C][C]344.9619[/C][C]4001.6771[/C][C]0.4602[/C][C]0.5526[/C][C]0.4886[/C][C]0.4502[/C][/ROW]
[ROW][C]103[/C][C]2180[/C][C]2210.7082[/C][C]171.4281[/C][C]4249.9883[/C][C]0.4882[/C][C]0.55[/C][C]0.5347[/C][C]0.4696[/C][/ROW]
[ROW][C]104[/C][C]2070[/C][C]2176.0999[/C][C]-112.5272[/C][C]4464.727[/C][C]0.4638[/C][C]0.4987[/C][C]0.543[/C][C]0.4611[/C][/ROW]
[ROW][C]105[/C][C]2170[/C][C]2207.5351[/C][C]-302.3178[/C][C]4717.388[/C][C]0.4883[/C][C]0.5428[/C][C]0.5397[/C][C]0.4743[/C][/ROW]
[ROW][C]106[/C][C]2240[/C][C]2248.081[/C][C]-473.3578[/C][C]4969.5198[/C][C]0.4977[/C][C]0.5224[/C][C]0.5196[/C][C]0.488[/C][/ROW]
[ROW][C]107[/C][C]2320[/C][C]2208.589[/C][C]-784.9278[/C][C]5202.1058[/C][C]0.4709[/C][C]0.4918[/C][C]0.5362[/C][C]0.4787[/C][/ROW]
[ROW][C]108[/C][C]2250[/C][C]2193.527[/C][C]-1051.0842[/C][C]5438.1382[/C][C]0.4864[/C][C]0.4696[/C][C]0.5057[/C][C]0.4768[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301834&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301834&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[97])
942210-------
952190-------
962160-------
972290-------
9822702215.2961478.81052951.78160.44210.42120.52680.4212
9922002175.12471141.03073209.21870.48120.42860.51140.4138
10021202224.5081939.19393509.82230.43670.51490.46020.4602
10120502156.0349577.88623734.18360.44760.51780.44370.4339
10220802173.3195344.96194001.67710.46020.55260.48860.4502
10321802210.7082171.42814249.98830.48820.550.53470.4696
10420702176.0999-112.52724464.7270.46380.49870.5430.4611
10521702207.5351-302.31784717.3880.48830.54280.53970.4743
10622402248.081-473.35784969.51980.49770.52240.51960.488
10723202208.589-784.92785202.10580.47090.49180.53620.4787
10822502193.527-1051.08425438.13820.48640.46960.50570.4768







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
980.16960.02410.02410.02442992.5257000.70130.7013
990.24260.01130.01770.0179618.78111805.653442.4930.31890.5101
1000.2948-0.04930.02820.02810921.94244844.416469.6018-1.33980.7867
1010.3735-0.05170.03410.033611243.39846444.161980.2755-1.35940.9299
1020.4292-0.04490.03630.03568708.52976897.035583.0484-1.19640.9832
1030.4706-0.01410.03260.032942.99335904.695176.842-0.39370.8849
1040.5366-0.05130.03520.034611257.19086669.337381.666-1.36030.9528
1050.5801-0.01730.0330.03241408.88356011.780677.5357-0.48120.8939
1060.6176-0.00360.02970.029265.30255351.060873.1509-0.10360.8061
1070.69150.0480.03160.031212412.40746057.195577.8281.42830.8683
1080.75470.02510.0310.03073189.19835796.468576.13450.7240.8552

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
98 & 0.1696 & 0.0241 & 0.0241 & 0.0244 & 2992.5257 & 0 & 0 & 0.7013 & 0.7013 \tabularnewline
99 & 0.2426 & 0.0113 & 0.0177 & 0.0179 & 618.7811 & 1805.6534 & 42.493 & 0.3189 & 0.5101 \tabularnewline
100 & 0.2948 & -0.0493 & 0.0282 & 0.028 & 10921.9424 & 4844.4164 & 69.6018 & -1.3398 & 0.7867 \tabularnewline
101 & 0.3735 & -0.0517 & 0.0341 & 0.0336 & 11243.3984 & 6444.1619 & 80.2755 & -1.3594 & 0.9299 \tabularnewline
102 & 0.4292 & -0.0449 & 0.0363 & 0.0356 & 8708.5297 & 6897.0355 & 83.0484 & -1.1964 & 0.9832 \tabularnewline
103 & 0.4706 & -0.0141 & 0.0326 & 0.032 & 942.9933 & 5904.6951 & 76.842 & -0.3937 & 0.8849 \tabularnewline
104 & 0.5366 & -0.0513 & 0.0352 & 0.0346 & 11257.1908 & 6669.3373 & 81.666 & -1.3603 & 0.9528 \tabularnewline
105 & 0.5801 & -0.0173 & 0.033 & 0.0324 & 1408.8835 & 6011.7806 & 77.5357 & -0.4812 & 0.8939 \tabularnewline
106 & 0.6176 & -0.0036 & 0.0297 & 0.0292 & 65.3025 & 5351.0608 & 73.1509 & -0.1036 & 0.8061 \tabularnewline
107 & 0.6915 & 0.048 & 0.0316 & 0.0312 & 12412.4074 & 6057.1955 & 77.828 & 1.4283 & 0.8683 \tabularnewline
108 & 0.7547 & 0.0251 & 0.031 & 0.0307 & 3189.1983 & 5796.4685 & 76.1345 & 0.724 & 0.8552 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=301834&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]98[/C][C]0.1696[/C][C]0.0241[/C][C]0.0241[/C][C]0.0244[/C][C]2992.5257[/C][C]0[/C][C]0[/C][C]0.7013[/C][C]0.7013[/C][/ROW]
[ROW][C]99[/C][C]0.2426[/C][C]0.0113[/C][C]0.0177[/C][C]0.0179[/C][C]618.7811[/C][C]1805.6534[/C][C]42.493[/C][C]0.3189[/C][C]0.5101[/C][/ROW]
[ROW][C]100[/C][C]0.2948[/C][C]-0.0493[/C][C]0.0282[/C][C]0.028[/C][C]10921.9424[/C][C]4844.4164[/C][C]69.6018[/C][C]-1.3398[/C][C]0.7867[/C][/ROW]
[ROW][C]101[/C][C]0.3735[/C][C]-0.0517[/C][C]0.0341[/C][C]0.0336[/C][C]11243.3984[/C][C]6444.1619[/C][C]80.2755[/C][C]-1.3594[/C][C]0.9299[/C][/ROW]
[ROW][C]102[/C][C]0.4292[/C][C]-0.0449[/C][C]0.0363[/C][C]0.0356[/C][C]8708.5297[/C][C]6897.0355[/C][C]83.0484[/C][C]-1.1964[/C][C]0.9832[/C][/ROW]
[ROW][C]103[/C][C]0.4706[/C][C]-0.0141[/C][C]0.0326[/C][C]0.032[/C][C]942.9933[/C][C]5904.6951[/C][C]76.842[/C][C]-0.3937[/C][C]0.8849[/C][/ROW]
[ROW][C]104[/C][C]0.5366[/C][C]-0.0513[/C][C]0.0352[/C][C]0.0346[/C][C]11257.1908[/C][C]6669.3373[/C][C]81.666[/C][C]-1.3603[/C][C]0.9528[/C][/ROW]
[ROW][C]105[/C][C]0.5801[/C][C]-0.0173[/C][C]0.033[/C][C]0.0324[/C][C]1408.8835[/C][C]6011.7806[/C][C]77.5357[/C][C]-0.4812[/C][C]0.8939[/C][/ROW]
[ROW][C]106[/C][C]0.6176[/C][C]-0.0036[/C][C]0.0297[/C][C]0.0292[/C][C]65.3025[/C][C]5351.0608[/C][C]73.1509[/C][C]-0.1036[/C][C]0.8061[/C][/ROW]
[ROW][C]107[/C][C]0.6915[/C][C]0.048[/C][C]0.0316[/C][C]0.0312[/C][C]12412.4074[/C][C]6057.1955[/C][C]77.828[/C][C]1.4283[/C][C]0.8683[/C][/ROW]
[ROW][C]108[/C][C]0.7547[/C][C]0.0251[/C][C]0.031[/C][C]0.0307[/C][C]3189.1983[/C][C]5796.4685[/C][C]76.1345[/C][C]0.724[/C][C]0.8552[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=301834&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=301834&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
980.16960.02410.02410.02442992.5257000.70130.7013
990.24260.01130.01770.0179618.78111805.653442.4930.31890.5101
1000.2948-0.04930.02820.02810921.94244844.416469.6018-1.33980.7867
1010.3735-0.05170.03410.033611243.39846444.161980.2755-1.35940.9299
1020.4292-0.04490.03630.03568708.52976897.035583.0484-1.19640.9832
1030.4706-0.01410.03260.032942.99335904.695176.842-0.39370.8849
1040.5366-0.05130.03520.034611257.19086669.337381.666-1.36030.9528
1050.5801-0.01730.0330.03241408.88356011.780677.5357-0.48120.8939
1060.6176-0.00360.02970.029265.30255351.060873.1509-0.10360.8061
1070.69150.0480.03160.031212412.40746057.195577.8281.42830.8683
1080.75470.02510.0310.03073189.19835796.468576.13450.7240.8552



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