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 22:10:11 +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/t1482354801qoaig83a6q2cixh.htm/, Retrieved Mon, 06 May 2024 23:39:04 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=302510, Retrieved Mon, 06 May 2024 23:39:04 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact61
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Paper N2503] [2016-12-21 21:10:11] [3146b6c9a81fba6ba78c11f749c05198] [Current]
Feedback Forum

Post a new message
Dataseries X:
3500
3400
3600
3650
3950
3850
3450
3650
3900
3900
4100
3900
3700
3600
3750
3800
4050
3950
3600
3650
3800
4050
4100
4000
3700
3650
3750
4050
4300
4150
3750
3900
4100
4300
4500
4400
4050
4050
4300
4450
4650
4600
4150
4350
4550
4700
5050
4900
4250
4400
4600
4650
4800
4750
4300
4350
4750
4900
5100
4950
4450
4600
4700
4850
4800
4900
4400
4550
4950
5050
5250
4950
4500
4600
4800
4950
5150
5250
4550
4800
5200
5350
5750
5200
4950
5150
5200
5300
5800
5500
5000
5100
5500
5800
6000
5600
5400
5350
5300
5550
5750
5800




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302510&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[90])
785250-------
794550-------
804800-------
815200-------
825350-------
835750-------
845200-------
854950-------
865150-------
875200-------
885300-------
895800-------
905500-------
9150004982.63484771.68885193.58080.4359010
9251005196.28854966.71665425.86040.20550.95310.99960.0048
9355005590.46035343.66425837.25640.236310.9990.7637
9458005730.21675467.32255993.11080.30140.9570.99770.957
9560006071.58865793.52686349.65050.30690.97220.98831
9656005612.73745320.29355905.18130.4660.00470.99720.7751
9754005295.2314989.07995601.38210.25120.02550.98650.0949
9853505467.76095148.49065787.03120.23490.66130.97450.4216
9953005557.3325225.46075889.20330.06430.88960.98260.6325
10055505670.86715326.8566014.87810.24550.98270.98270.8349
10157506061.7035705.96626417.43980.0430.99760.92530.999
10258005879.82325512.73516246.91130.3350.75590.97870.9787

\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[90]) \tabularnewline
78 & 5250 & - & - & - & - & - & - & - \tabularnewline
79 & 4550 & - & - & - & - & - & - & - \tabularnewline
80 & 4800 & - & - & - & - & - & - & - \tabularnewline
81 & 5200 & - & - & - & - & - & - & - \tabularnewline
82 & 5350 & - & - & - & - & - & - & - \tabularnewline
83 & 5750 & - & - & - & - & - & - & - \tabularnewline
84 & 5200 & - & - & - & - & - & - & - \tabularnewline
85 & 4950 & - & - & - & - & - & - & - \tabularnewline
86 & 5150 & - & - & - & - & - & - & - \tabularnewline
87 & 5200 & - & - & - & - & - & - & - \tabularnewline
88 & 5300 & - & - & - & - & - & - & - \tabularnewline
89 & 5800 & - & - & - & - & - & - & - \tabularnewline
90 & 5500 & - & - & - & - & - & - & - \tabularnewline
91 & 5000 & 4982.6348 & 4771.6888 & 5193.5808 & 0.4359 & 0 & 1 & 0 \tabularnewline
92 & 5100 & 5196.2885 & 4966.7166 & 5425.8604 & 0.2055 & 0.9531 & 0.9996 & 0.0048 \tabularnewline
93 & 5500 & 5590.4603 & 5343.6642 & 5837.2564 & 0.2363 & 1 & 0.999 & 0.7637 \tabularnewline
94 & 5800 & 5730.2167 & 5467.3225 & 5993.1108 & 0.3014 & 0.957 & 0.9977 & 0.957 \tabularnewline
95 & 6000 & 6071.5886 & 5793.5268 & 6349.6505 & 0.3069 & 0.9722 & 0.9883 & 1 \tabularnewline
96 & 5600 & 5612.7374 & 5320.2935 & 5905.1813 & 0.466 & 0.0047 & 0.9972 & 0.7751 \tabularnewline
97 & 5400 & 5295.231 & 4989.0799 & 5601.3821 & 0.2512 & 0.0255 & 0.9865 & 0.0949 \tabularnewline
98 & 5350 & 5467.7609 & 5148.4906 & 5787.0312 & 0.2349 & 0.6613 & 0.9745 & 0.4216 \tabularnewline
99 & 5300 & 5557.332 & 5225.4607 & 5889.2033 & 0.0643 & 0.8896 & 0.9826 & 0.6325 \tabularnewline
100 & 5550 & 5670.8671 & 5326.856 & 6014.8781 & 0.2455 & 0.9827 & 0.9827 & 0.8349 \tabularnewline
101 & 5750 & 6061.703 & 5705.9662 & 6417.4398 & 0.043 & 0.9976 & 0.9253 & 0.999 \tabularnewline
102 & 5800 & 5879.8232 & 5512.7351 & 6246.9113 & 0.335 & 0.7559 & 0.9787 & 0.9787 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302510&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[90])[/C][/ROW]
[ROW][C]78[/C][C]5250[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]79[/C][C]4550[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]80[/C][C]4800[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]81[/C][C]5200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]82[/C][C]5350[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]83[/C][C]5750[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]84[/C][C]5200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]85[/C][C]4950[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]86[/C][C]5150[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]87[/C][C]5200[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]88[/C][C]5300[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]89[/C][C]5800[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]90[/C][C]5500[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]91[/C][C]5000[/C][C]4982.6348[/C][C]4771.6888[/C][C]5193.5808[/C][C]0.4359[/C][C]0[/C][C]1[/C][C]0[/C][/ROW]
[ROW][C]92[/C][C]5100[/C][C]5196.2885[/C][C]4966.7166[/C][C]5425.8604[/C][C]0.2055[/C][C]0.9531[/C][C]0.9996[/C][C]0.0048[/C][/ROW]
[ROW][C]93[/C][C]5500[/C][C]5590.4603[/C][C]5343.6642[/C][C]5837.2564[/C][C]0.2363[/C][C]1[/C][C]0.999[/C][C]0.7637[/C][/ROW]
[ROW][C]94[/C][C]5800[/C][C]5730.2167[/C][C]5467.3225[/C][C]5993.1108[/C][C]0.3014[/C][C]0.957[/C][C]0.9977[/C][C]0.957[/C][/ROW]
[ROW][C]95[/C][C]6000[/C][C]6071.5886[/C][C]5793.5268[/C][C]6349.6505[/C][C]0.3069[/C][C]0.9722[/C][C]0.9883[/C][C]1[/C][/ROW]
[ROW][C]96[/C][C]5600[/C][C]5612.7374[/C][C]5320.2935[/C][C]5905.1813[/C][C]0.466[/C][C]0.0047[/C][C]0.9972[/C][C]0.7751[/C][/ROW]
[ROW][C]97[/C][C]5400[/C][C]5295.231[/C][C]4989.0799[/C][C]5601.3821[/C][C]0.2512[/C][C]0.0255[/C][C]0.9865[/C][C]0.0949[/C][/ROW]
[ROW][C]98[/C][C]5350[/C][C]5467.7609[/C][C]5148.4906[/C][C]5787.0312[/C][C]0.2349[/C][C]0.6613[/C][C]0.9745[/C][C]0.4216[/C][/ROW]
[ROW][C]99[/C][C]5300[/C][C]5557.332[/C][C]5225.4607[/C][C]5889.2033[/C][C]0.0643[/C][C]0.8896[/C][C]0.9826[/C][C]0.6325[/C][/ROW]
[ROW][C]100[/C][C]5550[/C][C]5670.8671[/C][C]5326.856[/C][C]6014.8781[/C][C]0.2455[/C][C]0.9827[/C][C]0.9827[/C][C]0.8349[/C][/ROW]
[ROW][C]101[/C][C]5750[/C][C]6061.703[/C][C]5705.9662[/C][C]6417.4398[/C][C]0.043[/C][C]0.9976[/C][C]0.9253[/C][C]0.999[/C][/ROW]
[ROW][C]102[/C][C]5800[/C][C]5879.8232[/C][C]5512.7351[/C][C]6246.9113[/C][C]0.335[/C][C]0.7559[/C][C]0.9787[/C][C]0.9787[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302510&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302510&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[90])
785250-------
794550-------
804800-------
815200-------
825350-------
835750-------
845200-------
854950-------
865150-------
875200-------
885300-------
895800-------
905500-------
9150004982.63484771.68885193.58080.4359010
9251005196.28854966.71665425.86040.20550.95310.99960.0048
9355005590.46035343.66425837.25640.236310.9990.7637
9458005730.21675467.32255993.11080.30140.9570.99770.957
9560006071.58865793.52686349.65050.30690.97220.98831
9656005612.73745320.29355905.18130.4660.00470.99720.7751
9754005295.2314989.07995601.38210.25120.02550.98650.0949
9853505467.76095148.49065787.03120.23490.66130.97450.4216
9953005557.3325225.46075889.20330.06430.88960.98260.6325
10055505670.86715326.8566014.87810.24550.98270.98270.8349
10157506061.7035705.96626417.43980.0430.99760.92530.999
10258005879.82325512.73516246.91130.3350.75590.97870.9787







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
910.02160.00350.00350.0035301.5506000.08680.0868
920.0225-0.01890.01120.01119271.47244786.511569.1846-0.48140.2841
930.0225-0.01640.01290.01288183.06865918.697276.9331-0.45230.3402
940.02340.0120.01270.01274869.71365656.451375.20940.34890.3424
950.0234-0.01190.01260.01255124.9285550.146674.4993-0.35790.3455
960.0266-0.00230.01080.0108162.24114652.162468.2068-0.06370.2985
970.02950.01940.01210.01210976.54345555.645474.53620.52380.3307
980.0298-0.0220.01330.013313867.63576594.644281.2074-0.58880.363
990.0305-0.04860.01720.017166219.772713219.6585114.9768-1.28670.4656
1000.031-0.02180.01770.017514608.847213358.5773115.5793-0.60430.4795
1010.0299-0.05420.0210.020797158.766820976.7764144.8336-1.55850.5776
1020.0319-0.01380.02040.02016371.74119759.6901140.5692-0.39910.5627

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
91 & 0.0216 & 0.0035 & 0.0035 & 0.0035 & 301.5506 & 0 & 0 & 0.0868 & 0.0868 \tabularnewline
92 & 0.0225 & -0.0189 & 0.0112 & 0.0111 & 9271.4724 & 4786.5115 & 69.1846 & -0.4814 & 0.2841 \tabularnewline
93 & 0.0225 & -0.0164 & 0.0129 & 0.0128 & 8183.0686 & 5918.6972 & 76.9331 & -0.4523 & 0.3402 \tabularnewline
94 & 0.0234 & 0.012 & 0.0127 & 0.0127 & 4869.7136 & 5656.4513 & 75.2094 & 0.3489 & 0.3424 \tabularnewline
95 & 0.0234 & -0.0119 & 0.0126 & 0.0125 & 5124.928 & 5550.1466 & 74.4993 & -0.3579 & 0.3455 \tabularnewline
96 & 0.0266 & -0.0023 & 0.0108 & 0.0108 & 162.2411 & 4652.1624 & 68.2068 & -0.0637 & 0.2985 \tabularnewline
97 & 0.0295 & 0.0194 & 0.0121 & 0.012 & 10976.5434 & 5555.6454 & 74.5362 & 0.5238 & 0.3307 \tabularnewline
98 & 0.0298 & -0.022 & 0.0133 & 0.0133 & 13867.6357 & 6594.6442 & 81.2074 & -0.5888 & 0.363 \tabularnewline
99 & 0.0305 & -0.0486 & 0.0172 & 0.0171 & 66219.7727 & 13219.6585 & 114.9768 & -1.2867 & 0.4656 \tabularnewline
100 & 0.031 & -0.0218 & 0.0177 & 0.0175 & 14608.8472 & 13358.5773 & 115.5793 & -0.6043 & 0.4795 \tabularnewline
101 & 0.0299 & -0.0542 & 0.021 & 0.0207 & 97158.7668 & 20976.7764 & 144.8336 & -1.5585 & 0.5776 \tabularnewline
102 & 0.0319 & -0.0138 & 0.0204 & 0.0201 & 6371.741 & 19759.6901 & 140.5692 & -0.3991 & 0.5627 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=302510&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]91[/C][C]0.0216[/C][C]0.0035[/C][C]0.0035[/C][C]0.0035[/C][C]301.5506[/C][C]0[/C][C]0[/C][C]0.0868[/C][C]0.0868[/C][/ROW]
[ROW][C]92[/C][C]0.0225[/C][C]-0.0189[/C][C]0.0112[/C][C]0.0111[/C][C]9271.4724[/C][C]4786.5115[/C][C]69.1846[/C][C]-0.4814[/C][C]0.2841[/C][/ROW]
[ROW][C]93[/C][C]0.0225[/C][C]-0.0164[/C][C]0.0129[/C][C]0.0128[/C][C]8183.0686[/C][C]5918.6972[/C][C]76.9331[/C][C]-0.4523[/C][C]0.3402[/C][/ROW]
[ROW][C]94[/C][C]0.0234[/C][C]0.012[/C][C]0.0127[/C][C]0.0127[/C][C]4869.7136[/C][C]5656.4513[/C][C]75.2094[/C][C]0.3489[/C][C]0.3424[/C][/ROW]
[ROW][C]95[/C][C]0.0234[/C][C]-0.0119[/C][C]0.0126[/C][C]0.0125[/C][C]5124.928[/C][C]5550.1466[/C][C]74.4993[/C][C]-0.3579[/C][C]0.3455[/C][/ROW]
[ROW][C]96[/C][C]0.0266[/C][C]-0.0023[/C][C]0.0108[/C][C]0.0108[/C][C]162.2411[/C][C]4652.1624[/C][C]68.2068[/C][C]-0.0637[/C][C]0.2985[/C][/ROW]
[ROW][C]97[/C][C]0.0295[/C][C]0.0194[/C][C]0.0121[/C][C]0.012[/C][C]10976.5434[/C][C]5555.6454[/C][C]74.5362[/C][C]0.5238[/C][C]0.3307[/C][/ROW]
[ROW][C]98[/C][C]0.0298[/C][C]-0.022[/C][C]0.0133[/C][C]0.0133[/C][C]13867.6357[/C][C]6594.6442[/C][C]81.2074[/C][C]-0.5888[/C][C]0.363[/C][/ROW]
[ROW][C]99[/C][C]0.0305[/C][C]-0.0486[/C][C]0.0172[/C][C]0.0171[/C][C]66219.7727[/C][C]13219.6585[/C][C]114.9768[/C][C]-1.2867[/C][C]0.4656[/C][/ROW]
[ROW][C]100[/C][C]0.031[/C][C]-0.0218[/C][C]0.0177[/C][C]0.0175[/C][C]14608.8472[/C][C]13358.5773[/C][C]115.5793[/C][C]-0.6043[/C][C]0.4795[/C][/ROW]
[ROW][C]101[/C][C]0.0299[/C][C]-0.0542[/C][C]0.021[/C][C]0.0207[/C][C]97158.7668[/C][C]20976.7764[/C][C]144.8336[/C][C]-1.5585[/C][C]0.5776[/C][/ROW]
[ROW][C]102[/C][C]0.0319[/C][C]-0.0138[/C][C]0.0204[/C][C]0.0201[/C][C]6371.741[/C][C]19759.6901[/C][C]140.5692[/C][C]-0.3991[/C][C]0.5627[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=302510&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=302510&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
910.02160.00350.00350.0035301.5506000.08680.0868
920.0225-0.01890.01120.01119271.47244786.511569.1846-0.48140.2841
930.0225-0.01640.01290.01288183.06865918.697276.9331-0.45230.3402
940.02340.0120.01270.01274869.71365656.451375.20940.34890.3424
950.0234-0.01190.01260.01255124.9285550.146674.4993-0.35790.3455
960.0266-0.00230.01080.0108162.24114652.162468.2068-0.06370.2985
970.02950.01940.01210.01210976.54345555.645474.53620.52380.3307
980.0298-0.0220.01330.013313867.63576594.644281.2074-0.58880.363
990.0305-0.04860.01720.017166219.772713219.6585114.9768-1.28670.4656
1000.031-0.02180.01770.017514608.847213358.5773115.5793-0.60430.4795
1010.0299-0.05420.0210.020797158.766820976.7764144.8336-1.55850.5776
1020.0319-0.01380.02040.02016371.74119759.6901140.5692-0.39910.5627



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