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, 06 Sep 2017 09:43:22 +0200
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/Sep/06/t1504683957mvgfzxiao7mctjw.htm/, Retrieved Wed, 15 May 2024 10:27:43 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=307644, Retrieved Wed, 15 May 2024 10:27:43 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact57
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2017-09-06 07:43:22] [c6ea875f0603e0876d03f43aca979571] [Current]
Feedback Forum

Post a new message
Dataseries X:
3035
2552
2704
2554
2014
1655
1721
1524
1596
2074
2199
2512
2933
2889
2938
2497
1870
1726
1607
1545
1396
1787
2076
2837
2787
3891
3179
2011
1636
1580
1489
1300
1356
1653
2013
2823
3102
2294
2385
2444
1748
1554
1498
1361
1346
1564
1640
2293
2815
3137
2679
1969
1870
1633
1529
1366
1357
1570
1535
2491
3084
2605
2573
2143
1693
1504
1461
1354
1333
1492
1781
1915




Summary of computational transaction
Raw Input view raw input (R code)
Raw Outputview raw output of R engine
Computing time2 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 time2 seconds \tabularnewline
R ServerBig Analytics Cloud Computing Center \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=307644&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]2 seconds[/C][/ROW] [ROW]R Server[/C]Big Analytics Cloud Computing Center[/C][/ROW] [/TABLE] Source: https://freestatistics.org/blog/index.php?pk=307644&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=307644&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 time2 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[60])
591535-------
602491-------
6130843032.99652209.80364303.6610.46860.79840.79840.7984
6226053226.76181961.12135795.7320.31760.54340.54340.7127
6325733262.76341715.63937240.29880.3670.62710.62710.6481
6421433132.79161455.48328492.40130.35870.58110.58110.5928
6516932438.62271087.61917093.65470.37680.54950.54950.4912
6615042118.6803937.53816248.75060.38530.580.580.4299
6714611965.9428864.89435858.43180.39960.5920.5920.3957
6813541875.7513822.57785621.56590.39240.58590.58590.3738
6913331907.6344826.89625837.170.38720.60880.60880.3855
7014922120.6505889.57566888.60720.3980.62690.62690.4395
7117812320.0456937.04798091.98720.42740.61070.61070.4769
7219152488.8384964.84649400.90410.43540.57950.57950.4998

\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[60]) \tabularnewline
59 & 1535 & - & - & - & - & - & - & - \tabularnewline
60 & 2491 & - & - & - & - & - & - & - \tabularnewline
61 & 3084 & 3032.9965 & 2209.8036 & 4303.661 & 0.4686 & 0.7984 & 0.7984 & 0.7984 \tabularnewline
62 & 2605 & 3226.7618 & 1961.1213 & 5795.732 & 0.3176 & 0.5434 & 0.5434 & 0.7127 \tabularnewline
63 & 2573 & 3262.7634 & 1715.6393 & 7240.2988 & 0.367 & 0.6271 & 0.6271 & 0.6481 \tabularnewline
64 & 2143 & 3132.7916 & 1455.4832 & 8492.4013 & 0.3587 & 0.5811 & 0.5811 & 0.5928 \tabularnewline
65 & 1693 & 2438.6227 & 1087.6191 & 7093.6547 & 0.3768 & 0.5495 & 0.5495 & 0.4912 \tabularnewline
66 & 1504 & 2118.6803 & 937.5381 & 6248.7506 & 0.3853 & 0.58 & 0.58 & 0.4299 \tabularnewline
67 & 1461 & 1965.9428 & 864.8943 & 5858.4318 & 0.3996 & 0.592 & 0.592 & 0.3957 \tabularnewline
68 & 1354 & 1875.7513 & 822.5778 & 5621.5659 & 0.3924 & 0.5859 & 0.5859 & 0.3738 \tabularnewline
69 & 1333 & 1907.6344 & 826.8962 & 5837.17 & 0.3872 & 0.6088 & 0.6088 & 0.3855 \tabularnewline
70 & 1492 & 2120.6505 & 889.5756 & 6888.6072 & 0.398 & 0.6269 & 0.6269 & 0.4395 \tabularnewline
71 & 1781 & 2320.0456 & 937.0479 & 8091.9872 & 0.4274 & 0.6107 & 0.6107 & 0.4769 \tabularnewline
72 & 1915 & 2488.8384 & 964.8464 & 9400.9041 & 0.4354 & 0.5795 & 0.5795 & 0.4998 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=307644&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[60])[/C][/ROW]
[ROW][C]59[/C][C]1535[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]2491[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]3084[/C][C]3032.9965[/C][C]2209.8036[/C][C]4303.661[/C][C]0.4686[/C][C]0.7984[/C][C]0.7984[/C][C]0.7984[/C][/ROW]
[ROW][C]62[/C][C]2605[/C][C]3226.7618[/C][C]1961.1213[/C][C]5795.732[/C][C]0.3176[/C][C]0.5434[/C][C]0.5434[/C][C]0.7127[/C][/ROW]
[ROW][C]63[/C][C]2573[/C][C]3262.7634[/C][C]1715.6393[/C][C]7240.2988[/C][C]0.367[/C][C]0.6271[/C][C]0.6271[/C][C]0.6481[/C][/ROW]
[ROW][C]64[/C][C]2143[/C][C]3132.7916[/C][C]1455.4832[/C][C]8492.4013[/C][C]0.3587[/C][C]0.5811[/C][C]0.5811[/C][C]0.5928[/C][/ROW]
[ROW][C]65[/C][C]1693[/C][C]2438.6227[/C][C]1087.6191[/C][C]7093.6547[/C][C]0.3768[/C][C]0.5495[/C][C]0.5495[/C][C]0.4912[/C][/ROW]
[ROW][C]66[/C][C]1504[/C][C]2118.6803[/C][C]937.5381[/C][C]6248.7506[/C][C]0.3853[/C][C]0.58[/C][C]0.58[/C][C]0.4299[/C][/ROW]
[ROW][C]67[/C][C]1461[/C][C]1965.9428[/C][C]864.8943[/C][C]5858.4318[/C][C]0.3996[/C][C]0.592[/C][C]0.592[/C][C]0.3957[/C][/ROW]
[ROW][C]68[/C][C]1354[/C][C]1875.7513[/C][C]822.5778[/C][C]5621.5659[/C][C]0.3924[/C][C]0.5859[/C][C]0.5859[/C][C]0.3738[/C][/ROW]
[ROW][C]69[/C][C]1333[/C][C]1907.6344[/C][C]826.8962[/C][C]5837.17[/C][C]0.3872[/C][C]0.6088[/C][C]0.6088[/C][C]0.3855[/C][/ROW]
[ROW][C]70[/C][C]1492[/C][C]2120.6505[/C][C]889.5756[/C][C]6888.6072[/C][C]0.398[/C][C]0.6269[/C][C]0.6269[/C][C]0.4395[/C][/ROW]
[ROW][C]71[/C][C]1781[/C][C]2320.0456[/C][C]937.0479[/C][C]8091.9872[/C][C]0.4274[/C][C]0.6107[/C][C]0.6107[/C][C]0.4769[/C][/ROW]
[ROW][C]72[/C][C]1915[/C][C]2488.8384[/C][C]964.8464[/C][C]9400.9041[/C][C]0.4354[/C][C]0.5795[/C][C]0.5795[/C][C]0.4998[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=307644&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=307644&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[60])
591535-------
602491-------
6130843032.99652209.80364303.6610.46860.79840.79840.7984
6226053226.76181961.12135795.7320.31760.54340.54340.7127
6325733262.76341715.63937240.29880.3670.62710.62710.6481
6421433132.79161455.48328492.40130.35870.58110.58110.5928
6516932438.62271087.61917093.65470.37680.54950.54950.4912
6615042118.6803937.53816248.75060.38530.580.580.4299
6714611965.9428864.89435858.43180.39960.5920.5920.3957
6813541875.7513822.57785621.56590.39240.58590.58590.3738
6913331907.6344826.89625837.170.38720.60880.60880.3855
7014922120.6505889.57566888.60720.3980.62690.62690.4395
7117812320.0456937.04798091.98720.42740.61070.61070.4769
7219152488.8384964.84649400.90410.43540.57950.57950.4998







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
610.21370.01650.01650.01672601.3542000.24050.2405
620.4062-0.23870.12760.115386587.765194594.5596441.1287-2.93161.586
630.622-0.26810.17440.1554475773.5118288320.877536.9552-3.25222.1414
640.8729-0.46190.24630.2104979687.4682461162.5248679.0895-4.66682.7728
650.9739-0.44040.28510.2405555953.2463480120.6691692.9074-3.51562.9213
660.9946-0.40870.30570.257377831.9258463072.5452680.4943-2.89822.9175
671.0102-0.34560.31140.2624254967.2133433343.2121658.2881-2.38082.8408
681.0189-0.38530.32070.2699272224.3876413203.359642.809-2.462.7932
691.051-0.43110.33290.2794330204.7392403981.2902635.5952-2.70942.7839
701.1471-0.42130.34180.2862395201.4073403103.3019634.9042-2.96412.8019
711.2693-0.30270.33820.2841290570.1073392873.0115626.7958-2.54162.7782
721.417-0.29970.3350.2821329290.4626387574.4657622.5548-2.70562.7722

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
61 & 0.2137 & 0.0165 & 0.0165 & 0.0167 & 2601.3542 & 0 & 0 & 0.2405 & 0.2405 \tabularnewline
62 & 0.4062 & -0.2387 & 0.1276 & 0.115 & 386587.765 & 194594.5596 & 441.1287 & -2.9316 & 1.586 \tabularnewline
63 & 0.622 & -0.2681 & 0.1744 & 0.1554 & 475773.5118 & 288320.877 & 536.9552 & -3.2522 & 2.1414 \tabularnewline
64 & 0.8729 & -0.4619 & 0.2463 & 0.2104 & 979687.4682 & 461162.5248 & 679.0895 & -4.6668 & 2.7728 \tabularnewline
65 & 0.9739 & -0.4404 & 0.2851 & 0.2405 & 555953.2463 & 480120.6691 & 692.9074 & -3.5156 & 2.9213 \tabularnewline
66 & 0.9946 & -0.4087 & 0.3057 & 0.257 & 377831.9258 & 463072.5452 & 680.4943 & -2.8982 & 2.9175 \tabularnewline
67 & 1.0102 & -0.3456 & 0.3114 & 0.2624 & 254967.2133 & 433343.2121 & 658.2881 & -2.3808 & 2.8408 \tabularnewline
68 & 1.0189 & -0.3853 & 0.3207 & 0.2699 & 272224.3876 & 413203.359 & 642.809 & -2.46 & 2.7932 \tabularnewline
69 & 1.051 & -0.4311 & 0.3329 & 0.2794 & 330204.7392 & 403981.2902 & 635.5952 & -2.7094 & 2.7839 \tabularnewline
70 & 1.1471 & -0.4213 & 0.3418 & 0.2862 & 395201.4073 & 403103.3019 & 634.9042 & -2.9641 & 2.8019 \tabularnewline
71 & 1.2693 & -0.3027 & 0.3382 & 0.2841 & 290570.1073 & 392873.0115 & 626.7958 & -2.5416 & 2.7782 \tabularnewline
72 & 1.417 & -0.2997 & 0.335 & 0.2821 & 329290.4626 & 387574.4657 & 622.5548 & -2.7056 & 2.7722 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=307644&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]61[/C][C]0.2137[/C][C]0.0165[/C][C]0.0165[/C][C]0.0167[/C][C]2601.3542[/C][C]0[/C][C]0[/C][C]0.2405[/C][C]0.2405[/C][/ROW]
[ROW][C]62[/C][C]0.4062[/C][C]-0.2387[/C][C]0.1276[/C][C]0.115[/C][C]386587.765[/C][C]194594.5596[/C][C]441.1287[/C][C]-2.9316[/C][C]1.586[/C][/ROW]
[ROW][C]63[/C][C]0.622[/C][C]-0.2681[/C][C]0.1744[/C][C]0.1554[/C][C]475773.5118[/C][C]288320.877[/C][C]536.9552[/C][C]-3.2522[/C][C]2.1414[/C][/ROW]
[ROW][C]64[/C][C]0.8729[/C][C]-0.4619[/C][C]0.2463[/C][C]0.2104[/C][C]979687.4682[/C][C]461162.5248[/C][C]679.0895[/C][C]-4.6668[/C][C]2.7728[/C][/ROW]
[ROW][C]65[/C][C]0.9739[/C][C]-0.4404[/C][C]0.2851[/C][C]0.2405[/C][C]555953.2463[/C][C]480120.6691[/C][C]692.9074[/C][C]-3.5156[/C][C]2.9213[/C][/ROW]
[ROW][C]66[/C][C]0.9946[/C][C]-0.4087[/C][C]0.3057[/C][C]0.257[/C][C]377831.9258[/C][C]463072.5452[/C][C]680.4943[/C][C]-2.8982[/C][C]2.9175[/C][/ROW]
[ROW][C]67[/C][C]1.0102[/C][C]-0.3456[/C][C]0.3114[/C][C]0.2624[/C][C]254967.2133[/C][C]433343.2121[/C][C]658.2881[/C][C]-2.3808[/C][C]2.8408[/C][/ROW]
[ROW][C]68[/C][C]1.0189[/C][C]-0.3853[/C][C]0.3207[/C][C]0.2699[/C][C]272224.3876[/C][C]413203.359[/C][C]642.809[/C][C]-2.46[/C][C]2.7932[/C][/ROW]
[ROW][C]69[/C][C]1.051[/C][C]-0.4311[/C][C]0.3329[/C][C]0.2794[/C][C]330204.7392[/C][C]403981.2902[/C][C]635.5952[/C][C]-2.7094[/C][C]2.7839[/C][/ROW]
[ROW][C]70[/C][C]1.1471[/C][C]-0.4213[/C][C]0.3418[/C][C]0.2862[/C][C]395201.4073[/C][C]403103.3019[/C][C]634.9042[/C][C]-2.9641[/C][C]2.8019[/C][/ROW]
[ROW][C]71[/C][C]1.2693[/C][C]-0.3027[/C][C]0.3382[/C][C]0.2841[/C][C]290570.1073[/C][C]392873.0115[/C][C]626.7958[/C][C]-2.5416[/C][C]2.7782[/C][/ROW]
[ROW][C]72[/C][C]1.417[/C][C]-0.2997[/C][C]0.335[/C][C]0.2821[/C][C]329290.4626[/C][C]387574.4657[/C][C]622.5548[/C][C]-2.7056[/C][C]2.7722[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=307644&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=307644&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
610.21370.01650.01650.01672601.3542000.24050.2405
620.4062-0.23870.12760.115386587.765194594.5596441.1287-2.93161.586
630.622-0.26810.17440.1554475773.5118288320.877536.9552-3.25222.1414
640.8729-0.46190.24630.2104979687.4682461162.5248679.0895-4.66682.7728
650.9739-0.44040.28510.2405555953.2463480120.6691692.9074-3.51562.9213
660.9946-0.40870.30570.257377831.9258463072.5452680.4943-2.89822.9175
671.0102-0.34560.31140.2624254967.2133433343.2121658.2881-2.38082.8408
681.0189-0.38530.32070.2699272224.3876413203.359642.809-2.462.7932
691.051-0.43110.33290.2794330204.7392403981.2902635.5952-2.70942.7839
701.1471-0.42130.34180.2862395201.4073403103.3019634.9042-2.96412.8019
711.2693-0.30270.33820.2841290570.1073392873.0115626.7958-2.54162.7782
721.417-0.29970.3350.2821329290.4626387574.4657622.5548-2.70562.7722



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