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, 22 Jan 2016 09:49:38 +0000
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/Jan/22/t1453456186opse35bo9orc7ck.htm/, Retrieved Tue, 07 May 2024 14:50:00 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=291096, Retrieved Tue, 07 May 2024 14:50:00 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact46
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [dddd] [2016-01-22 09:49:38] [b81b5ed792fcd00ac06f170ec6857f3b] [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 Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.wessa.net

\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 & 1 seconds \tabularnewline
R Server & 'Sir Ronald Aylmer Fisher' @ fisher.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=291096&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]1 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Sir Ronald Aylmer Fisher' @ fisher.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=291096&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=291096&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 time1 seconds
R Server'Sir Ronald Aylmer Fisher' @ fisher.wessa.net







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-------
6130842774.69651967.22923582.16380.22640.75450.75450.7545
6226052807.59151487.72714127.45590.38180.34070.34070.6809
6325732810.67271110.66664510.67880.3920.59370.59370.6438
6421432810.9345800.08894821.78010.25750.59170.59170.6224
6516932810.9555531.16455090.74660.16820.71710.71710.6084
6615042810.9572290.75245331.16190.15470.80770.80770.5983
6714612810.957371.35525550.55940.16710.82510.82510.5905
6813542810.9573-131.72995753.64440.16590.81570.81570.5844
6913332810.9573-321.67675943.59130.17760.8190.8190.5793
7014922810.9573-500.74676122.66130.21750.80910.80910.5751
7117812810.9573-670.61876292.53330.2810.77110.77110.5715
7219152810.9573-832.57946454.49390.31490.71020.71020.5683

\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 & 2774.6965 & 1967.2292 & 3582.1638 & 0.2264 & 0.7545 & 0.7545 & 0.7545 \tabularnewline
62 & 2605 & 2807.5915 & 1487.7271 & 4127.4559 & 0.3818 & 0.3407 & 0.3407 & 0.6809 \tabularnewline
63 & 2573 & 2810.6727 & 1110.6666 & 4510.6788 & 0.392 & 0.5937 & 0.5937 & 0.6438 \tabularnewline
64 & 2143 & 2810.9345 & 800.0889 & 4821.7801 & 0.2575 & 0.5917 & 0.5917 & 0.6224 \tabularnewline
65 & 1693 & 2810.9555 & 531.1645 & 5090.7466 & 0.1682 & 0.7171 & 0.7171 & 0.6084 \tabularnewline
66 & 1504 & 2810.9572 & 290.7524 & 5331.1619 & 0.1547 & 0.8077 & 0.8077 & 0.5983 \tabularnewline
67 & 1461 & 2810.9573 & 71.3552 & 5550.5594 & 0.1671 & 0.8251 & 0.8251 & 0.5905 \tabularnewline
68 & 1354 & 2810.9573 & -131.7299 & 5753.6444 & 0.1659 & 0.8157 & 0.8157 & 0.5844 \tabularnewline
69 & 1333 & 2810.9573 & -321.6767 & 5943.5913 & 0.1776 & 0.819 & 0.819 & 0.5793 \tabularnewline
70 & 1492 & 2810.9573 & -500.7467 & 6122.6613 & 0.2175 & 0.8091 & 0.8091 & 0.5751 \tabularnewline
71 & 1781 & 2810.9573 & -670.6187 & 6292.5333 & 0.281 & 0.7711 & 0.7711 & 0.5715 \tabularnewline
72 & 1915 & 2810.9573 & -832.5794 & 6454.4939 & 0.3149 & 0.7102 & 0.7102 & 0.5683 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=291096&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]2774.6965[/C][C]1967.2292[/C][C]3582.1638[/C][C]0.2264[/C][C]0.7545[/C][C]0.7545[/C][C]0.7545[/C][/ROW]
[ROW][C]62[/C][C]2605[/C][C]2807.5915[/C][C]1487.7271[/C][C]4127.4559[/C][C]0.3818[/C][C]0.3407[/C][C]0.3407[/C][C]0.6809[/C][/ROW]
[ROW][C]63[/C][C]2573[/C][C]2810.6727[/C][C]1110.6666[/C][C]4510.6788[/C][C]0.392[/C][C]0.5937[/C][C]0.5937[/C][C]0.6438[/C][/ROW]
[ROW][C]64[/C][C]2143[/C][C]2810.9345[/C][C]800.0889[/C][C]4821.7801[/C][C]0.2575[/C][C]0.5917[/C][C]0.5917[/C][C]0.6224[/C][/ROW]
[ROW][C]65[/C][C]1693[/C][C]2810.9555[/C][C]531.1645[/C][C]5090.7466[/C][C]0.1682[/C][C]0.7171[/C][C]0.7171[/C][C]0.6084[/C][/ROW]
[ROW][C]66[/C][C]1504[/C][C]2810.9572[/C][C]290.7524[/C][C]5331.1619[/C][C]0.1547[/C][C]0.8077[/C][C]0.8077[/C][C]0.5983[/C][/ROW]
[ROW][C]67[/C][C]1461[/C][C]2810.9573[/C][C]71.3552[/C][C]5550.5594[/C][C]0.1671[/C][C]0.8251[/C][C]0.8251[/C][C]0.5905[/C][/ROW]
[ROW][C]68[/C][C]1354[/C][C]2810.9573[/C][C]-131.7299[/C][C]5753.6444[/C][C]0.1659[/C][C]0.8157[/C][C]0.8157[/C][C]0.5844[/C][/ROW]
[ROW][C]69[/C][C]1333[/C][C]2810.9573[/C][C]-321.6767[/C][C]5943.5913[/C][C]0.1776[/C][C]0.819[/C][C]0.819[/C][C]0.5793[/C][/ROW]
[ROW][C]70[/C][C]1492[/C][C]2810.9573[/C][C]-500.7467[/C][C]6122.6613[/C][C]0.2175[/C][C]0.8091[/C][C]0.8091[/C][C]0.5751[/C][/ROW]
[ROW][C]71[/C][C]1781[/C][C]2810.9573[/C][C]-670.6187[/C][C]6292.5333[/C][C]0.281[/C][C]0.7711[/C][C]0.7711[/C][C]0.5715[/C][/ROW]
[ROW][C]72[/C][C]1915[/C][C]2810.9573[/C][C]-832.5794[/C][C]6454.4939[/C][C]0.3149[/C][C]0.7102[/C][C]0.7102[/C][C]0.5683[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=291096&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=291096&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-------
6130842774.69651967.22923582.16380.22640.75450.75450.7545
6226052807.59151487.72714127.45590.38180.34070.34070.6809
6325732810.67271110.66664510.67880.3920.59370.59370.6438
6421432810.9345800.08894821.78010.25750.59170.59170.6224
6516932810.9555531.16455090.74660.16820.71710.71710.6084
6615042810.9572290.75245331.16190.15470.80770.80770.5983
6714612810.957371.35525550.55940.16710.82510.82510.5905
6813542810.9573-131.72995753.64440.16590.81570.81570.5844
6913332810.9573-321.67675943.59130.17760.8190.8190.5793
7014922810.9573-500.74676122.66130.21750.80910.80910.5751
7117812810.9573-670.61876292.53330.2810.77110.77110.5715
7219152810.9573-832.57946454.49390.31490.71020.71020.5683







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
610.14850.10030.10030.105695668.6709001.45841.4584
620.2398-0.07780.0890.090241043.304568355.9877261.4498-0.95521.2068
630.3086-0.09240.09010.089656488.309964400.0951253.7717-1.12061.1781
640.365-0.31170.14550.1346446136.4964159834.1954399.7927-3.14931.6709
650.4138-0.66030.24850.2071249824.5702377832.2704614.6806-5.27112.3909
660.4574-0.8690.35190.27341708137.0189599549.7285774.306-6.16223.0195
670.4973-0.9240.43360.32471822384.6667774240.4339879.9093-6.3653.4974
680.5341-1.0760.51390.37152122724.5519942800.9487970.9794-6.86953.9189
690.5686-1.10870.580.40952184357.76011080751.70551039.5921-6.96854.2578
700.6011-0.8840.61040.42991739648.3411146641.36911070.8134-6.21884.4539
710.6319-0.57830.60750.43161060812.02561138838.70151067.1639-4.85624.4904
720.6613-0.46790.59590.4272802739.47111110830.43231053.9594-4.22444.4683

\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.1485 & 0.1003 & 0.1003 & 0.1056 & 95668.6709 & 0 & 0 & 1.4584 & 1.4584 \tabularnewline
62 & 0.2398 & -0.0778 & 0.089 & 0.0902 & 41043.3045 & 68355.9877 & 261.4498 & -0.9552 & 1.2068 \tabularnewline
63 & 0.3086 & -0.0924 & 0.0901 & 0.0896 & 56488.3099 & 64400.0951 & 253.7717 & -1.1206 & 1.1781 \tabularnewline
64 & 0.365 & -0.3117 & 0.1455 & 0.1346 & 446136.4964 & 159834.1954 & 399.7927 & -3.1493 & 1.6709 \tabularnewline
65 & 0.4138 & -0.6603 & 0.2485 & 0.207 & 1249824.5702 & 377832.2704 & 614.6806 & -5.2711 & 2.3909 \tabularnewline
66 & 0.4574 & -0.869 & 0.3519 & 0.2734 & 1708137.0189 & 599549.7285 & 774.306 & -6.1622 & 3.0195 \tabularnewline
67 & 0.4973 & -0.924 & 0.4336 & 0.3247 & 1822384.6667 & 774240.4339 & 879.9093 & -6.365 & 3.4974 \tabularnewline
68 & 0.5341 & -1.076 & 0.5139 & 0.3715 & 2122724.5519 & 942800.9487 & 970.9794 & -6.8695 & 3.9189 \tabularnewline
69 & 0.5686 & -1.1087 & 0.58 & 0.4095 & 2184357.7601 & 1080751.7055 & 1039.5921 & -6.9685 & 4.2578 \tabularnewline
70 & 0.6011 & -0.884 & 0.6104 & 0.4299 & 1739648.341 & 1146641.3691 & 1070.8134 & -6.2188 & 4.4539 \tabularnewline
71 & 0.6319 & -0.5783 & 0.6075 & 0.4316 & 1060812.0256 & 1138838.7015 & 1067.1639 & -4.8562 & 4.4904 \tabularnewline
72 & 0.6613 & -0.4679 & 0.5959 & 0.4272 & 802739.4711 & 1110830.4323 & 1053.9594 & -4.2244 & 4.4683 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=291096&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.1485[/C][C]0.1003[/C][C]0.1003[/C][C]0.1056[/C][C]95668.6709[/C][C]0[/C][C]0[/C][C]1.4584[/C][C]1.4584[/C][/ROW]
[ROW][C]62[/C][C]0.2398[/C][C]-0.0778[/C][C]0.089[/C][C]0.0902[/C][C]41043.3045[/C][C]68355.9877[/C][C]261.4498[/C][C]-0.9552[/C][C]1.2068[/C][/ROW]
[ROW][C]63[/C][C]0.3086[/C][C]-0.0924[/C][C]0.0901[/C][C]0.0896[/C][C]56488.3099[/C][C]64400.0951[/C][C]253.7717[/C][C]-1.1206[/C][C]1.1781[/C][/ROW]
[ROW][C]64[/C][C]0.365[/C][C]-0.3117[/C][C]0.1455[/C][C]0.1346[/C][C]446136.4964[/C][C]159834.1954[/C][C]399.7927[/C][C]-3.1493[/C][C]1.6709[/C][/ROW]
[ROW][C]65[/C][C]0.4138[/C][C]-0.6603[/C][C]0.2485[/C][C]0.207[/C][C]1249824.5702[/C][C]377832.2704[/C][C]614.6806[/C][C]-5.2711[/C][C]2.3909[/C][/ROW]
[ROW][C]66[/C][C]0.4574[/C][C]-0.869[/C][C]0.3519[/C][C]0.2734[/C][C]1708137.0189[/C][C]599549.7285[/C][C]774.306[/C][C]-6.1622[/C][C]3.0195[/C][/ROW]
[ROW][C]67[/C][C]0.4973[/C][C]-0.924[/C][C]0.4336[/C][C]0.3247[/C][C]1822384.6667[/C][C]774240.4339[/C][C]879.9093[/C][C]-6.365[/C][C]3.4974[/C][/ROW]
[ROW][C]68[/C][C]0.5341[/C][C]-1.076[/C][C]0.5139[/C][C]0.3715[/C][C]2122724.5519[/C][C]942800.9487[/C][C]970.9794[/C][C]-6.8695[/C][C]3.9189[/C][/ROW]
[ROW][C]69[/C][C]0.5686[/C][C]-1.1087[/C][C]0.58[/C][C]0.4095[/C][C]2184357.7601[/C][C]1080751.7055[/C][C]1039.5921[/C][C]-6.9685[/C][C]4.2578[/C][/ROW]
[ROW][C]70[/C][C]0.6011[/C][C]-0.884[/C][C]0.6104[/C][C]0.4299[/C][C]1739648.341[/C][C]1146641.3691[/C][C]1070.8134[/C][C]-6.2188[/C][C]4.4539[/C][/ROW]
[ROW][C]71[/C][C]0.6319[/C][C]-0.5783[/C][C]0.6075[/C][C]0.4316[/C][C]1060812.0256[/C][C]1138838.7015[/C][C]1067.1639[/C][C]-4.8562[/C][C]4.4904[/C][/ROW]
[ROW][C]72[/C][C]0.6613[/C][C]-0.4679[/C][C]0.5959[/C][C]0.4272[/C][C]802739.4711[/C][C]1110830.4323[/C][C]1053.9594[/C][C]-4.2244[/C][C]4.4683[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=291096&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=291096&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.14850.10030.10030.105695668.6709001.45841.4584
620.2398-0.07780.0890.090241043.304568355.9877261.4498-0.95521.2068
630.3086-0.09240.09010.089656488.309964400.0951253.7717-1.12061.1781
640.365-0.31170.14550.1346446136.4964159834.1954399.7927-3.14931.6709
650.4138-0.66030.24850.2071249824.5702377832.2704614.6806-5.27112.3909
660.4574-0.8690.35190.27341708137.0189599549.7285774.306-6.16223.0195
670.4973-0.9240.43360.32471822384.6667774240.4339879.9093-6.3653.4974
680.5341-1.0760.51390.37152122724.5519942800.9487970.9794-6.86953.9189
690.5686-1.10870.580.40952184357.76011080751.70551039.5921-6.96854.2578
700.6011-0.8840.61040.42991739648.3411146641.36911070.8134-6.21884.4539
710.6319-0.57830.60750.43161060812.02561138838.70151067.1639-4.85624.4904
720.6613-0.46790.59590.4272802739.47111110830.43231053.9594-4.22444.4683



Parameters (Session):
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 1 ; par6 = 1 ; par7 = 1 ; par8 = 1 ; 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
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.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')