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 18:02:14 +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/t14819941498qpj3b81kktect5.htm/, Retrieved Thu, 02 May 2024 04:33:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=300886, Retrieved Thu, 02 May 2024 04:33:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact102
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ML Fitting and QQ Plot- Normal Distribution] [Histogram] [2016-12-02 11:39:44] [937b9e6718912fc8986df66e31b6c342]
- RMP   [Histogram] [HISTO&FREQ STATPAP] [2016-12-11 13:44:30] [937b9e6718912fc8986df66e31b6c342]
- RMP       [ARIMA Forecasting] [arimafore] [2016-12-17 17:02:14] [863feeaf19a0ddfce7bd9c25059c4d8a] [Current]
Feedback Forum

Post a new message
Dataseries X:
4790.92
4795.33
4822.62
4797.52
4822.17
4843.08
4850.79
4827.02
4796.65
4854.96
4870.81
4891.06
4881.38
4921.43
4956.21
4962.81
4949.38
4977.99
4992.73
5009.02
4990.98
5014.96
5022.23
5028.83
4894.36
4918.13
4936.4
4899.87
4862.89
4882.69
4895.46
4883.8
4855.4
4874.33
4880.94
4861.79
4851.44
4840.22
4842.42
4827.02
4749.77
4866.63
4734.37
4726.44
4753.51
4867.29
4793.35
4822.4
4865.09
4987.67
4900.96
4904.71
4889.52
5015.63
4938.81
4924.73
4871.48
4998.24
4891.06
4876.54
4824.15




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300886&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[49])
374851.44-------
384840.22-------
394842.42-------
404827.02-------
414749.77-------
424866.63-------
434734.37-------
444726.44-------
454753.51-------
464867.29-------
474793.35-------
484822.4-------
494865.09-------
504987.674864.00514761.20934966.8010.00920.49170.67490.4917
514900.964871.08044722.30625019.85470.34690.06230.64710.5315
524904.714850.50234664.16175036.84290.28430.29780.59750.439
534889.524788.13974568.23855008.04090.18310.14940.63380.2464
545015.634872.2764621.16375123.38820.13160.44650.51760.5224
554938.814785.31534504.51695066.11380.1420.0540.63890.2888
564924.734776.01694466.58155085.45220.17310.15120.62320.2863
574871.484783.90654446.5835121.22990.30540.20660.57010.3186
584998.244866.58384501.91835231.24920.23960.48950.49850.5032
594891.064817.32084425.71645208.92530.3560.18260.54770.4055
604876.544831.96844413.72325250.21350.41730.39090.51790.4383
614824.154846.40624401.73985291.07260.46090.44720.46720.4672

\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[49]) \tabularnewline
37 & 4851.44 & - & - & - & - & - & - & - \tabularnewline
38 & 4840.22 & - & - & - & - & - & - & - \tabularnewline
39 & 4842.42 & - & - & - & - & - & - & - \tabularnewline
40 & 4827.02 & - & - & - & - & - & - & - \tabularnewline
41 & 4749.77 & - & - & - & - & - & - & - \tabularnewline
42 & 4866.63 & - & - & - & - & - & - & - \tabularnewline
43 & 4734.37 & - & - & - & - & - & - & - \tabularnewline
44 & 4726.44 & - & - & - & - & - & - & - \tabularnewline
45 & 4753.51 & - & - & - & - & - & - & - \tabularnewline
46 & 4867.29 & - & - & - & - & - & - & - \tabularnewline
47 & 4793.35 & - & - & - & - & - & - & - \tabularnewline
48 & 4822.4 & - & - & - & - & - & - & - \tabularnewline
49 & 4865.09 & - & - & - & - & - & - & - \tabularnewline
50 & 4987.67 & 4864.0051 & 4761.2093 & 4966.801 & 0.0092 & 0.4917 & 0.6749 & 0.4917 \tabularnewline
51 & 4900.96 & 4871.0804 & 4722.3062 & 5019.8547 & 0.3469 & 0.0623 & 0.6471 & 0.5315 \tabularnewline
52 & 4904.71 & 4850.5023 & 4664.1617 & 5036.8429 & 0.2843 & 0.2978 & 0.5975 & 0.439 \tabularnewline
53 & 4889.52 & 4788.1397 & 4568.2385 & 5008.0409 & 0.1831 & 0.1494 & 0.6338 & 0.2464 \tabularnewline
54 & 5015.63 & 4872.276 & 4621.1637 & 5123.3882 & 0.1316 & 0.4465 & 0.5176 & 0.5224 \tabularnewline
55 & 4938.81 & 4785.3153 & 4504.5169 & 5066.1138 & 0.142 & 0.054 & 0.6389 & 0.2888 \tabularnewline
56 & 4924.73 & 4776.0169 & 4466.5815 & 5085.4522 & 0.1731 & 0.1512 & 0.6232 & 0.2863 \tabularnewline
57 & 4871.48 & 4783.9065 & 4446.583 & 5121.2299 & 0.3054 & 0.2066 & 0.5701 & 0.3186 \tabularnewline
58 & 4998.24 & 4866.5838 & 4501.9183 & 5231.2492 & 0.2396 & 0.4895 & 0.4985 & 0.5032 \tabularnewline
59 & 4891.06 & 4817.3208 & 4425.7164 & 5208.9253 & 0.356 & 0.1826 & 0.5477 & 0.4055 \tabularnewline
60 & 4876.54 & 4831.9684 & 4413.7232 & 5250.2135 & 0.4173 & 0.3909 & 0.5179 & 0.4383 \tabularnewline
61 & 4824.15 & 4846.4062 & 4401.7398 & 5291.0726 & 0.4609 & 0.4472 & 0.4672 & 0.4672 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300886&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[49])[/C][/ROW]
[ROW][C]37[/C][C]4851.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]4840.22[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]4842.42[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]4827.02[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]4749.77[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]4866.63[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]4734.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]4726.44[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4753.51[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]4867.29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4793.35[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]4822.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]4865.09[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]4987.67[/C][C]4864.0051[/C][C]4761.2093[/C][C]4966.801[/C][C]0.0092[/C][C]0.4917[/C][C]0.6749[/C][C]0.4917[/C][/ROW]
[ROW][C]51[/C][C]4900.96[/C][C]4871.0804[/C][C]4722.3062[/C][C]5019.8547[/C][C]0.3469[/C][C]0.0623[/C][C]0.6471[/C][C]0.5315[/C][/ROW]
[ROW][C]52[/C][C]4904.71[/C][C]4850.5023[/C][C]4664.1617[/C][C]5036.8429[/C][C]0.2843[/C][C]0.2978[/C][C]0.5975[/C][C]0.439[/C][/ROW]
[ROW][C]53[/C][C]4889.52[/C][C]4788.1397[/C][C]4568.2385[/C][C]5008.0409[/C][C]0.1831[/C][C]0.1494[/C][C]0.6338[/C][C]0.2464[/C][/ROW]
[ROW][C]54[/C][C]5015.63[/C][C]4872.276[/C][C]4621.1637[/C][C]5123.3882[/C][C]0.1316[/C][C]0.4465[/C][C]0.5176[/C][C]0.5224[/C][/ROW]
[ROW][C]55[/C][C]4938.81[/C][C]4785.3153[/C][C]4504.5169[/C][C]5066.1138[/C][C]0.142[/C][C]0.054[/C][C]0.6389[/C][C]0.2888[/C][/ROW]
[ROW][C]56[/C][C]4924.73[/C][C]4776.0169[/C][C]4466.5815[/C][C]5085.4522[/C][C]0.1731[/C][C]0.1512[/C][C]0.6232[/C][C]0.2863[/C][/ROW]
[ROW][C]57[/C][C]4871.48[/C][C]4783.9065[/C][C]4446.583[/C][C]5121.2299[/C][C]0.3054[/C][C]0.2066[/C][C]0.5701[/C][C]0.3186[/C][/ROW]
[ROW][C]58[/C][C]4998.24[/C][C]4866.5838[/C][C]4501.9183[/C][C]5231.2492[/C][C]0.2396[/C][C]0.4895[/C][C]0.4985[/C][C]0.5032[/C][/ROW]
[ROW][C]59[/C][C]4891.06[/C][C]4817.3208[/C][C]4425.7164[/C][C]5208.9253[/C][C]0.356[/C][C]0.1826[/C][C]0.5477[/C][C]0.4055[/C][/ROW]
[ROW][C]60[/C][C]4876.54[/C][C]4831.9684[/C][C]4413.7232[/C][C]5250.2135[/C][C]0.4173[/C][C]0.3909[/C][C]0.5179[/C][C]0.4383[/C][/ROW]
[ROW][C]61[/C][C]4824.15[/C][C]4846.4062[/C][C]4401.7398[/C][C]5291.0726[/C][C]0.4609[/C][C]0.4472[/C][C]0.4672[/C][C]0.4672[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300886&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300886&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[49])
374851.44-------
384840.22-------
394842.42-------
404827.02-------
414749.77-------
424866.63-------
434734.37-------
444726.44-------
454753.51-------
464867.29-------
474793.35-------
484822.4-------
494865.09-------
504987.674864.00514761.20934966.8010.00920.49170.67490.4917
514900.964871.08044722.30625019.85470.34690.06230.64710.5315
524904.714850.50234664.16175036.84290.28430.29780.59750.439
534889.524788.13974568.23855008.04090.18310.14940.63380.2464
545015.634872.2764621.16375123.38820.13160.44650.51760.5224
554938.814785.31534504.51695066.11380.1420.0540.63890.2888
564924.734776.01694466.58155085.45220.17310.15120.62320.2863
574871.484783.90654446.5835121.22990.30540.20660.57010.3186
584998.244866.58384501.91835231.24920.23960.48950.49850.5032
594891.064817.32084425.71645208.92530.3560.18260.54770.4055
604876.544831.96844413.72325250.21350.41730.39090.51790.4383
614824.154846.40624401.73985291.07260.46090.44720.46720.4672







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
500.01080.02480.02480.025115292.9994002.012.01
510.01560.00610.01540.0156892.78868092.89489.96050.48571.2478
520.01960.01110.0140.01412938.47546374.754479.84210.88111.1256
530.02340.02070.01570.015810277.96767350.557785.73541.64781.2562
540.02630.02860.01830.018520550.38079990.522399.95262.33011.4709
550.02990.03110.02040.020623560.610612252.2037110.68972.49491.6416
560.03310.03020.02180.022122115.600613661.2604116.88142.41721.7524
570.0360.0180.02130.02167669.122212912.2431113.63211.42341.7113
580.03820.02630.02190.022117333.367713403.4792115.77342.13991.7589
590.04150.01510.02120.02155437.464312606.8777112.28041.19861.7029
600.04420.00910.02010.02031986.629811641.4006107.89530.72451.6139
610.0468-0.00460.01880.019495.338510712.5621103.5015-0.36181.5096

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
50 & 0.0108 & 0.0248 & 0.0248 & 0.0251 & 15292.9994 & 0 & 0 & 2.01 & 2.01 \tabularnewline
51 & 0.0156 & 0.0061 & 0.0154 & 0.0156 & 892.7886 & 8092.894 & 89.9605 & 0.4857 & 1.2478 \tabularnewline
52 & 0.0196 & 0.0111 & 0.014 & 0.0141 & 2938.4754 & 6374.7544 & 79.8421 & 0.8811 & 1.1256 \tabularnewline
53 & 0.0234 & 0.0207 & 0.0157 & 0.0158 & 10277.9676 & 7350.5577 & 85.7354 & 1.6478 & 1.2562 \tabularnewline
54 & 0.0263 & 0.0286 & 0.0183 & 0.0185 & 20550.3807 & 9990.5223 & 99.9526 & 2.3301 & 1.4709 \tabularnewline
55 & 0.0299 & 0.0311 & 0.0204 & 0.0206 & 23560.6106 & 12252.2037 & 110.6897 & 2.4949 & 1.6416 \tabularnewline
56 & 0.0331 & 0.0302 & 0.0218 & 0.0221 & 22115.6006 & 13661.2604 & 116.8814 & 2.4172 & 1.7524 \tabularnewline
57 & 0.036 & 0.018 & 0.0213 & 0.0216 & 7669.1222 & 12912.2431 & 113.6321 & 1.4234 & 1.7113 \tabularnewline
58 & 0.0382 & 0.0263 & 0.0219 & 0.0221 & 17333.3677 & 13403.4792 & 115.7734 & 2.1399 & 1.7589 \tabularnewline
59 & 0.0415 & 0.0151 & 0.0212 & 0.0215 & 5437.4643 & 12606.8777 & 112.2804 & 1.1986 & 1.7029 \tabularnewline
60 & 0.0442 & 0.0091 & 0.0201 & 0.0203 & 1986.6298 & 11641.4006 & 107.8953 & 0.7245 & 1.6139 \tabularnewline
61 & 0.0468 & -0.0046 & 0.0188 & 0.019 & 495.3385 & 10712.5621 & 103.5015 & -0.3618 & 1.5096 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=300886&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]50[/C][C]0.0108[/C][C]0.0248[/C][C]0.0248[/C][C]0.0251[/C][C]15292.9994[/C][C]0[/C][C]0[/C][C]2.01[/C][C]2.01[/C][/ROW]
[ROW][C]51[/C][C]0.0156[/C][C]0.0061[/C][C]0.0154[/C][C]0.0156[/C][C]892.7886[/C][C]8092.894[/C][C]89.9605[/C][C]0.4857[/C][C]1.2478[/C][/ROW]
[ROW][C]52[/C][C]0.0196[/C][C]0.0111[/C][C]0.014[/C][C]0.0141[/C][C]2938.4754[/C][C]6374.7544[/C][C]79.8421[/C][C]0.8811[/C][C]1.1256[/C][/ROW]
[ROW][C]53[/C][C]0.0234[/C][C]0.0207[/C][C]0.0157[/C][C]0.0158[/C][C]10277.9676[/C][C]7350.5577[/C][C]85.7354[/C][C]1.6478[/C][C]1.2562[/C][/ROW]
[ROW][C]54[/C][C]0.0263[/C][C]0.0286[/C][C]0.0183[/C][C]0.0185[/C][C]20550.3807[/C][C]9990.5223[/C][C]99.9526[/C][C]2.3301[/C][C]1.4709[/C][/ROW]
[ROW][C]55[/C][C]0.0299[/C][C]0.0311[/C][C]0.0204[/C][C]0.0206[/C][C]23560.6106[/C][C]12252.2037[/C][C]110.6897[/C][C]2.4949[/C][C]1.6416[/C][/ROW]
[ROW][C]56[/C][C]0.0331[/C][C]0.0302[/C][C]0.0218[/C][C]0.0221[/C][C]22115.6006[/C][C]13661.2604[/C][C]116.8814[/C][C]2.4172[/C][C]1.7524[/C][/ROW]
[ROW][C]57[/C][C]0.036[/C][C]0.018[/C][C]0.0213[/C][C]0.0216[/C][C]7669.1222[/C][C]12912.2431[/C][C]113.6321[/C][C]1.4234[/C][C]1.7113[/C][/ROW]
[ROW][C]58[/C][C]0.0382[/C][C]0.0263[/C][C]0.0219[/C][C]0.0221[/C][C]17333.3677[/C][C]13403.4792[/C][C]115.7734[/C][C]2.1399[/C][C]1.7589[/C][/ROW]
[ROW][C]59[/C][C]0.0415[/C][C]0.0151[/C][C]0.0212[/C][C]0.0215[/C][C]5437.4643[/C][C]12606.8777[/C][C]112.2804[/C][C]1.1986[/C][C]1.7029[/C][/ROW]
[ROW][C]60[/C][C]0.0442[/C][C]0.0091[/C][C]0.0201[/C][C]0.0203[/C][C]1986.6298[/C][C]11641.4006[/C][C]107.8953[/C][C]0.7245[/C][C]1.6139[/C][/ROW]
[ROW][C]61[/C][C]0.0468[/C][C]-0.0046[/C][C]0.0188[/C][C]0.019[/C][C]495.3385[/C][C]10712.5621[/C][C]103.5015[/C][C]-0.3618[/C][C]1.5096[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=300886&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=300886&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
500.01080.02480.02480.025115292.9994002.012.01
510.01560.00610.01540.0156892.78868092.89489.96050.48571.2478
520.01960.01110.0140.01412938.47546374.754479.84210.88111.1256
530.02340.02070.01570.015810277.96767350.557785.73541.64781.2562
540.02630.02860.01830.018520550.38079990.522399.95262.33011.4709
550.02990.03110.02040.020623560.610612252.2037110.68972.49491.6416
560.03310.03020.02180.022122115.600613661.2604116.88142.41721.7524
570.0360.0180.02130.02167669.122212912.2431113.63211.42341.7113
580.03820.02630.02190.022117333.367713403.4792115.77342.13991.7589
590.04150.01510.02120.02155437.464312606.8777112.28041.19861.7029
600.04420.00910.02010.02031986.629811641.4006107.89530.72451.6139
610.0468-0.00460.01880.019495.338510712.5621103.5015-0.36181.5096



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