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 computationSat, 17 Dec 2016 13:41:42 +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/17/t14819788023p44rblrxv9ipv6.htm/, Retrieved Fri, 01 Nov 2024 03:34:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300761, Retrieved Fri, 01 Nov 2024 03:34:23 +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)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMPD    [Standard Deviation-Mean Plot] [F1:N1809] [2016-12-11 14:01:05] [a4c5732063e280fade3b47e7f5057d96]
- RMP         [ARIMA Forecasting] [F1:N1809] [2016-12-17 12:41:42] [8d7b5e4c30a3b8052caee801f90adcea] [Current]
Feedback Forum

Post a new message
Dataseries X:
3650
3530
3800
4130
3440
4000
3690
4210
4240
4260
4510
4260
3420
3660
3790
3270
3250
3570
3410
4270
4410
4450
3990
4000
4140
3800
3060
3270
3040
3750
3330
3840
4060
3830
3880
3820
3640
2880
3710
2980
3190
3090
3190
3410
3310
3480
3750
3200
3150
3250
3290
2900
2940
3460
3890
3040
3000
3520
2850
2730
2820
3240
3160
3010
2720
2650
2790
3090
3240
3690
3490
2790
3060
3210
3080
2640
2890
3330
2970
2870
3140
3150
2940
2910
3060
2900
2980
2890
2920
2940
3300
3050
2740
3080
3090
2830
3390
3210
2970
2810
2690
2800
2920
2870
2860
3090
3180
3090




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300761&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[93])
923050-------
932740-------
9430802848.35062529.14013291.990.15310.68390.68390.6839
9530902926.62712569.50633440.81310.26670.27940.27940.7616
9628302835.6782502.59783307.4660.49060.14540.14540.6545
9733902782.05412462.88623229.78020.00390.41690.41690.573
9832102862.43172517.94023355.44750.08350.0180.0180.6868
9929702907.97482549.68543426.06210.40720.12660.12660.7374
10028102882.20172527.91933393.95880.39110.36830.36830.707
10126902870.20322519.08613376.30670.24260.59220.59220.693
10228002887.58252530.70193404.35030.36990.77320.77320.7122
10329202874.68572520.26633387.32680.43120.61240.61240.6967
10428702837.67762490.57823337.96520.44960.37350.37350.649
10528602814.05452467.11143315.88130.42880.41350.41350.6138
10630902804.82092453.39383316.86250.13750.41640.41640.598
10731802792.21612439.91333307.19070.070.12850.12850.5788
10830902780.77052429.00343295.57970.11950.06430.06430.5617

\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[93]) \tabularnewline
92 & 3050 & - & - & - & - & - & - & - \tabularnewline
93 & 2740 & - & - & - & - & - & - & - \tabularnewline
94 & 3080 & 2848.3506 & 2529.1401 & 3291.99 & 0.1531 & 0.6839 & 0.6839 & 0.6839 \tabularnewline
95 & 3090 & 2926.6271 & 2569.5063 & 3440.8131 & 0.2667 & 0.2794 & 0.2794 & 0.7616 \tabularnewline
96 & 2830 & 2835.678 & 2502.5978 & 3307.466 & 0.4906 & 0.1454 & 0.1454 & 0.6545 \tabularnewline
97 & 3390 & 2782.0541 & 2462.8862 & 3229.7802 & 0.0039 & 0.4169 & 0.4169 & 0.573 \tabularnewline
98 & 3210 & 2862.4317 & 2517.9402 & 3355.4475 & 0.0835 & 0.018 & 0.018 & 0.6868 \tabularnewline
99 & 2970 & 2907.9748 & 2549.6854 & 3426.0621 & 0.4072 & 0.1266 & 0.1266 & 0.7374 \tabularnewline
100 & 2810 & 2882.2017 & 2527.9193 & 3393.9588 & 0.3911 & 0.3683 & 0.3683 & 0.707 \tabularnewline
101 & 2690 & 2870.2032 & 2519.0861 & 3376.3067 & 0.2426 & 0.5922 & 0.5922 & 0.693 \tabularnewline
102 & 2800 & 2887.5825 & 2530.7019 & 3404.3503 & 0.3699 & 0.7732 & 0.7732 & 0.7122 \tabularnewline
103 & 2920 & 2874.6857 & 2520.2663 & 3387.3268 & 0.4312 & 0.6124 & 0.6124 & 0.6967 \tabularnewline
104 & 2870 & 2837.6776 & 2490.5782 & 3337.9652 & 0.4496 & 0.3735 & 0.3735 & 0.649 \tabularnewline
105 & 2860 & 2814.0545 & 2467.1114 & 3315.8813 & 0.4288 & 0.4135 & 0.4135 & 0.6138 \tabularnewline
106 & 3090 & 2804.8209 & 2453.3938 & 3316.8625 & 0.1375 & 0.4164 & 0.4164 & 0.598 \tabularnewline
107 & 3180 & 2792.2161 & 2439.9133 & 3307.1907 & 0.07 & 0.1285 & 0.1285 & 0.5788 \tabularnewline
108 & 3090 & 2780.7705 & 2429.0034 & 3295.5797 & 0.1195 & 0.0643 & 0.0643 & 0.5617 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300761&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[93])[/C][/ROW]
[ROW][C]92[/C][C]3050[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]93[/C][C]2740[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]94[/C][C]3080[/C][C]2848.3506[/C][C]2529.1401[/C][C]3291.99[/C][C]0.1531[/C][C]0.6839[/C][C]0.6839[/C][C]0.6839[/C][/ROW]
[ROW][C]95[/C][C]3090[/C][C]2926.6271[/C][C]2569.5063[/C][C]3440.8131[/C][C]0.2667[/C][C]0.2794[/C][C]0.2794[/C][C]0.7616[/C][/ROW]
[ROW][C]96[/C][C]2830[/C][C]2835.678[/C][C]2502.5978[/C][C]3307.466[/C][C]0.4906[/C][C]0.1454[/C][C]0.1454[/C][C]0.6545[/C][/ROW]
[ROW][C]97[/C][C]3390[/C][C]2782.0541[/C][C]2462.8862[/C][C]3229.7802[/C][C]0.0039[/C][C]0.4169[/C][C]0.4169[/C][C]0.573[/C][/ROW]
[ROW][C]98[/C][C]3210[/C][C]2862.4317[/C][C]2517.9402[/C][C]3355.4475[/C][C]0.0835[/C][C]0.018[/C][C]0.018[/C][C]0.6868[/C][/ROW]
[ROW][C]99[/C][C]2970[/C][C]2907.9748[/C][C]2549.6854[/C][C]3426.0621[/C][C]0.4072[/C][C]0.1266[/C][C]0.1266[/C][C]0.7374[/C][/ROW]
[ROW][C]100[/C][C]2810[/C][C]2882.2017[/C][C]2527.9193[/C][C]3393.9588[/C][C]0.3911[/C][C]0.3683[/C][C]0.3683[/C][C]0.707[/C][/ROW]
[ROW][C]101[/C][C]2690[/C][C]2870.2032[/C][C]2519.0861[/C][C]3376.3067[/C][C]0.2426[/C][C]0.5922[/C][C]0.5922[/C][C]0.693[/C][/ROW]
[ROW][C]102[/C][C]2800[/C][C]2887.5825[/C][C]2530.7019[/C][C]3404.3503[/C][C]0.3699[/C][C]0.7732[/C][C]0.7732[/C][C]0.7122[/C][/ROW]
[ROW][C]103[/C][C]2920[/C][C]2874.6857[/C][C]2520.2663[/C][C]3387.3268[/C][C]0.4312[/C][C]0.6124[/C][C]0.6124[/C][C]0.6967[/C][/ROW]
[ROW][C]104[/C][C]2870[/C][C]2837.6776[/C][C]2490.5782[/C][C]3337.9652[/C][C]0.4496[/C][C]0.3735[/C][C]0.3735[/C][C]0.649[/C][/ROW]
[ROW][C]105[/C][C]2860[/C][C]2814.0545[/C][C]2467.1114[/C][C]3315.8813[/C][C]0.4288[/C][C]0.4135[/C][C]0.4135[/C][C]0.6138[/C][/ROW]
[ROW][C]106[/C][C]3090[/C][C]2804.8209[/C][C]2453.3938[/C][C]3316.8625[/C][C]0.1375[/C][C]0.4164[/C][C]0.4164[/C][C]0.598[/C][/ROW]
[ROW][C]107[/C][C]3180[/C][C]2792.2161[/C][C]2439.9133[/C][C]3307.1907[/C][C]0.07[/C][C]0.1285[/C][C]0.1285[/C][C]0.5788[/C][/ROW]
[ROW][C]108[/C][C]3090[/C][C]2780.7705[/C][C]2429.0034[/C][C]3295.5797[/C][C]0.1195[/C][C]0.0643[/C][C]0.0643[/C][C]0.5617[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300761&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300761&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[93])
923050-------
932740-------
9430802848.35062529.14013291.990.15310.68390.68390.6839
9530902926.62712569.50633440.81310.26670.27940.27940.7616
9628302835.6782502.59783307.4660.49060.14540.14540.6545
9733902782.05412462.88623229.78020.00390.41690.41690.573
9832102862.43172517.94023355.44750.08350.0180.0180.6868
9929702907.97482549.68543426.06210.40720.12660.12660.7374
10028102882.20172527.91933393.95880.39110.36830.36830.707
10126902870.20322519.08613376.30670.24260.59220.59220.693
10228002887.58252530.70193404.35030.36990.77320.77320.7122
10329202874.68572520.26633387.32680.43120.61240.61240.6967
10428702837.67762490.57823337.96520.44960.37350.37350.649
10528602814.05452467.11143315.88130.42880.41350.41350.6138
10630902804.82092453.39383316.86250.13750.41640.41640.598
10731802792.21612439.91333307.19070.070.12850.12850.5788
10830902780.77052429.00343295.57970.11950.06430.06430.5617







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
940.07950.07520.07520.078153661.4271001.45431.4543
950.08960.05290.0640.066226690.69540176.061200.43971.02571.24
960.0849-0.0020.04340.044832.239826794.7873163.6911-0.03560.8385
970.08210.17930.07740.0829369598.1812112495.6358335.40373.81671.5831
980.08790.10830.08350.0892120803.7156114157.2517337.87162.1821.7029
990.09090.02090.07310.07783847.128895772.2312309.47090.38941.484
1000.0906-0.02570.06630.07035213.083482835.2101287.8111-0.45331.3367
1010.09-0.0670.06640.069732473.186576539.9572276.6586-1.13131.311
1020.0913-0.03130.06250.06537670.699868887.8175262.4649-0.54981.2265
1030.0910.01550.05780.06042053.388962204.3746249.4080.28451.1323
1040.08990.01130.05360.05591044.7456644.4078238.00090.20291.0478
1050.0910.01610.05040.05262110.985552099.956228.25410.28840.9845
1060.09310.09230.05370.05681327.105254348.1982233.1271.79041.0465
1070.09410.12190.05850.0613150376.359661207.3526247.40122.43451.1456
1080.09450.10010.06130.064295622.902363501.7226251.99551.94141.1987

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
94 & 0.0795 & 0.0752 & 0.0752 & 0.0781 & 53661.4271 & 0 & 0 & 1.4543 & 1.4543 \tabularnewline
95 & 0.0896 & 0.0529 & 0.064 & 0.0662 & 26690.695 & 40176.061 & 200.4397 & 1.0257 & 1.24 \tabularnewline
96 & 0.0849 & -0.002 & 0.0434 & 0.0448 & 32.2398 & 26794.7873 & 163.6911 & -0.0356 & 0.8385 \tabularnewline
97 & 0.0821 & 0.1793 & 0.0774 & 0.0829 & 369598.1812 & 112495.6358 & 335.4037 & 3.8167 & 1.5831 \tabularnewline
98 & 0.0879 & 0.1083 & 0.0835 & 0.0892 & 120803.7156 & 114157.2517 & 337.8716 & 2.182 & 1.7029 \tabularnewline
99 & 0.0909 & 0.0209 & 0.0731 & 0.0778 & 3847.1288 & 95772.2312 & 309.4709 & 0.3894 & 1.484 \tabularnewline
100 & 0.0906 & -0.0257 & 0.0663 & 0.0703 & 5213.0834 & 82835.2101 & 287.8111 & -0.4533 & 1.3367 \tabularnewline
101 & 0.09 & -0.067 & 0.0664 & 0.0697 & 32473.1865 & 76539.9572 & 276.6586 & -1.1313 & 1.311 \tabularnewline
102 & 0.0913 & -0.0313 & 0.0625 & 0.0653 & 7670.6998 & 68887.8175 & 262.4649 & -0.5498 & 1.2265 \tabularnewline
103 & 0.091 & 0.0155 & 0.0578 & 0.0604 & 2053.3889 & 62204.3746 & 249.408 & 0.2845 & 1.1323 \tabularnewline
104 & 0.0899 & 0.0113 & 0.0536 & 0.0559 & 1044.74 & 56644.4078 & 238.0009 & 0.2029 & 1.0478 \tabularnewline
105 & 0.091 & 0.0161 & 0.0504 & 0.0526 & 2110.9855 & 52099.956 & 228.2541 & 0.2884 & 0.9845 \tabularnewline
106 & 0.0931 & 0.0923 & 0.0537 & 0.056 & 81327.1052 & 54348.1982 & 233.127 & 1.7904 & 1.0465 \tabularnewline
107 & 0.0941 & 0.1219 & 0.0585 & 0.0613 & 150376.3596 & 61207.3526 & 247.4012 & 2.4345 & 1.1456 \tabularnewline
108 & 0.0945 & 0.1001 & 0.0613 & 0.0642 & 95622.9023 & 63501.7226 & 251.9955 & 1.9414 & 1.1987 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300761&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]94[/C][C]0.0795[/C][C]0.0752[/C][C]0.0752[/C][C]0.0781[/C][C]53661.4271[/C][C]0[/C][C]0[/C][C]1.4543[/C][C]1.4543[/C][/ROW]
[ROW][C]95[/C][C]0.0896[/C][C]0.0529[/C][C]0.064[/C][C]0.0662[/C][C]26690.695[/C][C]40176.061[/C][C]200.4397[/C][C]1.0257[/C][C]1.24[/C][/ROW]
[ROW][C]96[/C][C]0.0849[/C][C]-0.002[/C][C]0.0434[/C][C]0.0448[/C][C]32.2398[/C][C]26794.7873[/C][C]163.6911[/C][C]-0.0356[/C][C]0.8385[/C][/ROW]
[ROW][C]97[/C][C]0.0821[/C][C]0.1793[/C][C]0.0774[/C][C]0.0829[/C][C]369598.1812[/C][C]112495.6358[/C][C]335.4037[/C][C]3.8167[/C][C]1.5831[/C][/ROW]
[ROW][C]98[/C][C]0.0879[/C][C]0.1083[/C][C]0.0835[/C][C]0.0892[/C][C]120803.7156[/C][C]114157.2517[/C][C]337.8716[/C][C]2.182[/C][C]1.7029[/C][/ROW]
[ROW][C]99[/C][C]0.0909[/C][C]0.0209[/C][C]0.0731[/C][C]0.0778[/C][C]3847.1288[/C][C]95772.2312[/C][C]309.4709[/C][C]0.3894[/C][C]1.484[/C][/ROW]
[ROW][C]100[/C][C]0.0906[/C][C]-0.0257[/C][C]0.0663[/C][C]0.0703[/C][C]5213.0834[/C][C]82835.2101[/C][C]287.8111[/C][C]-0.4533[/C][C]1.3367[/C][/ROW]
[ROW][C]101[/C][C]0.09[/C][C]-0.067[/C][C]0.0664[/C][C]0.0697[/C][C]32473.1865[/C][C]76539.9572[/C][C]276.6586[/C][C]-1.1313[/C][C]1.311[/C][/ROW]
[ROW][C]102[/C][C]0.0913[/C][C]-0.0313[/C][C]0.0625[/C][C]0.0653[/C][C]7670.6998[/C][C]68887.8175[/C][C]262.4649[/C][C]-0.5498[/C][C]1.2265[/C][/ROW]
[ROW][C]103[/C][C]0.091[/C][C]0.0155[/C][C]0.0578[/C][C]0.0604[/C][C]2053.3889[/C][C]62204.3746[/C][C]249.408[/C][C]0.2845[/C][C]1.1323[/C][/ROW]
[ROW][C]104[/C][C]0.0899[/C][C]0.0113[/C][C]0.0536[/C][C]0.0559[/C][C]1044.74[/C][C]56644.4078[/C][C]238.0009[/C][C]0.2029[/C][C]1.0478[/C][/ROW]
[ROW][C]105[/C][C]0.091[/C][C]0.0161[/C][C]0.0504[/C][C]0.0526[/C][C]2110.9855[/C][C]52099.956[/C][C]228.2541[/C][C]0.2884[/C][C]0.9845[/C][/ROW]
[ROW][C]106[/C][C]0.0931[/C][C]0.0923[/C][C]0.0537[/C][C]0.056[/C][C]81327.1052[/C][C]54348.1982[/C][C]233.127[/C][C]1.7904[/C][C]1.0465[/C][/ROW]
[ROW][C]107[/C][C]0.0941[/C][C]0.1219[/C][C]0.0585[/C][C]0.0613[/C][C]150376.3596[/C][C]61207.3526[/C][C]247.4012[/C][C]2.4345[/C][C]1.1456[/C][/ROW]
[ROW][C]108[/C][C]0.0945[/C][C]0.1001[/C][C]0.0613[/C][C]0.0642[/C][C]95622.9023[/C][C]63501.7226[/C][C]251.9955[/C][C]1.9414[/C][C]1.1987[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300761&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300761&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
940.07950.07520.07520.078153661.4271001.45431.4543
950.08960.05290.0640.066226690.69540176.061200.43971.02571.24
960.0849-0.0020.04340.044832.239826794.7873163.6911-0.03560.8385
970.08210.17930.07740.0829369598.1812112495.6358335.40373.81671.5831
980.08790.10830.08350.0892120803.7156114157.2517337.87162.1821.7029
990.09090.02090.07310.07783847.128895772.2312309.47090.38941.484
1000.0906-0.02570.06630.07035213.083482835.2101287.8111-0.45331.3367
1010.09-0.0670.06640.069732473.186576539.9572276.6586-1.13131.311
1020.0913-0.03130.06250.06537670.699868887.8175262.4649-0.54981.2265
1030.0910.01550.05780.06042053.388962204.3746249.4080.28451.1323
1040.08990.01130.05360.05591044.7456644.4078238.00090.20291.0478
1050.0910.01610.05040.05262110.985552099.956228.25410.28840.9845
1060.09310.09230.05370.05681327.105254348.1982233.1271.79041.0465
1070.09410.12190.05850.0613150376.359661207.3526247.40122.43451.1456
1080.09450.10010.06130.064295622.902363501.7226251.99551.94141.1987



Parameters (Session):
par1 = 12 ; par2 = Triple ; par3 = additive ; par4 = 12 ;
Parameters (R input):
par1 = 15 ; par2 = -1.5 ; par3 = 1 ; par4 = 1 ; par5 = 1 ; par6 = 3 ; par7 = 2 ; par8 = 2 ; par9 = 1 ; 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')