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, 24 Jan 2017 18:40:52 +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/2017/Jan/24/t1485280044k7kxbu84mqz9axa.htm/, Retrieved Mon, 13 May 2024 22:29:27 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=305233, Retrieved Mon, 13 May 2024 22:29:27 +0000
QR Codes:

Original text written by user:test
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact53
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [mmaa] [2017-01-24 17:40:52] [2afcbc313e2a613e91c73c4ef04af8e0] [Current]
Feedback Forum

Post a new message
Dataseries X:
1.894
1.757
3.582
5.321
5.561
5.907
4.944
4.966
3.258
1.964
1.743
1.262
2.086
1.793
3.548
5.672
6.084
4.914
4.990
5.139
3.218
2.179
2.238
1.442
2.205
2.025
3.531
4.977
7.998
4.880
5.231
5.202
3.303
2.683
2.202
1.376
2.422
1.997
3.163
5.964
5.657
6.415
6.208
4.500
2.939
2.702
2.090
1.504
2.549
1.931
3.013
6.204
5.788
5.611
5.594
4.647
3.490
2.487
1.992
1.507
2.306
2.002
3.075
5.331
5.589
5.813
4.876
4.665
3.601
2.192
2.111
1.580
2.288
1.993
3.228
5.000
5.480
5.770
4.962
4.685
3.607
2.222
2.467
1.594
2.228
1.910
3.157
4.809
6.249
4.607
4.975
4.784
3.028
2.461
2.218
1.351
2.070
1.887
3.024
4.596
6.398
4.459
5.382
4.359
2.687
2.249
2.154
1.169
2.429
1.762
2.846
5.627
5.749
4.502
5.720
4.403
2.867
2.635
2.059
1.511
2.359
1.741
2.917
6.249
5.760
6.250
5.134
4.831
3.695
2.462
2.146
1.579




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=305233&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[120])
1192.059-------
1201.511-------
1212.3591.54670.94492.75860.09450.5230.5230.523
1221.7411.37660.70013.21810.34910.14790.14790.4431
1232.9171.50170.61475.10680.22080.44830.44830.498
1246.2491.39450.49866.21970.02430.26810.26810.4811
1255.761.54790.469310.11140.16750.1410.1410.5034
1266.251.45080.400512.14580.18960.21480.21480.4956
1275.1341.61930.389120.62370.35850.31650.31650.5045
1284.8311.51990.341624.36370.38820.37820.37820.5003
1293.6951.70040.337744.37380.46350.44280.44280.5035
1302.4621.59510.301751.78560.48650.46730.46730.5013
1312.1461.78730.3015105.22720.49730.49490.49490.5021
1321.5791.67480.2727121.92070.49940.49690.49690.5011

\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[120]) \tabularnewline
119 & 2.059 & - & - & - & - & - & - & - \tabularnewline
120 & 1.511 & - & - & - & - & - & - & - \tabularnewline
121 & 2.359 & 1.5467 & 0.9449 & 2.7586 & 0.0945 & 0.523 & 0.523 & 0.523 \tabularnewline
122 & 1.741 & 1.3766 & 0.7001 & 3.2181 & 0.3491 & 0.1479 & 0.1479 & 0.4431 \tabularnewline
123 & 2.917 & 1.5017 & 0.6147 & 5.1068 & 0.2208 & 0.4483 & 0.4483 & 0.498 \tabularnewline
124 & 6.249 & 1.3945 & 0.4986 & 6.2197 & 0.0243 & 0.2681 & 0.2681 & 0.4811 \tabularnewline
125 & 5.76 & 1.5479 & 0.4693 & 10.1114 & 0.1675 & 0.141 & 0.141 & 0.5034 \tabularnewline
126 & 6.25 & 1.4508 & 0.4005 & 12.1458 & 0.1896 & 0.2148 & 0.2148 & 0.4956 \tabularnewline
127 & 5.134 & 1.6193 & 0.3891 & 20.6237 & 0.3585 & 0.3165 & 0.3165 & 0.5045 \tabularnewline
128 & 4.831 & 1.5199 & 0.3416 & 24.3637 & 0.3882 & 0.3782 & 0.3782 & 0.5003 \tabularnewline
129 & 3.695 & 1.7004 & 0.3377 & 44.3738 & 0.4635 & 0.4428 & 0.4428 & 0.5035 \tabularnewline
130 & 2.462 & 1.5951 & 0.3017 & 51.7856 & 0.4865 & 0.4673 & 0.4673 & 0.5013 \tabularnewline
131 & 2.146 & 1.7873 & 0.3015 & 105.2272 & 0.4973 & 0.4949 & 0.4949 & 0.5021 \tabularnewline
132 & 1.579 & 1.6748 & 0.2727 & 121.9207 & 0.4994 & 0.4969 & 0.4969 & 0.5011 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=305233&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[120])[/C][/ROW]
[ROW][C]119[/C][C]2.059[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]1.511[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]2.359[/C][C]1.5467[/C][C]0.9449[/C][C]2.7586[/C][C]0.0945[/C][C]0.523[/C][C]0.523[/C][C]0.523[/C][/ROW]
[ROW][C]122[/C][C]1.741[/C][C]1.3766[/C][C]0.7001[/C][C]3.2181[/C][C]0.3491[/C][C]0.1479[/C][C]0.1479[/C][C]0.4431[/C][/ROW]
[ROW][C]123[/C][C]2.917[/C][C]1.5017[/C][C]0.6147[/C][C]5.1068[/C][C]0.2208[/C][C]0.4483[/C][C]0.4483[/C][C]0.498[/C][/ROW]
[ROW][C]124[/C][C]6.249[/C][C]1.3945[/C][C]0.4986[/C][C]6.2197[/C][C]0.0243[/C][C]0.2681[/C][C]0.2681[/C][C]0.4811[/C][/ROW]
[ROW][C]125[/C][C]5.76[/C][C]1.5479[/C][C]0.4693[/C][C]10.1114[/C][C]0.1675[/C][C]0.141[/C][C]0.141[/C][C]0.5034[/C][/ROW]
[ROW][C]126[/C][C]6.25[/C][C]1.4508[/C][C]0.4005[/C][C]12.1458[/C][C]0.1896[/C][C]0.2148[/C][C]0.2148[/C][C]0.4956[/C][/ROW]
[ROW][C]127[/C][C]5.134[/C][C]1.6193[/C][C]0.3891[/C][C]20.6237[/C][C]0.3585[/C][C]0.3165[/C][C]0.3165[/C][C]0.5045[/C][/ROW]
[ROW][C]128[/C][C]4.831[/C][C]1.5199[/C][C]0.3416[/C][C]24.3637[/C][C]0.3882[/C][C]0.3782[/C][C]0.3782[/C][C]0.5003[/C][/ROW]
[ROW][C]129[/C][C]3.695[/C][C]1.7004[/C][C]0.3377[/C][C]44.3738[/C][C]0.4635[/C][C]0.4428[/C][C]0.4428[/C][C]0.5035[/C][/ROW]
[ROW][C]130[/C][C]2.462[/C][C]1.5951[/C][C]0.3017[/C][C]51.7856[/C][C]0.4865[/C][C]0.4673[/C][C]0.4673[/C][C]0.5013[/C][/ROW]
[ROW][C]131[/C][C]2.146[/C][C]1.7873[/C][C]0.3015[/C][C]105.2272[/C][C]0.4973[/C][C]0.4949[/C][C]0.4949[/C][C]0.5021[/C][/ROW]
[ROW][C]132[/C][C]1.579[/C][C]1.6748[/C][C]0.2727[/C][C]121.9207[/C][C]0.4994[/C][C]0.4969[/C][C]0.4969[/C][C]0.5011[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=305233&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=305233&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[120])
1192.059-------
1201.511-------
1212.3591.54670.94492.75860.09450.5230.5230.523
1221.7411.37660.70013.21810.34910.14790.14790.4431
1232.9171.50170.61475.10680.22080.44830.44830.498
1246.2491.39450.49866.21970.02430.26810.26810.4811
1255.761.54790.469310.11140.16750.1410.1410.5034
1266.251.45080.400512.14580.18960.21480.21480.4956
1275.1341.61930.389120.62370.35850.31650.31650.5045
1284.8311.51990.341624.36370.38820.37820.37820.5003
1293.6951.70040.337744.37380.46350.44280.44280.5035
1302.4621.59510.301751.78560.48650.46730.46730.5013
1312.1461.78730.3015105.22720.49730.49490.49490.5021
1321.5791.67480.2727121.92070.49940.49690.49690.5011







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
1210.39980.34430.34430.41590.6598000.82910.8291
1220.68250.20930.27680.32490.13280.39630.62950.3720.6006
1231.22480.48520.34630.43012.0030.93180.96531.44470.8819
1241.76550.77690.45390.640123.56666.59052.56724.95551.9003
1252.82270.73130.50940.742717.74198.82082.974.29972.3802
1263.7610.76790.55250.826623.031911.18933.3454.89892.8
1275.98780.68460.57130.857212.35311.35563.36983.58772.9125
1287.66810.68540.58560.880410.963111.30653.36253.37992.9709
12912.80390.53980.58050.86473.978310.49233.23922.0362.8671
13016.05340.35210.55770.8210.75159.51823.08520.88492.6688
13129.52750.16710.52220.76290.12868.66462.94360.36612.4595
13236.6311-0.06070.48370.70430.00927.94332.8184-0.09782.2627

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
121 & 0.3998 & 0.3443 & 0.3443 & 0.4159 & 0.6598 & 0 & 0 & 0.8291 & 0.8291 \tabularnewline
122 & 0.6825 & 0.2093 & 0.2768 & 0.3249 & 0.1328 & 0.3963 & 0.6295 & 0.372 & 0.6006 \tabularnewline
123 & 1.2248 & 0.4852 & 0.3463 & 0.4301 & 2.003 & 0.9318 & 0.9653 & 1.4447 & 0.8819 \tabularnewline
124 & 1.7655 & 0.7769 & 0.4539 & 0.6401 & 23.5666 & 6.5905 & 2.5672 & 4.9555 & 1.9003 \tabularnewline
125 & 2.8227 & 0.7313 & 0.5094 & 0.7427 & 17.7419 & 8.8208 & 2.97 & 4.2997 & 2.3802 \tabularnewline
126 & 3.761 & 0.7679 & 0.5525 & 0.8266 & 23.0319 & 11.1893 & 3.345 & 4.8989 & 2.8 \tabularnewline
127 & 5.9878 & 0.6846 & 0.5713 & 0.8572 & 12.353 & 11.3556 & 3.3698 & 3.5877 & 2.9125 \tabularnewline
128 & 7.6681 & 0.6854 & 0.5856 & 0.8804 & 10.9631 & 11.3065 & 3.3625 & 3.3799 & 2.9709 \tabularnewline
129 & 12.8039 & 0.5398 & 0.5805 & 0.8647 & 3.9783 & 10.4923 & 3.2392 & 2.036 & 2.8671 \tabularnewline
130 & 16.0534 & 0.3521 & 0.5577 & 0.821 & 0.7515 & 9.5182 & 3.0852 & 0.8849 & 2.6688 \tabularnewline
131 & 29.5275 & 0.1671 & 0.5222 & 0.7629 & 0.1286 & 8.6646 & 2.9436 & 0.3661 & 2.4595 \tabularnewline
132 & 36.6311 & -0.0607 & 0.4837 & 0.7043 & 0.0092 & 7.9433 & 2.8184 & -0.0978 & 2.2627 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=305233&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]121[/C][C]0.3998[/C][C]0.3443[/C][C]0.3443[/C][C]0.4159[/C][C]0.6598[/C][C]0[/C][C]0[/C][C]0.8291[/C][C]0.8291[/C][/ROW]
[ROW][C]122[/C][C]0.6825[/C][C]0.2093[/C][C]0.2768[/C][C]0.3249[/C][C]0.1328[/C][C]0.3963[/C][C]0.6295[/C][C]0.372[/C][C]0.6006[/C][/ROW]
[ROW][C]123[/C][C]1.2248[/C][C]0.4852[/C][C]0.3463[/C][C]0.4301[/C][C]2.003[/C][C]0.9318[/C][C]0.9653[/C][C]1.4447[/C][C]0.8819[/C][/ROW]
[ROW][C]124[/C][C]1.7655[/C][C]0.7769[/C][C]0.4539[/C][C]0.6401[/C][C]23.5666[/C][C]6.5905[/C][C]2.5672[/C][C]4.9555[/C][C]1.9003[/C][/ROW]
[ROW][C]125[/C][C]2.8227[/C][C]0.7313[/C][C]0.5094[/C][C]0.7427[/C][C]17.7419[/C][C]8.8208[/C][C]2.97[/C][C]4.2997[/C][C]2.3802[/C][/ROW]
[ROW][C]126[/C][C]3.761[/C][C]0.7679[/C][C]0.5525[/C][C]0.8266[/C][C]23.0319[/C][C]11.1893[/C][C]3.345[/C][C]4.8989[/C][C]2.8[/C][/ROW]
[ROW][C]127[/C][C]5.9878[/C][C]0.6846[/C][C]0.5713[/C][C]0.8572[/C][C]12.353[/C][C]11.3556[/C][C]3.3698[/C][C]3.5877[/C][C]2.9125[/C][/ROW]
[ROW][C]128[/C][C]7.6681[/C][C]0.6854[/C][C]0.5856[/C][C]0.8804[/C][C]10.9631[/C][C]11.3065[/C][C]3.3625[/C][C]3.3799[/C][C]2.9709[/C][/ROW]
[ROW][C]129[/C][C]12.8039[/C][C]0.5398[/C][C]0.5805[/C][C]0.8647[/C][C]3.9783[/C][C]10.4923[/C][C]3.2392[/C][C]2.036[/C][C]2.8671[/C][/ROW]
[ROW][C]130[/C][C]16.0534[/C][C]0.3521[/C][C]0.5577[/C][C]0.821[/C][C]0.7515[/C][C]9.5182[/C][C]3.0852[/C][C]0.8849[/C][C]2.6688[/C][/ROW]
[ROW][C]131[/C][C]29.5275[/C][C]0.1671[/C][C]0.5222[/C][C]0.7629[/C][C]0.1286[/C][C]8.6646[/C][C]2.9436[/C][C]0.3661[/C][C]2.4595[/C][/ROW]
[ROW][C]132[/C][C]36.6311[/C][C]-0.0607[/C][C]0.4837[/C][C]0.7043[/C][C]0.0092[/C][C]7.9433[/C][C]2.8184[/C][C]-0.0978[/C][C]2.2627[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=305233&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=305233&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
1210.39980.34430.34430.41590.6598000.82910.8291
1220.68250.20930.27680.32490.13280.39630.62950.3720.6006
1231.22480.48520.34630.43012.0030.93180.96531.44470.8819
1241.76550.77690.45390.640123.56666.59052.56724.95551.9003
1252.82270.73130.50940.742717.74198.82082.974.29972.3802
1263.7610.76790.55250.826623.031911.18933.3454.89892.8
1275.98780.68460.57130.857212.35311.35563.36983.58772.9125
1287.66810.68540.58560.880410.963111.30653.36253.37992.9709
12912.80390.53980.58050.86473.978310.49233.23922.0362.8671
13016.05340.35210.55770.8210.75159.51823.08520.88492.6688
13129.52750.16710.52220.76290.12868.66462.94360.36612.4595
13236.6311-0.06070.48370.70430.00927.94332.8184-0.09782.2627



Parameters (Session):
Parameters (R input):
par1 = 12 ; par2 = -0.3 ; par3 = 0 ; par4 = 0 ; par5 = 1 ; par6 = 3 ; par7 = 0 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '0'
par8 <- '0'
par7 <- '0'
par6 <- '0'
par5 <- '1'
par4 <- '0'
par3 <- '0'
par2 <- '1'
par1 <- '12'
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')