Free Statistics

of Irreproducible Research!

Author's title

Author*The author of this computation has been verified*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 22 Jan 2016 09:41:52 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2016/Jan/22/t14534557251yy3g1edeg5oqwn.htm/, Retrieved Tue, 07 May 2024 08:09:25 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=290970, Retrieved Tue, 07 May 2024 08:09:25 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact56
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [vraag 11] [2016-01-22 09:41:52] [f5873c2f4f82c50a280588900254fbac] [Current]
Feedback Forum

Post a new message
Dataseries X:
3035
2552
2704
2554
2014
1655
1721
1524
1596
2074
2199
2512
2933
2889
2938
2497
1870
1726
1607
1545
1396
1787
2076
2837
2787
3891
3179
2011
1636
1580
1489
1300
1356
1653
2013
2823
3102
2294
2385
2444
1748
1554
1498
1361
1346
1564
1640
2293
2815
3137
2679
1969
1870
1633
1529
1366
1357
1570
1535
2491
3084
2605
2573
2143
1693
1504
1461
1354
1333
1492
1781
1915




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net

\begin{tabular}{lllllllll}
\hline
Summary of computational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 3 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=290970&T=0

[TABLE]
[ROW][C]Summary of computational transaction[/C][/ROW]
[ROW][C]Raw Input[/C][C]view raw input (R code) [/C][/ROW]
[ROW][C]Raw Output[/C][C]view raw output of R engine [/C][/ROW]
[ROW][C]Computing time[/C][C]3 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gertrude Mary Cox' @ cox.wessa.net[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=290970&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=290970&T=0

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time3 seconds
R Server'Gertrude Mary Cox' @ cox.wessa.net







Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[60])
482293-------
492815-------
503137-------
512679-------
521969-------
531870-------
541633-------
551529-------
561366-------
571357-------
581570-------
591535-------
602491-------
6130842823.44152357.5353289.34790.13650.9190.51420.919
6226052739.07942195.35473282.80410.31440.10690.07570.8144
6325732620.16572075.17423165.15710.43270.52170.41620.6789
6421432221.42931676.49832766.36020.38890.1030.8180.1661
6516931641.80981094.54972189.06980.42730.03630.20690.0012
6615041486.9333935.56882038.29780.47580.23190.30182e-04
6714611441.4746886.67831996.27080.47250.41260.37861e-04
6813541309.7367752.15811867.31530.43820.29750.42160
6913331296.5719736.41751856.72630.44930.42040.41630
7014921637.45161074.87442200.02870.30620.85560.59290.0015
7117811894.63011329.52292459.73730.34670.91870.89390.0193
7219152525.99921959.51813092.48040.01730.9950.54820.5482

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast \tabularnewline
time & Y[t] & F[t] & 95% LB & 95% UB & p-value(H0: Y[t] = F[t]) & P(F[t]>Y[t-1]) & P(F[t]>Y[t-s]) & P(F[t]>Y[60]) \tabularnewline
48 & 2293 & - & - & - & - & - & - & - \tabularnewline
49 & 2815 & - & - & - & - & - & - & - \tabularnewline
50 & 3137 & - & - & - & - & - & - & - \tabularnewline
51 & 2679 & - & - & - & - & - & - & - \tabularnewline
52 & 1969 & - & - & - & - & - & - & - \tabularnewline
53 & 1870 & - & - & - & - & - & - & - \tabularnewline
54 & 1633 & - & - & - & - & - & - & - \tabularnewline
55 & 1529 & - & - & - & - & - & - & - \tabularnewline
56 & 1366 & - & - & - & - & - & - & - \tabularnewline
57 & 1357 & - & - & - & - & - & - & - \tabularnewline
58 & 1570 & - & - & - & - & - & - & - \tabularnewline
59 & 1535 & - & - & - & - & - & - & - \tabularnewline
60 & 2491 & - & - & - & - & - & - & - \tabularnewline
61 & 3084 & 2823.4415 & 2357.535 & 3289.3479 & 0.1365 & 0.919 & 0.5142 & 0.919 \tabularnewline
62 & 2605 & 2739.0794 & 2195.3547 & 3282.8041 & 0.3144 & 0.1069 & 0.0757 & 0.8144 \tabularnewline
63 & 2573 & 2620.1657 & 2075.1742 & 3165.1571 & 0.4327 & 0.5217 & 0.4162 & 0.6789 \tabularnewline
64 & 2143 & 2221.4293 & 1676.4983 & 2766.3602 & 0.3889 & 0.103 & 0.818 & 0.1661 \tabularnewline
65 & 1693 & 1641.8098 & 1094.5497 & 2189.0698 & 0.4273 & 0.0363 & 0.2069 & 0.0012 \tabularnewline
66 & 1504 & 1486.9333 & 935.5688 & 2038.2978 & 0.4758 & 0.2319 & 0.3018 & 2e-04 \tabularnewline
67 & 1461 & 1441.4746 & 886.6783 & 1996.2708 & 0.4725 & 0.4126 & 0.3786 & 1e-04 \tabularnewline
68 & 1354 & 1309.7367 & 752.1581 & 1867.3153 & 0.4382 & 0.2975 & 0.4216 & 0 \tabularnewline
69 & 1333 & 1296.5719 & 736.4175 & 1856.7263 & 0.4493 & 0.4204 & 0.4163 & 0 \tabularnewline
70 & 1492 & 1637.4516 & 1074.8744 & 2200.0287 & 0.3062 & 0.8556 & 0.5929 & 0.0015 \tabularnewline
71 & 1781 & 1894.6301 & 1329.5229 & 2459.7373 & 0.3467 & 0.9187 & 0.8939 & 0.0193 \tabularnewline
72 & 1915 & 2525.9992 & 1959.5181 & 3092.4804 & 0.0173 & 0.995 & 0.5482 & 0.5482 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=290970&T=1

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast[/C][/ROW]
[ROW][C]time[/C][C]Y[t][/C][C]F[t][/C][C]95% LB[/C][C]95% UB[/C][C]p-value(H0: Y[t] = F[t])[/C][C]P(F[t]>Y[t-1])[/C][C]P(F[t]>Y[t-s])[/C][C]P(F[t]>Y[60])[/C][/ROW]
[ROW][C]48[/C][C]2293[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2815[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]3137[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]2679[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]1969[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]1870[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]1633[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]1529[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]1366[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]1357[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]1570[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]1535[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]2491[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]3084[/C][C]2823.4415[/C][C]2357.535[/C][C]3289.3479[/C][C]0.1365[/C][C]0.919[/C][C]0.5142[/C][C]0.919[/C][/ROW]
[ROW][C]62[/C][C]2605[/C][C]2739.0794[/C][C]2195.3547[/C][C]3282.8041[/C][C]0.3144[/C][C]0.1069[/C][C]0.0757[/C][C]0.8144[/C][/ROW]
[ROW][C]63[/C][C]2573[/C][C]2620.1657[/C][C]2075.1742[/C][C]3165.1571[/C][C]0.4327[/C][C]0.5217[/C][C]0.4162[/C][C]0.6789[/C][/ROW]
[ROW][C]64[/C][C]2143[/C][C]2221.4293[/C][C]1676.4983[/C][C]2766.3602[/C][C]0.3889[/C][C]0.103[/C][C]0.818[/C][C]0.1661[/C][/ROW]
[ROW][C]65[/C][C]1693[/C][C]1641.8098[/C][C]1094.5497[/C][C]2189.0698[/C][C]0.4273[/C][C]0.0363[/C][C]0.2069[/C][C]0.0012[/C][/ROW]
[ROW][C]66[/C][C]1504[/C][C]1486.9333[/C][C]935.5688[/C][C]2038.2978[/C][C]0.4758[/C][C]0.2319[/C][C]0.3018[/C][C]2e-04[/C][/ROW]
[ROW][C]67[/C][C]1461[/C][C]1441.4746[/C][C]886.6783[/C][C]1996.2708[/C][C]0.4725[/C][C]0.4126[/C][C]0.3786[/C][C]1e-04[/C][/ROW]
[ROW][C]68[/C][C]1354[/C][C]1309.7367[/C][C]752.1581[/C][C]1867.3153[/C][C]0.4382[/C][C]0.2975[/C][C]0.4216[/C][C]0[/C][/ROW]
[ROW][C]69[/C][C]1333[/C][C]1296.5719[/C][C]736.4175[/C][C]1856.7263[/C][C]0.4493[/C][C]0.4204[/C][C]0.4163[/C][C]0[/C][/ROW]
[ROW][C]70[/C][C]1492[/C][C]1637.4516[/C][C]1074.8744[/C][C]2200.0287[/C][C]0.3062[/C][C]0.8556[/C][C]0.5929[/C][C]0.0015[/C][/ROW]
[ROW][C]71[/C][C]1781[/C][C]1894.6301[/C][C]1329.5229[/C][C]2459.7373[/C][C]0.3467[/C][C]0.9187[/C][C]0.8939[/C][C]0.0193[/C][/ROW]
[ROW][C]72[/C][C]1915[/C][C]2525.9992[/C][C]1959.5181[/C][C]3092.4804[/C][C]0.0173[/C][C]0.995[/C][C]0.5482[/C][C]0.5482[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=290970&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=290970&T=1

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast
timeY[t]F[t]95% LB95% UBp-value(H0: Y[t] = F[t])P(F[t]>Y[t-1])P(F[t]>Y[t-s])P(F[t]>Y[60])
482293-------
492815-------
503137-------
512679-------
521969-------
531870-------
541633-------
551529-------
561366-------
571357-------
581570-------
591535-------
602491-------
6130842823.44152357.5353289.34790.13650.9190.51420.919
6226052739.07942195.35473282.80410.31440.10690.07570.8144
6325732620.16572075.17423165.15710.43270.52170.41620.6789
6421432221.42931676.49832766.36020.38890.1030.8180.1661
6516931641.80981094.54972189.06980.42730.03630.20690.0012
6615041486.9333935.56882038.29780.47580.23190.30182e-04
6714611441.4746886.67831996.27080.47250.41260.37861e-04
6813541309.7367752.15811867.31530.43820.29750.42160
6913331296.5719736.41751856.72630.44930.42040.41630
7014921637.45161074.87442200.02870.30620.85560.59290.0015
7117811894.63011329.52292459.73730.34670.91870.89390.0193
7219152525.99921959.51813092.48040.01730.9950.54820.5482







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
610.08420.08450.08450.088267890.7539001.22851.2285
620.1013-0.05150.0680.069217977.292242934.023207.2053-0.63220.9304
630.1061-0.01830.05140.05222224.598829364.215171.3599-0.22240.6944
640.1252-0.03660.04770.04816151.1523560.9487153.4958-0.36980.6132
650.17010.03020.04420.04462620.441419372.8473139.18640.24140.5388
660.18920.01130.03870.0391291.270916192.5845127.25010.08050.4625
670.19640.01340.03510.0354381.242513933.8214118.04160.09210.4095
680.21720.03270.03480.03521959.242512436.999111.52130.20870.3844
690.22040.02730.0340.03431327.006611202.5554105.84210.17180.3608
700.1753-0.09750.04030.040221156.163112197.9162110.4442-0.68580.3933
710.1522-0.06380.04250.042212911.792312262.814110.7376-0.53580.4063
720.1144-0.31910.06550.0616373320.053342350.9173205.7934-2.88080.6125

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & sMAPE & Sq.E & MSE & RMSE & ScaledE & MASE \tabularnewline
61 & 0.0842 & 0.0845 & 0.0845 & 0.0882 & 67890.7539 & 0 & 0 & 1.2285 & 1.2285 \tabularnewline
62 & 0.1013 & -0.0515 & 0.068 & 0.0692 & 17977.2922 & 42934.023 & 207.2053 & -0.6322 & 0.9304 \tabularnewline
63 & 0.1061 & -0.0183 & 0.0514 & 0.0522 & 2224.5988 & 29364.215 & 171.3599 & -0.2224 & 0.6944 \tabularnewline
64 & 0.1252 & -0.0366 & 0.0477 & 0.0481 & 6151.15 & 23560.9487 & 153.4958 & -0.3698 & 0.6132 \tabularnewline
65 & 0.1701 & 0.0302 & 0.0442 & 0.0446 & 2620.4414 & 19372.8473 & 139.1864 & 0.2414 & 0.5388 \tabularnewline
66 & 0.1892 & 0.0113 & 0.0387 & 0.0391 & 291.2709 & 16192.5845 & 127.2501 & 0.0805 & 0.4625 \tabularnewline
67 & 0.1964 & 0.0134 & 0.0351 & 0.0354 & 381.2425 & 13933.8214 & 118.0416 & 0.0921 & 0.4095 \tabularnewline
68 & 0.2172 & 0.0327 & 0.0348 & 0.0352 & 1959.2425 & 12436.999 & 111.5213 & 0.2087 & 0.3844 \tabularnewline
69 & 0.2204 & 0.0273 & 0.034 & 0.0343 & 1327.0066 & 11202.5554 & 105.8421 & 0.1718 & 0.3608 \tabularnewline
70 & 0.1753 & -0.0975 & 0.0403 & 0.0402 & 21156.1631 & 12197.9162 & 110.4442 & -0.6858 & 0.3933 \tabularnewline
71 & 0.1522 & -0.0638 & 0.0425 & 0.0422 & 12911.7923 & 12262.814 & 110.7376 & -0.5358 & 0.4063 \tabularnewline
72 & 0.1144 & -0.3191 & 0.0655 & 0.0616 & 373320.0533 & 42350.9173 & 205.7934 & -2.8808 & 0.6125 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=290970&T=2

[TABLE]
[ROW][C]Univariate ARIMA Extrapolation Forecast Performance[/C][/ROW]
[ROW][C]time[/C][C]% S.E.[/C][C]PE[/C][C]MAPE[/C][C]sMAPE[/C][C]Sq.E[/C][C]MSE[/C][C]RMSE[/C][C]ScaledE[/C][C]MASE[/C][/ROW]
[ROW][C]61[/C][C]0.0842[/C][C]0.0845[/C][C]0.0845[/C][C]0.0882[/C][C]67890.7539[/C][C]0[/C][C]0[/C][C]1.2285[/C][C]1.2285[/C][/ROW]
[ROW][C]62[/C][C]0.1013[/C][C]-0.0515[/C][C]0.068[/C][C]0.0692[/C][C]17977.2922[/C][C]42934.023[/C][C]207.2053[/C][C]-0.6322[/C][C]0.9304[/C][/ROW]
[ROW][C]63[/C][C]0.1061[/C][C]-0.0183[/C][C]0.0514[/C][C]0.0522[/C][C]2224.5988[/C][C]29364.215[/C][C]171.3599[/C][C]-0.2224[/C][C]0.6944[/C][/ROW]
[ROW][C]64[/C][C]0.1252[/C][C]-0.0366[/C][C]0.0477[/C][C]0.0481[/C][C]6151.15[/C][C]23560.9487[/C][C]153.4958[/C][C]-0.3698[/C][C]0.6132[/C][/ROW]
[ROW][C]65[/C][C]0.1701[/C][C]0.0302[/C][C]0.0442[/C][C]0.0446[/C][C]2620.4414[/C][C]19372.8473[/C][C]139.1864[/C][C]0.2414[/C][C]0.5388[/C][/ROW]
[ROW][C]66[/C][C]0.1892[/C][C]0.0113[/C][C]0.0387[/C][C]0.0391[/C][C]291.2709[/C][C]16192.5845[/C][C]127.2501[/C][C]0.0805[/C][C]0.4625[/C][/ROW]
[ROW][C]67[/C][C]0.1964[/C][C]0.0134[/C][C]0.0351[/C][C]0.0354[/C][C]381.2425[/C][C]13933.8214[/C][C]118.0416[/C][C]0.0921[/C][C]0.4095[/C][/ROW]
[ROW][C]68[/C][C]0.2172[/C][C]0.0327[/C][C]0.0348[/C][C]0.0352[/C][C]1959.2425[/C][C]12436.999[/C][C]111.5213[/C][C]0.2087[/C][C]0.3844[/C][/ROW]
[ROW][C]69[/C][C]0.2204[/C][C]0.0273[/C][C]0.034[/C][C]0.0343[/C][C]1327.0066[/C][C]11202.5554[/C][C]105.8421[/C][C]0.1718[/C][C]0.3608[/C][/ROW]
[ROW][C]70[/C][C]0.1753[/C][C]-0.0975[/C][C]0.0403[/C][C]0.0402[/C][C]21156.1631[/C][C]12197.9162[/C][C]110.4442[/C][C]-0.6858[/C][C]0.3933[/C][/ROW]
[ROW][C]71[/C][C]0.1522[/C][C]-0.0638[/C][C]0.0425[/C][C]0.0422[/C][C]12911.7923[/C][C]12262.814[/C][C]110.7376[/C][C]-0.5358[/C][C]0.4063[/C][/ROW]
[ROW][C]72[/C][C]0.1144[/C][C]-0.3191[/C][C]0.0655[/C][C]0.0616[/C][C]373320.0533[/C][C]42350.9173[/C][C]205.7934[/C][C]-2.8808[/C][C]0.6125[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=290970&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=290970&T=2

As an alternative you can also use a QR Code:  

The GUIDs for individual cells are displayed in the table below:

Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPEsMAPESq.EMSERMSEScaledEMASE
610.08420.08450.08450.088267890.7539001.22851.2285
620.1013-0.05150.0680.069217977.292242934.023207.2053-0.63220.9304
630.1061-0.01830.05140.05222224.598829364.215171.3599-0.22240.6944
640.1252-0.03660.04770.04816151.1523560.9487153.4958-0.36980.6132
650.17010.03020.04420.04462620.441419372.8473139.18640.24140.5388
660.18920.01130.03870.0391291.270916192.5845127.25010.08050.4625
670.19640.01340.03510.0354381.242513933.8214118.04160.09210.4095
680.21720.03270.03480.03521959.242512436.999111.52130.20870.3844
690.22040.02730.0340.03431327.006611202.5554105.84210.17180.3608
700.1753-0.09750.04030.040221156.163112197.9162110.4442-0.68580.3933
710.1522-0.06380.04250.042212911.792312262.814110.7376-0.53580.4063
720.1144-0.31910.06550.0616373320.053342350.9173205.7934-2.88080.6125



Parameters (Session):
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 0 ; par5 = 12 ; par6 = 3 ; par7 = 2 ; par8 = 2 ; par9 = 1 ; par10 = FALSE ;
R code (references can be found in the software module):
par10 <- 'FALSE'
par9 <- '1'
par8 <- '2'
par7 <- '2'
par6 <- '3'
par5 <- '12'
par4 <- '0'
par3 <- '0'
par2 <- '1'
par1 <- '0'
par1 <- as.numeric(par1) #cut off periods
par2 <- as.numeric(par2) #lambda
par3 <- as.numeric(par3) #degree of non-seasonal differencing
par4 <- as.numeric(par4) #degree of seasonal differencing
par5 <- as.numeric(par5) #seasonal period
par6 <- as.numeric(par6) #p
par7 <- as.numeric(par7) #q
par8 <- as.numeric(par8) #P
par9 <- as.numeric(par9) #Q
if (par10 == 'TRUE') par10 <- TRUE
if (par10 == 'FALSE') par10 <- FALSE
if (par2 == 0) x <- log(x)
if (par2 != 0) x <- x^par2
lx <- length(x)
first <- lx - 2*par1
nx <- lx - par1
nx1 <- nx + 1
fx <- lx - nx
if (fx < 1) {
fx <- par5
nx1 <- lx + fx - 1
first <- lx - 2*fx
}
first <- 1
if (fx < 3) fx <- round(lx/10,0)
(arima.out <- arima(x[1:nx], order=c(par6,par3,par7), seasonal=list(order=c(par8,par4,par9), period=par5), include.mean=par10, method='ML'))
(forecast <- predict(arima.out,par1))
(lb <- forecast$pred - 1.96 * forecast$se)
(ub <- forecast$pred + 1.96 * forecast$se)
if (par2 == 0) {
x <- exp(x)
forecast$pred <- exp(forecast$pred)
lb <- exp(lb)
ub <- exp(ub)
}
if (par2 != 0) {
x <- x^(1/par2)
forecast$pred <- forecast$pred^(1/par2)
lb <- lb^(1/par2)
ub <- ub^(1/par2)
}
if (par2 < 0) {
olb <- lb
lb <- ub
ub <- olb
}
(actandfor <- c(x[1:nx], forecast$pred))
(perc.se <- (ub-forecast$pred)/1.96/forecast$pred)
bitmap(file='test1.png')
opar <- par(mar=c(4,4,2,2),las=1)
ylim <- c( min(x[first:nx],lb), max(x[first:nx],ub))
plot(x,ylim=ylim,type='n',xlim=c(first,lx))
usr <- par('usr')
rect(usr[1],usr[3],nx+1,usr[4],border=NA,col='lemonchiffon')
rect(nx1,usr[3],usr[2],usr[4],border=NA,col='lavender')
abline(h= (-3:3)*2 , col ='gray', lty =3)
polygon( c(nx1:lx,lx:nx1), c(lb,rev(ub)), col = 'orange', lty=2,border=NA)
lines(nx1:lx, lb , lty=2)
lines(nx1:lx, ub , lty=2)
lines(x, lwd=2)
lines(nx1:lx, forecast$pred , lwd=2 , col ='white')
box()
par(opar)
dev.off()
prob.dec <- array(NA, dim=fx)
prob.sdec <- array(NA, dim=fx)
prob.ldec <- array(NA, dim=fx)
prob.pval <- array(NA, dim=fx)
perf.pe <- array(0, dim=fx)
perf.spe <- array(0, dim=fx)
perf.scalederr <- array(0, dim=fx)
perf.mase <- array(0, dim=fx)
perf.mase1 <- array(0, dim=fx)
perf.mape <- array(0, dim=fx)
perf.smape <- array(0, dim=fx)
perf.mape1 <- array(0, dim=fx)
perf.smape1 <- array(0,dim=fx)
perf.se <- array(0, dim=fx)
perf.mse <- array(0, dim=fx)
perf.mse1 <- array(0, dim=fx)
perf.rmse <- array(0, dim=fx)
perf.scaleddenom <- 0
for (i in 2:fx) {
perf.scaleddenom = perf.scaleddenom + abs(x[nx+i] - x[nx+i-1])
}
perf.scaleddenom = perf.scaleddenom / (fx-1)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.scalederr[i] = (x[nx+i] - forecast$pred[i]) / perf.scaleddenom
perf.pe[i] = (x[nx+i] - forecast$pred[i]) / x[nx+i]
perf.spe[i] = 2*(x[nx+i] - forecast$pred[i]) / (x[nx+i] + forecast$pred[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
prob.dec[i] = pnorm((x[nx+i-1] - forecast$pred[i]) / locSD)
prob.sdec[i] = pnorm((x[nx+i-par5] - forecast$pred[i]) / locSD)
prob.ldec[i] = pnorm((x[nx] - forecast$pred[i]) / locSD)
prob.pval[i] = pnorm(abs(x[nx+i] - forecast$pred[i]) / locSD)
}
perf.mape[1] = abs(perf.pe[1])
perf.smape[1] = abs(perf.spe[1])
perf.mape1[1] = perf.mape[1]
perf.smape1[1] = perf.smape[1]
perf.mse[1] = perf.se[1]
perf.mase[1] = abs(perf.scalederr[1])
perf.mase1[1] = perf.mase[1]
for (i in 2:fx) {
perf.mape[i] = perf.mape[i-1] + abs(perf.pe[i])
perf.mape1[i] = perf.mape[i] / i
perf.smape[i] = perf.smape[i-1] + abs(perf.spe[i])
perf.smape1[i] = perf.smape[i] / i
perf.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[i] / i
perf.mase[i] = perf.mase[i-1] + abs(perf.scalederr[i])
perf.mase1[i] = perf.mase[i] / i
}
perf.rmse = sqrt(perf.mse1)
bitmap(file='test2.png')
plot(forecast$pred, pch=19, type='b',main='ARIMA Extrapolation Forecast', ylab='Forecast and 95% CI', xlab='time',ylim=c(min(lb),max(ub)))
dum <- forecast$pred
dum[1:par1] <- x[(nx+1):lx]
lines(dum, lty=1)
lines(ub,lty=3)
lines(lb,lty=3)
dev.off()
load(file='createtable')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast',9,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'Y[t]',1,header=TRUE)
a<-table.element(a,'F[t]',1,header=TRUE)
a<-table.element(a,'95% LB',1,header=TRUE)
a<-table.element(a,'95% UB',1,header=TRUE)
a<-table.element(a,'p-value
(H0: Y[t] = F[t])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-1])',1,header=TRUE)
a<-table.element(a,'P(F[t]>Y[t-s])',1,header=TRUE)
mylab <- paste('P(F[t]>Y[',nx,sep='')
mylab <- paste(mylab,'])',sep='')
a<-table.element(a,mylab,1,header=TRUE)
a<-table.row.end(a)
for (i in (nx-par5):nx) {
a<-table.row.start(a)
a<-table.element(a,i,header=TRUE)
a<-table.element(a,x[i])
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.element(a,'-')
a<-table.row.end(a)
}
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(x[nx+i],4))
a<-table.element(a,round(forecast$pred[i],4))
a<-table.element(a,round(lb[i],4))
a<-table.element(a,round(ub[i],4))
a<-table.element(a,round((1-prob.pval[i]),4))
a<-table.element(a,round((1-prob.dec[i]),4))
a<-table.element(a,round((1-prob.sdec[i]),4))
a<-table.element(a,round((1-prob.ldec[i]),4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable.tab')
a<-table.start()
a<-table.row.start(a)
a<-table.element(a,'Univariate ARIMA Extrapolation Forecast Performance',10,TRUE)
a<-table.row.end(a)
a<-table.row.start(a)
a<-table.element(a,'time',1,header=TRUE)
a<-table.element(a,'% S.E.',1,header=TRUE)
a<-table.element(a,'PE',1,header=TRUE)
a<-table.element(a,'MAPE',1,header=TRUE)
a<-table.element(a,'sMAPE',1,header=TRUE)
a<-table.element(a,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',1,header=TRUE)
a<-table.element(a,'ScaledE',1,header=TRUE)
a<-table.element(a,'MASE',1,header=TRUE)
a<-table.row.end(a)
for (i in 1:fx) {
a<-table.row.start(a)
a<-table.element(a,nx+i,header=TRUE)
a<-table.element(a,round(perc.se[i],4))
a<-table.element(a,round(perf.pe[i],4))
a<-table.element(a,round(perf.mape1[i],4))
a<-table.element(a,round(perf.smape1[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.element(a,round(perf.scalederr[i],4))
a<-table.element(a,round(perf.mase1[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')