Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationFri, 07 Dec 2007 10:25:44 -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/2007/Dec/07/t1197047771wei5o3kmwy1efnz.htm/, Retrieved Sun, 28 Apr 2024 19:35:23 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=2887, Retrieved Sun, 28 Apr 2024 19:35:23 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact191
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [Workshop 6: Q1] [2007-12-07 17:25:44] [9ec4fcc2bfe8b6d942eac6074e595603] [Current]
Feedback Forum

Post a new message
Dataseries X:
3926
3517
4142
4353
5029
4755
3862
4406
4567
4863
4121
3626
3804
3491
4151
4254
4717
4866
4001
3758
4780
5016
4296
4467
3891
3872
3867
3973
4640
4538
3836
3770
4374
4497
3945
3862
3608
3301
3882
3605
4305
4216
3971
3988
4317
4484
4247
3520
3687
3405
3990
4047
4549
4559
3926
4206
4517
4387
3219
3129




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

\begin{tabular}{lllllllll}
\hline
Summary of compuational transaction \tabularnewline
Raw Input & view raw input (R code)  \tabularnewline
Raw Output & view raw output of R engine  \tabularnewline
Computing time & 1 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2887&T=0

[TABLE]
[ROW][C]Summary of compuational 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]1 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=2887&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2887&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 compuational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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])
363862-------
373608-------
383301-------
393882-------
403605-------
414305-------
424216-------
433971-------
443988-------
454317-------
464484-------
474247-------
483520-------
4936873488.72592999.30033978.15140.21360.45020.31640.4502
5034053249.61262743.43353755.79170.27370.04520.42110.1476
5139903717.77243204.75824230.78660.14920.88390.26520.7751
5240473753.89153235.06114272.72190.13410.18620.71310.8115
5345494380.43883855.96944904.90820.26440.89360.6110.9993
5445594301.4453771.41074831.47930.17040.180.6240.9981
5539263625.19753089.6584160.73710.13553e-040.10280.6499
5642063688.19713147.20834229.18590.03030.19450.13870.7289
5745174217.19583670.81114763.58050.14110.5160.36020.9938
5843874422.68663870.95014974.42310.44960.36880.41380.9993
5932193859.86623302.76334416.9690.01210.03180.08660.8841
6031293575.79943012.94364138.65520.05990.8930.5770.577

\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 & 3862 & - & - & - & - & - & - & - \tabularnewline
37 & 3608 & - & - & - & - & - & - & - \tabularnewline
38 & 3301 & - & - & - & - & - & - & - \tabularnewline
39 & 3882 & - & - & - & - & - & - & - \tabularnewline
40 & 3605 & - & - & - & - & - & - & - \tabularnewline
41 & 4305 & - & - & - & - & - & - & - \tabularnewline
42 & 4216 & - & - & - & - & - & - & - \tabularnewline
43 & 3971 & - & - & - & - & - & - & - \tabularnewline
44 & 3988 & - & - & - & - & - & - & - \tabularnewline
45 & 4317 & - & - & - & - & - & - & - \tabularnewline
46 & 4484 & - & - & - & - & - & - & - \tabularnewline
47 & 4247 & - & - & - & - & - & - & - \tabularnewline
48 & 3520 & - & - & - & - & - & - & - \tabularnewline
49 & 3687 & 3488.7259 & 2999.3003 & 3978.1514 & 0.2136 & 0.4502 & 0.3164 & 0.4502 \tabularnewline
50 & 3405 & 3249.6126 & 2743.4335 & 3755.7917 & 0.2737 & 0.0452 & 0.4211 & 0.1476 \tabularnewline
51 & 3990 & 3717.7724 & 3204.7582 & 4230.7866 & 0.1492 & 0.8839 & 0.2652 & 0.7751 \tabularnewline
52 & 4047 & 3753.8915 & 3235.0611 & 4272.7219 & 0.1341 & 0.1862 & 0.7131 & 0.8115 \tabularnewline
53 & 4549 & 4380.4388 & 3855.9694 & 4904.9082 & 0.2644 & 0.8936 & 0.611 & 0.9993 \tabularnewline
54 & 4559 & 4301.445 & 3771.4107 & 4831.4793 & 0.1704 & 0.18 & 0.624 & 0.9981 \tabularnewline
55 & 3926 & 3625.1975 & 3089.658 & 4160.7371 & 0.1355 & 3e-04 & 0.1028 & 0.6499 \tabularnewline
56 & 4206 & 3688.1971 & 3147.2083 & 4229.1859 & 0.0303 & 0.1945 & 0.1387 & 0.7289 \tabularnewline
57 & 4517 & 4217.1958 & 3670.8111 & 4763.5805 & 0.1411 & 0.516 & 0.3602 & 0.9938 \tabularnewline
58 & 4387 & 4422.6866 & 3870.9501 & 4974.4231 & 0.4496 & 0.3688 & 0.4138 & 0.9993 \tabularnewline
59 & 3219 & 3859.8662 & 3302.7633 & 4416.969 & 0.0121 & 0.0318 & 0.0866 & 0.8841 \tabularnewline
60 & 3129 & 3575.7994 & 3012.9436 & 4138.6552 & 0.0599 & 0.893 & 0.577 & 0.577 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2887&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]3862[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]3608[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]3301[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3882[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]3605[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]4305[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]4216[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]3971[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]3988[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]4317[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]4484[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4247[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]3520[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]3687[/C][C]3488.7259[/C][C]2999.3003[/C][C]3978.1514[/C][C]0.2136[/C][C]0.4502[/C][C]0.3164[/C][C]0.4502[/C][/ROW]
[ROW][C]50[/C][C]3405[/C][C]3249.6126[/C][C]2743.4335[/C][C]3755.7917[/C][C]0.2737[/C][C]0.0452[/C][C]0.4211[/C][C]0.1476[/C][/ROW]
[ROW][C]51[/C][C]3990[/C][C]3717.7724[/C][C]3204.7582[/C][C]4230.7866[/C][C]0.1492[/C][C]0.8839[/C][C]0.2652[/C][C]0.7751[/C][/ROW]
[ROW][C]52[/C][C]4047[/C][C]3753.8915[/C][C]3235.0611[/C][C]4272.7219[/C][C]0.1341[/C][C]0.1862[/C][C]0.7131[/C][C]0.8115[/C][/ROW]
[ROW][C]53[/C][C]4549[/C][C]4380.4388[/C][C]3855.9694[/C][C]4904.9082[/C][C]0.2644[/C][C]0.8936[/C][C]0.611[/C][C]0.9993[/C][/ROW]
[ROW][C]54[/C][C]4559[/C][C]4301.445[/C][C]3771.4107[/C][C]4831.4793[/C][C]0.1704[/C][C]0.18[/C][C]0.624[/C][C]0.9981[/C][/ROW]
[ROW][C]55[/C][C]3926[/C][C]3625.1975[/C][C]3089.658[/C][C]4160.7371[/C][C]0.1355[/C][C]3e-04[/C][C]0.1028[/C][C]0.6499[/C][/ROW]
[ROW][C]56[/C][C]4206[/C][C]3688.1971[/C][C]3147.2083[/C][C]4229.1859[/C][C]0.0303[/C][C]0.1945[/C][C]0.1387[/C][C]0.7289[/C][/ROW]
[ROW][C]57[/C][C]4517[/C][C]4217.1958[/C][C]3670.8111[/C][C]4763.5805[/C][C]0.1411[/C][C]0.516[/C][C]0.3602[/C][C]0.9938[/C][/ROW]
[ROW][C]58[/C][C]4387[/C][C]4422.6866[/C][C]3870.9501[/C][C]4974.4231[/C][C]0.4496[/C][C]0.3688[/C][C]0.4138[/C][C]0.9993[/C][/ROW]
[ROW][C]59[/C][C]3219[/C][C]3859.8662[/C][C]3302.7633[/C][C]4416.969[/C][C]0.0121[/C][C]0.0318[/C][C]0.0866[/C][C]0.8841[/C][/ROW]
[ROW][C]60[/C][C]3129[/C][C]3575.7994[/C][C]3012.9436[/C][C]4138.6552[/C][C]0.0599[/C][C]0.893[/C][C]0.577[/C][C]0.577[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2887&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2887&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])
363862-------
373608-------
383301-------
393882-------
403605-------
414305-------
424216-------
433971-------
443988-------
454317-------
464484-------
474247-------
483520-------
4936873488.72592999.30033978.15140.21360.45020.31640.4502
5034053249.61262743.43353755.79170.27370.04520.42110.1476
5139903717.77243204.75824230.78660.14920.88390.26520.7751
5240473753.89153235.06114272.72190.13410.18620.71310.8115
5345494380.43883855.96944904.90820.26440.89360.6110.9993
5445594301.4453771.41074831.47930.17040.180.6240.9981
5539263625.19753089.6584160.73710.13553e-040.10280.6499
5642063688.19713147.20834229.18590.03030.19450.13870.7289
5745174217.19583670.81114763.58050.14110.5160.36020.9938
5843874422.68663870.95014974.42310.44960.36880.41380.9993
5932193859.86623302.76334416.9690.01210.03180.08660.8841
6031293575.79943012.94364138.65520.05990.8930.5770.577







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.07160.05680.004739312.63763276.053157.2368
500.07950.04780.00424145.24252012.103544.8565
510.07040.07320.006174107.86846175.655778.5853
520.07050.07810.006585912.58727159.382384.6131
530.06110.03850.003228412.87612367.739748.6594
540.06290.05990.00566334.56385527.880374.3497
550.07540.0830.006990482.11517540.176386.8342
560.07480.14040.0117268119.840122343.32149.4768
570.06610.07110.005989882.57097490.214286.546
580.0636-0.00817e-041273.532106.127710.3018
590.0736-0.1660.0138410709.429534225.7858185.0021
600.0803-0.1250.0104199629.701116635.8084128.9799

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0716 & 0.0568 & 0.0047 & 39312.6376 & 3276.0531 & 57.2368 \tabularnewline
50 & 0.0795 & 0.0478 & 0.004 & 24145.2425 & 2012.1035 & 44.8565 \tabularnewline
51 & 0.0704 & 0.0732 & 0.0061 & 74107.8684 & 6175.6557 & 78.5853 \tabularnewline
52 & 0.0705 & 0.0781 & 0.0065 & 85912.5872 & 7159.3823 & 84.6131 \tabularnewline
53 & 0.0611 & 0.0385 & 0.0032 & 28412.8761 & 2367.7397 & 48.6594 \tabularnewline
54 & 0.0629 & 0.0599 & 0.005 & 66334.5638 & 5527.8803 & 74.3497 \tabularnewline
55 & 0.0754 & 0.083 & 0.0069 & 90482.1151 & 7540.1763 & 86.8342 \tabularnewline
56 & 0.0748 & 0.1404 & 0.0117 & 268119.8401 & 22343.32 & 149.4768 \tabularnewline
57 & 0.0661 & 0.0711 & 0.0059 & 89882.5709 & 7490.2142 & 86.546 \tabularnewline
58 & 0.0636 & -0.0081 & 7e-04 & 1273.532 & 106.1277 & 10.3018 \tabularnewline
59 & 0.0736 & -0.166 & 0.0138 & 410709.4295 & 34225.7858 & 185.0021 \tabularnewline
60 & 0.0803 & -0.125 & 0.0104 & 199629.7011 & 16635.8084 & 128.9799 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=2887&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.0716[/C][C]0.0568[/C][C]0.0047[/C][C]39312.6376[/C][C]3276.0531[/C][C]57.2368[/C][/ROW]
[ROW][C]50[/C][C]0.0795[/C][C]0.0478[/C][C]0.004[/C][C]24145.2425[/C][C]2012.1035[/C][C]44.8565[/C][/ROW]
[ROW][C]51[/C][C]0.0704[/C][C]0.0732[/C][C]0.0061[/C][C]74107.8684[/C][C]6175.6557[/C][C]78.5853[/C][/ROW]
[ROW][C]52[/C][C]0.0705[/C][C]0.0781[/C][C]0.0065[/C][C]85912.5872[/C][C]7159.3823[/C][C]84.6131[/C][/ROW]
[ROW][C]53[/C][C]0.0611[/C][C]0.0385[/C][C]0.0032[/C][C]28412.8761[/C][C]2367.7397[/C][C]48.6594[/C][/ROW]
[ROW][C]54[/C][C]0.0629[/C][C]0.0599[/C][C]0.005[/C][C]66334.5638[/C][C]5527.8803[/C][C]74.3497[/C][/ROW]
[ROW][C]55[/C][C]0.0754[/C][C]0.083[/C][C]0.0069[/C][C]90482.1151[/C][C]7540.1763[/C][C]86.8342[/C][/ROW]
[ROW][C]56[/C][C]0.0748[/C][C]0.1404[/C][C]0.0117[/C][C]268119.8401[/C][C]22343.32[/C][C]149.4768[/C][/ROW]
[ROW][C]57[/C][C]0.0661[/C][C]0.0711[/C][C]0.0059[/C][C]89882.5709[/C][C]7490.2142[/C][C]86.546[/C][/ROW]
[ROW][C]58[/C][C]0.0636[/C][C]-0.0081[/C][C]7e-04[/C][C]1273.532[/C][C]106.1277[/C][C]10.3018[/C][/ROW]
[ROW][C]59[/C][C]0.0736[/C][C]-0.166[/C][C]0.0138[/C][C]410709.4295[/C][C]34225.7858[/C][C]185.0021[/C][/ROW]
[ROW][C]60[/C][C]0.0803[/C][C]-0.125[/C][C]0.0104[/C][C]199629.7011[/C][C]16635.8084[/C][C]128.9799[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=2887&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=2887&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.07160.05680.004739312.63763276.053157.2368
500.07950.04780.00424145.24252012.103544.8565
510.07040.07320.006174107.86846175.655778.5853
520.07050.07810.006585912.58727159.382384.6131
530.06110.03850.003228412.87612367.739748.6594
540.06290.05990.00566334.56385527.880374.3497
550.07540.0830.006990482.11517540.176386.8342
560.07480.14040.0117268119.840122343.32149.4768
570.06610.07110.005989882.57097490.214286.546
580.0636-0.00817e-041273.532106.127710.3018
590.0736-0.1660.0138410709.429534225.7858185.0021
600.0803-0.1250.0104199629.701116635.8084128.9799



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = TRUE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 1 ; par4 = 1 ; par5 = 12 ; par6 = 1 ; par7 = 1 ; par8 = 0 ; par9 = 1 ; par10 = TRUE ;
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,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)
}
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')