Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationMon, 28 Dec 2009 12:18:14 -0700
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2009/Dec/28/t1262027925mrrok7vcefns2sj.htm/, Retrieved Sat, 04 May 2024 22:23:19 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=71040, Retrieved Sat, 04 May 2024 22:23:19 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact143
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [estimation of ARM...] [2007-12-06 10:08:23] [dc28704e2f48edede7e5c93fa6811a5e]
- RMPD    [ARIMA Forecasting] [forecasting] [2009-12-28 19:18:14] [40c1a6696fd12c035173887b10978c8d] [Current]
Feedback Forum

Post a new message
Dataseries X:
2756.76
2849.27
2921.44
2981.85
3080.58
3106.22
3119.31
3061.26
3097.31
3161.69
3257.16
3277.01
3295.32
3363.99
3494.17
3667.03
3813.06
3917.96
3895.51
3801.06
3570.12
3701.61
3862.27
3970.10
4138.52
4199.75
4290.89
4443.91
4502.64
4356.98
4591.27
4696.96
4621.40
4562.84
4202.52
4296.49
4435.23
4105.18
4116.68
3844.49
3720.98
3674.40
3857.62
3801.06
3504.37
3032.60
3047.03
2962.34
2197.82
2014.45
1862.83
1905.41
1810.99
1670.07
1864.44
2052.02
2029.60
2070.83
2293.41
2443.27




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135

\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 & 2 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71040&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]2 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'Gwilym Jenkins' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71040&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71040&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 time2 seconds
R Server'Gwilym Jenkins' @ 72.249.127.135







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[48])
364296.49-------
374435.23-------
384105.18-------
394116.68-------
403844.49-------
413720.98-------
423674.4-------
433857.62-------
443801.06-------
453504.37-------
463032.6-------
473047.03-------
482962.34-------
492197.822941.19362647.84693234.540400.443800.4438
502014.452935.91362466.40033405.42691e-040.99900.4561
511862.832934.59522327.48993541.70043e-040.99851e-040.4643
521905.412934.2662212.98463655.54740.00260.99820.00670.4696
531810.992934.18382113.9363754.43160.00360.9930.030.4732
541670.072934.16332025.54433842.78230.00320.99230.05520.4758
551864.442934.15811945.00393923.31240.0170.99390.03360.4777
562052.022934.15691870.54153997.77220.0520.97570.05510.4793
572029.62934.15661800.96084067.35230.05880.93650.1620.4806
582070.832934.15651735.4124132.9010.0790.93040.43610.4816
592293.412934.15651673.26614195.04680.15960.91020.43040.4825
602443.272934.15641614.04264254.27030.23310.82930.48330.4833

\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[48]) \tabularnewline
36 & 4296.49 & - & - & - & - & - & - & - \tabularnewline
37 & 4435.23 & - & - & - & - & - & - & - \tabularnewline
38 & 4105.18 & - & - & - & - & - & - & - \tabularnewline
39 & 4116.68 & - & - & - & - & - & - & - \tabularnewline
40 & 3844.49 & - & - & - & - & - & - & - \tabularnewline
41 & 3720.98 & - & - & - & - & - & - & - \tabularnewline
42 & 3674.4 & - & - & - & - & - & - & - \tabularnewline
43 & 3857.62 & - & - & - & - & - & - & - \tabularnewline
44 & 3801.06 & - & - & - & - & - & - & - \tabularnewline
45 & 3504.37 & - & - & - & - & - & - & - \tabularnewline
46 & 3032.6 & - & - & - & - & - & - & - \tabularnewline
47 & 3047.03 & - & - & - & - & - & - & - \tabularnewline
48 & 2962.34 & - & - & - & - & - & - & - \tabularnewline
49 & 2197.82 & 2941.1936 & 2647.8469 & 3234.5404 & 0 & 0.4438 & 0 & 0.4438 \tabularnewline
50 & 2014.45 & 2935.9136 & 2466.4003 & 3405.4269 & 1e-04 & 0.999 & 0 & 0.4561 \tabularnewline
51 & 1862.83 & 2934.5952 & 2327.4899 & 3541.7004 & 3e-04 & 0.9985 & 1e-04 & 0.4643 \tabularnewline
52 & 1905.41 & 2934.266 & 2212.9846 & 3655.5474 & 0.0026 & 0.9982 & 0.0067 & 0.4696 \tabularnewline
53 & 1810.99 & 2934.1838 & 2113.936 & 3754.4316 & 0.0036 & 0.993 & 0.03 & 0.4732 \tabularnewline
54 & 1670.07 & 2934.1633 & 2025.5443 & 3842.7823 & 0.0032 & 0.9923 & 0.0552 & 0.4758 \tabularnewline
55 & 1864.44 & 2934.1581 & 1945.0039 & 3923.3124 & 0.017 & 0.9939 & 0.0336 & 0.4777 \tabularnewline
56 & 2052.02 & 2934.1569 & 1870.5415 & 3997.7722 & 0.052 & 0.9757 & 0.0551 & 0.4793 \tabularnewline
57 & 2029.6 & 2934.1566 & 1800.9608 & 4067.3523 & 0.0588 & 0.9365 & 0.162 & 0.4806 \tabularnewline
58 & 2070.83 & 2934.1565 & 1735.412 & 4132.901 & 0.079 & 0.9304 & 0.4361 & 0.4816 \tabularnewline
59 & 2293.41 & 2934.1565 & 1673.2661 & 4195.0468 & 0.1596 & 0.9102 & 0.4304 & 0.4825 \tabularnewline
60 & 2443.27 & 2934.1564 & 1614.0426 & 4254.2703 & 0.2331 & 0.8293 & 0.4833 & 0.4833 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71040&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[48])[/C][/ROW]
[ROW][C]36[/C][C]4296.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]4435.23[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]4105.18[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]4116.68[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]3844.49[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]3720.98[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]3674.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]3857.62[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]3801.06[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]3504.37[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]3032.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]3047.03[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]2962.34[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2197.82[/C][C]2941.1936[/C][C]2647.8469[/C][C]3234.5404[/C][C]0[/C][C]0.4438[/C][C]0[/C][C]0.4438[/C][/ROW]
[ROW][C]50[/C][C]2014.45[/C][C]2935.9136[/C][C]2466.4003[/C][C]3405.4269[/C][C]1e-04[/C][C]0.999[/C][C]0[/C][C]0.4561[/C][/ROW]
[ROW][C]51[/C][C]1862.83[/C][C]2934.5952[/C][C]2327.4899[/C][C]3541.7004[/C][C]3e-04[/C][C]0.9985[/C][C]1e-04[/C][C]0.4643[/C][/ROW]
[ROW][C]52[/C][C]1905.41[/C][C]2934.266[/C][C]2212.9846[/C][C]3655.5474[/C][C]0.0026[/C][C]0.9982[/C][C]0.0067[/C][C]0.4696[/C][/ROW]
[ROW][C]53[/C][C]1810.99[/C][C]2934.1838[/C][C]2113.936[/C][C]3754.4316[/C][C]0.0036[/C][C]0.993[/C][C]0.03[/C][C]0.4732[/C][/ROW]
[ROW][C]54[/C][C]1670.07[/C][C]2934.1633[/C][C]2025.5443[/C][C]3842.7823[/C][C]0.0032[/C][C]0.9923[/C][C]0.0552[/C][C]0.4758[/C][/ROW]
[ROW][C]55[/C][C]1864.44[/C][C]2934.1581[/C][C]1945.0039[/C][C]3923.3124[/C][C]0.017[/C][C]0.9939[/C][C]0.0336[/C][C]0.4777[/C][/ROW]
[ROW][C]56[/C][C]2052.02[/C][C]2934.1569[/C][C]1870.5415[/C][C]3997.7722[/C][C]0.052[/C][C]0.9757[/C][C]0.0551[/C][C]0.4793[/C][/ROW]
[ROW][C]57[/C][C]2029.6[/C][C]2934.1566[/C][C]1800.9608[/C][C]4067.3523[/C][C]0.0588[/C][C]0.9365[/C][C]0.162[/C][C]0.4806[/C][/ROW]
[ROW][C]58[/C][C]2070.83[/C][C]2934.1565[/C][C]1735.412[/C][C]4132.901[/C][C]0.079[/C][C]0.9304[/C][C]0.4361[/C][C]0.4816[/C][/ROW]
[ROW][C]59[/C][C]2293.41[/C][C]2934.1565[/C][C]1673.2661[/C][C]4195.0468[/C][C]0.1596[/C][C]0.9102[/C][C]0.4304[/C][C]0.4825[/C][/ROW]
[ROW][C]60[/C][C]2443.27[/C][C]2934.1564[/C][C]1614.0426[/C][C]4254.2703[/C][C]0.2331[/C][C]0.8293[/C][C]0.4833[/C][C]0.4833[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71040&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71040&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[48])
364296.49-------
374435.23-------
384105.18-------
394116.68-------
403844.49-------
413720.98-------
423674.4-------
433857.62-------
443801.06-------
453504.37-------
463032.6-------
473047.03-------
482962.34-------
492197.822941.19362647.84693234.540400.443800.4438
502014.452935.91362466.40033405.42691e-040.99900.4561
511862.832934.59522327.48993541.70043e-040.99851e-040.4643
521905.412934.2662212.98463655.54740.00260.99820.00670.4696
531810.992934.18382113.9363754.43160.00360.9930.030.4732
541670.072934.16332025.54433842.78230.00320.99230.05520.4758
551864.442934.15811945.00393923.31240.0170.99390.03360.4777
562052.022934.15691870.54153997.77220.0520.97570.05510.4793
572029.62934.15661800.96084067.35230.05880.93650.1620.4806
582070.832934.15651735.4124132.9010.0790.93040.43610.4816
592293.412934.15651673.26614195.04680.15960.91020.43040.4825
602443.272934.15641614.04264254.27030.23310.82930.48330.4833







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.0509-0.25270552604.36200
500.0816-0.31390.2833849095.1112700849.7366837.1677
510.1056-0.36520.31061148680.6081850126.6938922.0232
520.1254-0.35060.32061058544.6552902231.1841949.8585
530.1426-0.38280.33311261564.3069974097.8087986.9639
540.158-0.43080.34931597931.80531078070.14151038.3016
550.172-0.36460.35151144296.91911087531.10971042.8476
560.1849-0.30060.3452778165.45711048860.40311024.1389
570.197-0.30830.3411818222.55281023233.97531011.5503
580.2084-0.29420.3364745332.5948995443.8373997.7193
590.2192-0.21840.3257410556.014942272.217970.7071
600.2295-0.16730.3125240969.5025883830.3241940.1225

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0509 & -0.2527 & 0 & 552604.362 & 0 & 0 \tabularnewline
50 & 0.0816 & -0.3139 & 0.2833 & 849095.1112 & 700849.7366 & 837.1677 \tabularnewline
51 & 0.1056 & -0.3652 & 0.3106 & 1148680.6081 & 850126.6938 & 922.0232 \tabularnewline
52 & 0.1254 & -0.3506 & 0.3206 & 1058544.6552 & 902231.1841 & 949.8585 \tabularnewline
53 & 0.1426 & -0.3828 & 0.3331 & 1261564.3069 & 974097.8087 & 986.9639 \tabularnewline
54 & 0.158 & -0.4308 & 0.3493 & 1597931.8053 & 1078070.1415 & 1038.3016 \tabularnewline
55 & 0.172 & -0.3646 & 0.3515 & 1144296.9191 & 1087531.1097 & 1042.8476 \tabularnewline
56 & 0.1849 & -0.3006 & 0.3452 & 778165.4571 & 1048860.4031 & 1024.1389 \tabularnewline
57 & 0.197 & -0.3083 & 0.3411 & 818222.5528 & 1023233.9753 & 1011.5503 \tabularnewline
58 & 0.2084 & -0.2942 & 0.3364 & 745332.5948 & 995443.8373 & 997.7193 \tabularnewline
59 & 0.2192 & -0.2184 & 0.3257 & 410556.014 & 942272.217 & 970.7071 \tabularnewline
60 & 0.2295 & -0.1673 & 0.3125 & 240969.5025 & 883830.3241 & 940.1225 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=71040&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]49[/C][C]0.0509[/C][C]-0.2527[/C][C]0[/C][C]552604.362[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0816[/C][C]-0.3139[/C][C]0.2833[/C][C]849095.1112[/C][C]700849.7366[/C][C]837.1677[/C][/ROW]
[ROW][C]51[/C][C]0.1056[/C][C]-0.3652[/C][C]0.3106[/C][C]1148680.6081[/C][C]850126.6938[/C][C]922.0232[/C][/ROW]
[ROW][C]52[/C][C]0.1254[/C][C]-0.3506[/C][C]0.3206[/C][C]1058544.6552[/C][C]902231.1841[/C][C]949.8585[/C][/ROW]
[ROW][C]53[/C][C]0.1426[/C][C]-0.3828[/C][C]0.3331[/C][C]1261564.3069[/C][C]974097.8087[/C][C]986.9639[/C][/ROW]
[ROW][C]54[/C][C]0.158[/C][C]-0.4308[/C][C]0.3493[/C][C]1597931.8053[/C][C]1078070.1415[/C][C]1038.3016[/C][/ROW]
[ROW][C]55[/C][C]0.172[/C][C]-0.3646[/C][C]0.3515[/C][C]1144296.9191[/C][C]1087531.1097[/C][C]1042.8476[/C][/ROW]
[ROW][C]56[/C][C]0.1849[/C][C]-0.3006[/C][C]0.3452[/C][C]778165.4571[/C][C]1048860.4031[/C][C]1024.1389[/C][/ROW]
[ROW][C]57[/C][C]0.197[/C][C]-0.3083[/C][C]0.3411[/C][C]818222.5528[/C][C]1023233.9753[/C][C]1011.5503[/C][/ROW]
[ROW][C]58[/C][C]0.2084[/C][C]-0.2942[/C][C]0.3364[/C][C]745332.5948[/C][C]995443.8373[/C][C]997.7193[/C][/ROW]
[ROW][C]59[/C][C]0.2192[/C][C]-0.2184[/C][C]0.3257[/C][C]410556.014[/C][C]942272.217[/C][C]970.7071[/C][/ROW]
[ROW][C]60[/C][C]0.2295[/C][C]-0.1673[/C][C]0.3125[/C][C]240969.5025[/C][C]883830.3241[/C][C]940.1225[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=71040&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=71040&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
490.0509-0.25270552604.36200
500.0816-0.31390.2833849095.1112700849.7366837.1677
510.1056-0.36520.31061148680.6081850126.6938922.0232
520.1254-0.35060.32061058544.6552902231.1841949.8585
530.1426-0.38280.33311261564.3069974097.8087986.9639
540.158-0.43080.34931597931.80531078070.14151038.3016
550.172-0.36460.35151144296.91911087531.10971042.8476
560.1849-0.30060.3452778165.45711048860.40311024.1389
570.197-0.30830.3411818222.55281023233.97531011.5503
580.2084-0.29420.3364745332.5948995443.8373997.7193
590.2192-0.21840.3257410556.014942272.217970.7071
600.2295-0.16730.3125240969.5025883830.3241940.1225



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