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, 29 Dec 2010 19:30:26 +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/2010/Dec/29/t1293650918344kuobmsunoqrd.htm/, Retrieved Fri, 03 May 2024 08:00:08 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=117059, Retrieved Fri, 03 May 2024 08:00:08 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact107
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [Paper] [2010-12-23 08:13:53] [91de8b765895d6ee0c73f0d2e284be17]
- R PD    [ARIMA Forecasting] [] [2010-12-29 19:30:26] [5e4b6b538311b7e958647ef5010fb0e5] [Current]
Feedback Forum

Post a new message
Dataseries X:
1567
2237
2598
3729
5715
5776
5852
6878
5488
3583
2054
2282
1552
2261
2446
3519
5161
5085
5711
6057
5224
3363
1899
2115
1491
2061
2419
3430
4778
4862
6176
5664
5529
3418
1941
2402
1579
2146
2462
3695
4831
5134
6250
5760
6249
2917
1741
2359
1511
2059
2635
2867
4403
5720
4502
5749
5627
2846
1762
2429
1169
2154
2249
2687
4359
5382
4459
6398
4596
3024
1887
2070
1351
2218
2461
3028
4784
4975
4607
6249
4809
3157
1910
2228
1673
2589
2332
3785
4916
5207
6055
5751
5247
3387
2091
2401
1664
2205
2295
3762
4890
5117
6099
5865
5594
3229
2106
2410
1583
2092
2612
3665
4880
5875
5892
6078
6515
3164
2028
2677
1580
2196
2838
3087
4726
6521
6739
5943
6265
3323
2098
2544
1442
2307
2811
3461
5451
5481
5114
8381
5215
3700
2122
2311
1515
2351
2289
3380
5398
5242
5162
6391
5958
3727
1883
2191




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time7 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 7 seconds \tabularnewline
R Server & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117059&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]7 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117059&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117059&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 time7 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk







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[144])
1322544-------
1331442-------
1342307-------
1352811-------
1363461-------
1375451-------
1385481-------
1395114-------
1408381-------
1415215-------
1423700-------
1432122-------
1442311-------
14515151574.43041392.34611785.84980.290800.89020
14623512352.62872055.64972702.60950.496410.60080.5922
14722892594.81152258.86432992.53350.06590.88520.14330.919
14833803654.60953130.35074287.83710.197710.72551
14953985340.38184515.42426352.97060.45560.99990.41521
15052425448.7024596.42446497.82350.34970.53770.47591
15151625463.26514597.81086531.75120.29030.65760.73911
15263917087.07225901.6428570.02210.17880.99450.04361
15359585515.00834626.4176616.47380.21530.05950.70331
15437273477.11972957.82674109.74840.219400.24490.9998
15518832045.37031766.21952379.17380.170200.32640.0594
15621912386.81342049.69572792.70350.17220.99250.64290.6429

\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[144]) \tabularnewline
132 & 2544 & - & - & - & - & - & - & - \tabularnewline
133 & 1442 & - & - & - & - & - & - & - \tabularnewline
134 & 2307 & - & - & - & - & - & - & - \tabularnewline
135 & 2811 & - & - & - & - & - & - & - \tabularnewline
136 & 3461 & - & - & - & - & - & - & - \tabularnewline
137 & 5451 & - & - & - & - & - & - & - \tabularnewline
138 & 5481 & - & - & - & - & - & - & - \tabularnewline
139 & 5114 & - & - & - & - & - & - & - \tabularnewline
140 & 8381 & - & - & - & - & - & - & - \tabularnewline
141 & 5215 & - & - & - & - & - & - & - \tabularnewline
142 & 3700 & - & - & - & - & - & - & - \tabularnewline
143 & 2122 & - & - & - & - & - & - & - \tabularnewline
144 & 2311 & - & - & - & - & - & - & - \tabularnewline
145 & 1515 & 1574.4304 & 1392.3461 & 1785.8498 & 0.2908 & 0 & 0.8902 & 0 \tabularnewline
146 & 2351 & 2352.6287 & 2055.6497 & 2702.6095 & 0.4964 & 1 & 0.6008 & 0.5922 \tabularnewline
147 & 2289 & 2594.8115 & 2258.8643 & 2992.5335 & 0.0659 & 0.8852 & 0.1433 & 0.919 \tabularnewline
148 & 3380 & 3654.6095 & 3130.3507 & 4287.8371 & 0.1977 & 1 & 0.7255 & 1 \tabularnewline
149 & 5398 & 5340.3818 & 4515.4242 & 6352.9706 & 0.4556 & 0.9999 & 0.4152 & 1 \tabularnewline
150 & 5242 & 5448.702 & 4596.4244 & 6497.8235 & 0.3497 & 0.5377 & 0.4759 & 1 \tabularnewline
151 & 5162 & 5463.2651 & 4597.8108 & 6531.7512 & 0.2903 & 0.6576 & 0.7391 & 1 \tabularnewline
152 & 6391 & 7087.0722 & 5901.642 & 8570.0221 & 0.1788 & 0.9945 & 0.0436 & 1 \tabularnewline
153 & 5958 & 5515.0083 & 4626.417 & 6616.4738 & 0.2153 & 0.0595 & 0.7033 & 1 \tabularnewline
154 & 3727 & 3477.1197 & 2957.8267 & 4109.7484 & 0.2194 & 0 & 0.2449 & 0.9998 \tabularnewline
155 & 1883 & 2045.3703 & 1766.2195 & 2379.1738 & 0.1702 & 0 & 0.3264 & 0.0594 \tabularnewline
156 & 2191 & 2386.8134 & 2049.6957 & 2792.7035 & 0.1722 & 0.9925 & 0.6429 & 0.6429 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117059&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[144])[/C][/ROW]
[ROW][C]132[/C][C]2544[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]133[/C][C]1442[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]134[/C][C]2307[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]135[/C][C]2811[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]136[/C][C]3461[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]137[/C][C]5451[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]138[/C][C]5481[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]139[/C][C]5114[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]140[/C][C]8381[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]141[/C][C]5215[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]142[/C][C]3700[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]143[/C][C]2122[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]144[/C][C]2311[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]145[/C][C]1515[/C][C]1574.4304[/C][C]1392.3461[/C][C]1785.8498[/C][C]0.2908[/C][C]0[/C][C]0.8902[/C][C]0[/C][/ROW]
[ROW][C]146[/C][C]2351[/C][C]2352.6287[/C][C]2055.6497[/C][C]2702.6095[/C][C]0.4964[/C][C]1[/C][C]0.6008[/C][C]0.5922[/C][/ROW]
[ROW][C]147[/C][C]2289[/C][C]2594.8115[/C][C]2258.8643[/C][C]2992.5335[/C][C]0.0659[/C][C]0.8852[/C][C]0.1433[/C][C]0.919[/C][/ROW]
[ROW][C]148[/C][C]3380[/C][C]3654.6095[/C][C]3130.3507[/C][C]4287.8371[/C][C]0.1977[/C][C]1[/C][C]0.7255[/C][C]1[/C][/ROW]
[ROW][C]149[/C][C]5398[/C][C]5340.3818[/C][C]4515.4242[/C][C]6352.9706[/C][C]0.4556[/C][C]0.9999[/C][C]0.4152[/C][C]1[/C][/ROW]
[ROW][C]150[/C][C]5242[/C][C]5448.702[/C][C]4596.4244[/C][C]6497.8235[/C][C]0.3497[/C][C]0.5377[/C][C]0.4759[/C][C]1[/C][/ROW]
[ROW][C]151[/C][C]5162[/C][C]5463.2651[/C][C]4597.8108[/C][C]6531.7512[/C][C]0.2903[/C][C]0.6576[/C][C]0.7391[/C][C]1[/C][/ROW]
[ROW][C]152[/C][C]6391[/C][C]7087.0722[/C][C]5901.642[/C][C]8570.0221[/C][C]0.1788[/C][C]0.9945[/C][C]0.0436[/C][C]1[/C][/ROW]
[ROW][C]153[/C][C]5958[/C][C]5515.0083[/C][C]4626.417[/C][C]6616.4738[/C][C]0.2153[/C][C]0.0595[/C][C]0.7033[/C][C]1[/C][/ROW]
[ROW][C]154[/C][C]3727[/C][C]3477.1197[/C][C]2957.8267[/C][C]4109.7484[/C][C]0.2194[/C][C]0[/C][C]0.2449[/C][C]0.9998[/C][/ROW]
[ROW][C]155[/C][C]1883[/C][C]2045.3703[/C][C]1766.2195[/C][C]2379.1738[/C][C]0.1702[/C][C]0[/C][C]0.3264[/C][C]0.0594[/C][/ROW]
[ROW][C]156[/C][C]2191[/C][C]2386.8134[/C][C]2049.6957[/C][C]2792.7035[/C][C]0.1722[/C][C]0.9925[/C][C]0.6429[/C][C]0.6429[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117059&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117059&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[144])
1322544-------
1331442-------
1342307-------
1352811-------
1363461-------
1375451-------
1385481-------
1395114-------
1408381-------
1415215-------
1423700-------
1432122-------
1442311-------
14515151574.43041392.34611785.84980.290800.89020
14623512352.62872055.64972702.60950.496410.60080.5922
14722892594.81152258.86432992.53350.06590.88520.14330.919
14833803654.60953130.35074287.83710.197710.72551
14953985340.38184515.42426352.97060.45560.99990.41521
15052425448.7024596.42446497.82350.34970.53770.47591
15151625463.26514597.81086531.75120.29030.65760.73911
15263917087.07225901.6428570.02210.17880.99450.04361
15359585515.00834626.4176616.47380.21530.05950.70331
15437273477.11972957.82674109.74840.219400.24490.9998
15518832045.37031766.21952379.17380.170200.32640.0594
15621912386.81342049.69572792.70350.17220.99250.64290.6429







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1450.0685-0.037703531.97800
1460.0759-7e-040.01922.65281767.315442.0395
1470.0782-0.11790.052193520.68432351.7716179.866
1480.0884-0.07510.057975410.351943116.4167207.6449
1490.09670.01080.04843319.862635157.1059187.5023
1500.0982-0.03790.046742725.730836418.5433190.8364
1510.0998-0.05510.047990760.668144181.704210.1944
1520.1068-0.09820.0542484516.498399223.5533314.9977
1530.10190.08030.0571196241.6234110003.3389331.6675
1540.09280.07190.058662440.1515105247.0201324.418
1550.0833-0.07940.060526364.128198075.8481313.1706
1560.0868-0.0820.062338342.885793098.1013305.1198

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
145 & 0.0685 & -0.0377 & 0 & 3531.978 & 0 & 0 \tabularnewline
146 & 0.0759 & -7e-04 & 0.0192 & 2.6528 & 1767.3154 & 42.0395 \tabularnewline
147 & 0.0782 & -0.1179 & 0.0521 & 93520.684 & 32351.7716 & 179.866 \tabularnewline
148 & 0.0884 & -0.0751 & 0.0579 & 75410.3519 & 43116.4167 & 207.6449 \tabularnewline
149 & 0.0967 & 0.0108 & 0.0484 & 3319.8626 & 35157.1059 & 187.5023 \tabularnewline
150 & 0.0982 & -0.0379 & 0.0467 & 42725.7308 & 36418.5433 & 190.8364 \tabularnewline
151 & 0.0998 & -0.0551 & 0.0479 & 90760.6681 & 44181.704 & 210.1944 \tabularnewline
152 & 0.1068 & -0.0982 & 0.0542 & 484516.4983 & 99223.5533 & 314.9977 \tabularnewline
153 & 0.1019 & 0.0803 & 0.0571 & 196241.6234 & 110003.3389 & 331.6675 \tabularnewline
154 & 0.0928 & 0.0719 & 0.0586 & 62440.1515 & 105247.0201 & 324.418 \tabularnewline
155 & 0.0833 & -0.0794 & 0.0605 & 26364.1281 & 98075.8481 & 313.1706 \tabularnewline
156 & 0.0868 & -0.082 & 0.0623 & 38342.8857 & 93098.1013 & 305.1198 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=117059&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]Sq.E[/C][C]MSE[/C][C]RMSE[/C][/ROW]
[ROW][C]145[/C][C]0.0685[/C][C]-0.0377[/C][C]0[/C][C]3531.978[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]146[/C][C]0.0759[/C][C]-7e-04[/C][C]0.0192[/C][C]2.6528[/C][C]1767.3154[/C][C]42.0395[/C][/ROW]
[ROW][C]147[/C][C]0.0782[/C][C]-0.1179[/C][C]0.0521[/C][C]93520.684[/C][C]32351.7716[/C][C]179.866[/C][/ROW]
[ROW][C]148[/C][C]0.0884[/C][C]-0.0751[/C][C]0.0579[/C][C]75410.3519[/C][C]43116.4167[/C][C]207.6449[/C][/ROW]
[ROW][C]149[/C][C]0.0967[/C][C]0.0108[/C][C]0.0484[/C][C]3319.8626[/C][C]35157.1059[/C][C]187.5023[/C][/ROW]
[ROW][C]150[/C][C]0.0982[/C][C]-0.0379[/C][C]0.0467[/C][C]42725.7308[/C][C]36418.5433[/C][C]190.8364[/C][/ROW]
[ROW][C]151[/C][C]0.0998[/C][C]-0.0551[/C][C]0.0479[/C][C]90760.6681[/C][C]44181.704[/C][C]210.1944[/C][/ROW]
[ROW][C]152[/C][C]0.1068[/C][C]-0.0982[/C][C]0.0542[/C][C]484516.4983[/C][C]99223.5533[/C][C]314.9977[/C][/ROW]
[ROW][C]153[/C][C]0.1019[/C][C]0.0803[/C][C]0.0571[/C][C]196241.6234[/C][C]110003.3389[/C][C]331.6675[/C][/ROW]
[ROW][C]154[/C][C]0.0928[/C][C]0.0719[/C][C]0.0586[/C][C]62440.1515[/C][C]105247.0201[/C][C]324.418[/C][/ROW]
[ROW][C]155[/C][C]0.0833[/C][C]-0.0794[/C][C]0.0605[/C][C]26364.1281[/C][C]98075.8481[/C][C]313.1706[/C][/ROW]
[ROW][C]156[/C][C]0.0868[/C][C]-0.082[/C][C]0.0623[/C][C]38342.8857[/C][C]93098.1013[/C][C]305.1198[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=117059&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=117059&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.PEMAPESq.EMSERMSE
1450.0685-0.037703531.97800
1460.0759-7e-040.01922.65281767.315442.0395
1470.0782-0.11790.052193520.68432351.7716179.866
1480.0884-0.07510.057975410.351943116.4167207.6449
1490.09670.01080.04843319.862635157.1059187.5023
1500.0982-0.03790.046742725.730836418.5433190.8364
1510.0998-0.05510.047990760.668144181.704210.1944
1520.1068-0.09820.0542484516.498399223.5533314.9977
1530.10190.08030.0571196241.6234110003.3389331.6675
1540.09280.07190.058662440.1515105247.0201324.418
1550.0833-0.07940.060526364.128198075.8481313.1706
1560.0868-0.0820.062338342.885793098.1013305.1198



Parameters (Session):
par1 = 12 ; par2 = -0.2 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; par8 = 2 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = -0.2 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 1 ; 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
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.mape <- array(0, dim=fx)
perf.mape1 <- 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)
for (i in 1:fx) {
locSD <- (ub[i] - forecast$pred[i]) / 1.96
perf.pe[i] = (x[nx+i] - forecast$pred[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.mse[1] = abs(perf.se[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.mse[i] = perf.mse[i-1] + perf.se[i]
perf.mse1[i] = perf.mse[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',7,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,'Sq.E',1,header=TRUE)
a<-table.element(a,'MSE',1,header=TRUE)
a<-table.element(a,'RMSE',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.se[i],4))
a<-table.element(a,round(perf.mse1[i],4))
a<-table.element(a,round(perf.rmse[i],4))
a<-table.row.end(a)
}
a<-table.end(a)
table.save(a,file='mytable1.tab')