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 15:52:02 +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/t1482332005itnq5dfolxgwwa1.htm/, Retrieved Mon, 06 May 2024 23:25:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302351, Retrieved Mon, 06 May 2024 23:25:23 +0000
QR Codes:

Original text written by user:
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] [ARIMA FC] [2016-12-21 14:52:02] [1759881725a0396915ebed807ae3b27a] [Current]
Feedback Forum

Post a new message
Dataseries X:
4450
4400
4650
4800
4800
4750
5200
5050
4900
5300
5500
6050
5200
5350
5450
5900
5800
5950
6750
6500
6500
7100
7100
8400
6900
7400
7650
7850
7750
8000
8950
9100
9100
10050
10450
11900
10000
11250
11250
11650
11550
11800
13050
12350
12200
13450
13450
14450
12500
13350
13600
13200
13450
13600
14450
14000
13600
14700
14450
15250
13750
14450
14300
14600
14700
14600




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302351&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[54])
4211800-------
4313050-------
4412350-------
4512200-------
4613450-------
4713450-------
4814450-------
4912500-------
5013350-------
5113600-------
5213200-------
5313450-------
5413600-------
551445014534.452813910.638615171.94920.39760.99810.998
561400014021.20213329.678514730.21230.47660.117910.8779
571360013717.236912857.534514604.75810.39790.26620.99960.6021
581470014848.787513715.873516026.65210.40220.98110.990.9811
591445014893.74513590.289316256.87920.26170.60970.9810.9686
601525015883.193114315.212817532.64190.22590.95570.95570.9967
611375013880.164612218.234615648.03270.44260.06440.9370.622
621445014628.878112731.282216658.24270.43140.8020.89160.8398
631430014850.962612737.236917126.87410.31760.63510.85930.8593
641460014572.86212289.686217050.44740.49140.58550.86130.7792
651470014735.484112251.836917448.18760.48980.5390.82350.794
661460014846.563112167.016717792.55760.43480.53880.79650.7965

\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[54]) \tabularnewline
42 & 11800 & - & - & - & - & - & - & - \tabularnewline
43 & 13050 & - & - & - & - & - & - & - \tabularnewline
44 & 12350 & - & - & - & - & - & - & - \tabularnewline
45 & 12200 & - & - & - & - & - & - & - \tabularnewline
46 & 13450 & - & - & - & - & - & - & - \tabularnewline
47 & 13450 & - & - & - & - & - & - & - \tabularnewline
48 & 14450 & - & - & - & - & - & - & - \tabularnewline
49 & 12500 & - & - & - & - & - & - & - \tabularnewline
50 & 13350 & - & - & - & - & - & - & - \tabularnewline
51 & 13600 & - & - & - & - & - & - & - \tabularnewline
52 & 13200 & - & - & - & - & - & - & - \tabularnewline
53 & 13450 & - & - & - & - & - & - & - \tabularnewline
54 & 13600 & - & - & - & - & - & - & - \tabularnewline
55 & 14450 & 14534.4528 & 13910.6386 & 15171.9492 & 0.3976 & 0.998 & 1 & 0.998 \tabularnewline
56 & 14000 & 14021.202 & 13329.6785 & 14730.2123 & 0.4766 & 0.1179 & 1 & 0.8779 \tabularnewline
57 & 13600 & 13717.2369 & 12857.5345 & 14604.7581 & 0.3979 & 0.2662 & 0.9996 & 0.6021 \tabularnewline
58 & 14700 & 14848.7875 & 13715.8735 & 16026.6521 & 0.4022 & 0.9811 & 0.99 & 0.9811 \tabularnewline
59 & 14450 & 14893.745 & 13590.2893 & 16256.8792 & 0.2617 & 0.6097 & 0.981 & 0.9686 \tabularnewline
60 & 15250 & 15883.1931 & 14315.2128 & 17532.6419 & 0.2259 & 0.9557 & 0.9557 & 0.9967 \tabularnewline
61 & 13750 & 13880.1646 & 12218.2346 & 15648.0327 & 0.4426 & 0.0644 & 0.937 & 0.622 \tabularnewline
62 & 14450 & 14628.8781 & 12731.2822 & 16658.2427 & 0.4314 & 0.802 & 0.8916 & 0.8398 \tabularnewline
63 & 14300 & 14850.9626 & 12737.2369 & 17126.8741 & 0.3176 & 0.6351 & 0.8593 & 0.8593 \tabularnewline
64 & 14600 & 14572.862 & 12289.6862 & 17050.4474 & 0.4914 & 0.5855 & 0.8613 & 0.7792 \tabularnewline
65 & 14700 & 14735.4841 & 12251.8369 & 17448.1876 & 0.4898 & 0.539 & 0.8235 & 0.794 \tabularnewline
66 & 14600 & 14846.5631 & 12167.0167 & 17792.5576 & 0.4348 & 0.5388 & 0.7965 & 0.7965 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302351&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[54])[/C][/ROW]
[ROW][C]42[/C][C]11800[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]13050[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]12350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]12200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]13450[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]13450[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]14450[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]12500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]13350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]13600[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]13200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]13450[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]13600[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]14450[/C][C]14534.4528[/C][C]13910.6386[/C][C]15171.9492[/C][C]0.3976[/C][C]0.998[/C][C]1[/C][C]0.998[/C][/ROW]
[ROW][C]56[/C][C]14000[/C][C]14021.202[/C][C]13329.6785[/C][C]14730.2123[/C][C]0.4766[/C][C]0.1179[/C][C]1[/C][C]0.8779[/C][/ROW]
[ROW][C]57[/C][C]13600[/C][C]13717.2369[/C][C]12857.5345[/C][C]14604.7581[/C][C]0.3979[/C][C]0.2662[/C][C]0.9996[/C][C]0.6021[/C][/ROW]
[ROW][C]58[/C][C]14700[/C][C]14848.7875[/C][C]13715.8735[/C][C]16026.6521[/C][C]0.4022[/C][C]0.9811[/C][C]0.99[/C][C]0.9811[/C][/ROW]
[ROW][C]59[/C][C]14450[/C][C]14893.745[/C][C]13590.2893[/C][C]16256.8792[/C][C]0.2617[/C][C]0.6097[/C][C]0.981[/C][C]0.9686[/C][/ROW]
[ROW][C]60[/C][C]15250[/C][C]15883.1931[/C][C]14315.2128[/C][C]17532.6419[/C][C]0.2259[/C][C]0.9557[/C][C]0.9557[/C][C]0.9967[/C][/ROW]
[ROW][C]61[/C][C]13750[/C][C]13880.1646[/C][C]12218.2346[/C][C]15648.0327[/C][C]0.4426[/C][C]0.0644[/C][C]0.937[/C][C]0.622[/C][/ROW]
[ROW][C]62[/C][C]14450[/C][C]14628.8781[/C][C]12731.2822[/C][C]16658.2427[/C][C]0.4314[/C][C]0.802[/C][C]0.8916[/C][C]0.8398[/C][/ROW]
[ROW][C]63[/C][C]14300[/C][C]14850.9626[/C][C]12737.2369[/C][C]17126.8741[/C][C]0.3176[/C][C]0.6351[/C][C]0.8593[/C][C]0.8593[/C][/ROW]
[ROW][C]64[/C][C]14600[/C][C]14572.862[/C][C]12289.6862[/C][C]17050.4474[/C][C]0.4914[/C][C]0.5855[/C][C]0.8613[/C][C]0.7792[/C][/ROW]
[ROW][C]65[/C][C]14700[/C][C]14735.4841[/C][C]12251.8369[/C][C]17448.1876[/C][C]0.4898[/C][C]0.539[/C][C]0.8235[/C][C]0.794[/C][/ROW]
[ROW][C]66[/C][C]14600[/C][C]14846.5631[/C][C]12167.0167[/C][C]17792.5576[/C][C]0.4348[/C][C]0.5388[/C][C]0.7965[/C][C]0.7965[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302351&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302351&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[54])
4211800-------
4313050-------
4412350-------
4512200-------
4613450-------
4713450-------
4814450-------
4912500-------
5013350-------
5113600-------
5213200-------
5313450-------
5413600-------
551445014534.452813910.638615171.94920.39760.99810.998
561400014021.20213329.678514730.21230.47660.117910.8779
571360013717.236912857.534514604.75810.39790.26620.99960.6021
581470014848.787513715.873516026.65210.40220.98110.990.9811
591445014893.74513590.289316256.87920.26170.60970.9810.9686
601525015883.193114315.212817532.64190.22590.95570.95570.9967
611375013880.164612218.234615648.03270.44260.06440.9370.622
621445014628.878112731.282216658.24270.43140.8020.89160.8398
631430014850.962612737.236917126.87410.31760.63510.85930.8593
641460014572.86212289.686217050.44740.49140.58550.86130.7792
651470014735.484112251.836917448.18760.48980.5390.82350.794
661460014846.563112167.016717792.55760.43480.53880.79650.7965







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
550.0224-0.00580.00580.00587132.273900-0.15880.1588
560.0258-0.00150.00370.0037449.52323790.898561.5703-0.03990.0993
570.033-0.00860.00530.005313744.47967108.758984.3135-0.22040.1397
580.0405-0.01010.00650.006522137.723510866104.2401-0.27980.1747
590.0467-0.03070.01140.0112196909.624548074.7249219.2595-0.83440.3067
600.053-0.04150.01640.0162400933.4586106884.5139326.932-1.19060.454
610.065-0.00950.01540.015216942.820694035.7005306.6524-0.24480.4241
620.0708-0.01240.0150.014831997.391686280.9119293.7361-0.33640.4131
630.0782-0.03850.01760.0174303559.8118110423.0119332.2996-1.0360.4823
640.08670.00190.01610.0158736.47399454.358315.36390.0510.4392
650.0939-0.00240.01480.01461259.118490527.5181300.8779-0.06670.4053
660.1012-0.01690.0150.014860793.35188049.6708296.7316-0.46360.4102

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
55 & 0.0224 & -0.0058 & 0.0058 & 0.0058 & 7132.2739 & 0 & 0 & -0.1588 & 0.1588 \tabularnewline
56 & 0.0258 & -0.0015 & 0.0037 & 0.0037 & 449.5232 & 3790.8985 & 61.5703 & -0.0399 & 0.0993 \tabularnewline
57 & 0.033 & -0.0086 & 0.0053 & 0.0053 & 13744.4796 & 7108.7589 & 84.3135 & -0.2204 & 0.1397 \tabularnewline
58 & 0.0405 & -0.0101 & 0.0065 & 0.0065 & 22137.7235 & 10866 & 104.2401 & -0.2798 & 0.1747 \tabularnewline
59 & 0.0467 & -0.0307 & 0.0114 & 0.0112 & 196909.6245 & 48074.7249 & 219.2595 & -0.8344 & 0.3067 \tabularnewline
60 & 0.053 & -0.0415 & 0.0164 & 0.0162 & 400933.4586 & 106884.5139 & 326.932 & -1.1906 & 0.454 \tabularnewline
61 & 0.065 & -0.0095 & 0.0154 & 0.0152 & 16942.8206 & 94035.7005 & 306.6524 & -0.2448 & 0.4241 \tabularnewline
62 & 0.0708 & -0.0124 & 0.015 & 0.0148 & 31997.3916 & 86280.9119 & 293.7361 & -0.3364 & 0.4131 \tabularnewline
63 & 0.0782 & -0.0385 & 0.0176 & 0.0174 & 303559.8118 & 110423.0119 & 332.2996 & -1.036 & 0.4823 \tabularnewline
64 & 0.0867 & 0.0019 & 0.0161 & 0.0158 & 736.473 & 99454.358 & 315.3639 & 0.051 & 0.4392 \tabularnewline
65 & 0.0939 & -0.0024 & 0.0148 & 0.0146 & 1259.1184 & 90527.5181 & 300.8779 & -0.0667 & 0.4053 \tabularnewline
66 & 0.1012 & -0.0169 & 0.015 & 0.0148 & 60793.351 & 88049.6708 & 296.7316 & -0.4636 & 0.4102 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302351&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]55[/C][C]0.0224[/C][C]-0.0058[/C][C]0.0058[/C][C]0.0058[/C][C]7132.2739[/C][C]0[/C][C]0[/C][C]-0.1588[/C][C]0.1588[/C][/ROW]
[ROW][C]56[/C][C]0.0258[/C][C]-0.0015[/C][C]0.0037[/C][C]0.0037[/C][C]449.5232[/C][C]3790.8985[/C][C]61.5703[/C][C]-0.0399[/C][C]0.0993[/C][/ROW]
[ROW][C]57[/C][C]0.033[/C][C]-0.0086[/C][C]0.0053[/C][C]0.0053[/C][C]13744.4796[/C][C]7108.7589[/C][C]84.3135[/C][C]-0.2204[/C][C]0.1397[/C][/ROW]
[ROW][C]58[/C][C]0.0405[/C][C]-0.0101[/C][C]0.0065[/C][C]0.0065[/C][C]22137.7235[/C][C]10866[/C][C]104.2401[/C][C]-0.2798[/C][C]0.1747[/C][/ROW]
[ROW][C]59[/C][C]0.0467[/C][C]-0.0307[/C][C]0.0114[/C][C]0.0112[/C][C]196909.6245[/C][C]48074.7249[/C][C]219.2595[/C][C]-0.8344[/C][C]0.3067[/C][/ROW]
[ROW][C]60[/C][C]0.053[/C][C]-0.0415[/C][C]0.0164[/C][C]0.0162[/C][C]400933.4586[/C][C]106884.5139[/C][C]326.932[/C][C]-1.1906[/C][C]0.454[/C][/ROW]
[ROW][C]61[/C][C]0.065[/C][C]-0.0095[/C][C]0.0154[/C][C]0.0152[/C][C]16942.8206[/C][C]94035.7005[/C][C]306.6524[/C][C]-0.2448[/C][C]0.4241[/C][/ROW]
[ROW][C]62[/C][C]0.0708[/C][C]-0.0124[/C][C]0.015[/C][C]0.0148[/C][C]31997.3916[/C][C]86280.9119[/C][C]293.7361[/C][C]-0.3364[/C][C]0.4131[/C][/ROW]
[ROW][C]63[/C][C]0.0782[/C][C]-0.0385[/C][C]0.0176[/C][C]0.0174[/C][C]303559.8118[/C][C]110423.0119[/C][C]332.2996[/C][C]-1.036[/C][C]0.4823[/C][/ROW]
[ROW][C]64[/C][C]0.0867[/C][C]0.0019[/C][C]0.0161[/C][C]0.0158[/C][C]736.473[/C][C]99454.358[/C][C]315.3639[/C][C]0.051[/C][C]0.4392[/C][/ROW]
[ROW][C]65[/C][C]0.0939[/C][C]-0.0024[/C][C]0.0148[/C][C]0.0146[/C][C]1259.1184[/C][C]90527.5181[/C][C]300.8779[/C][C]-0.0667[/C][C]0.4053[/C][/ROW]
[ROW][C]66[/C][C]0.1012[/C][C]-0.0169[/C][C]0.015[/C][C]0.0148[/C][C]60793.351[/C][C]88049.6708[/C][C]296.7316[/C][C]-0.4636[/C][C]0.4102[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302351&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302351&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
550.0224-0.00580.00580.00587132.273900-0.15880.1588
560.0258-0.00150.00370.0037449.52323790.898561.5703-0.03990.0993
570.033-0.00860.00530.005313744.47967108.758984.3135-0.22040.1397
580.0405-0.01010.00650.006522137.723510866104.2401-0.27980.1747
590.0467-0.03070.01140.0112196909.624548074.7249219.2595-0.83440.3067
600.053-0.04150.01640.0162400933.4586106884.5139326.932-1.19060.454
610.065-0.00950.01540.015216942.820694035.7005306.6524-0.24480.4241
620.0708-0.01240.0150.014831997.391686280.9119293.7361-0.33640.4131
630.0782-0.03850.01760.0174303559.8118110423.0119332.2996-1.0360.4823
640.08670.00190.01610.0158736.47399454.358315.36390.0510.4392
650.0939-0.00240.01480.01461259.118490527.5181300.8779-0.06670.4053
660.1012-0.01690.0150.014860793.35188049.6708296.7316-0.46360.4102



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