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 computationThu, 08 Dec 2011 10:16:20 -0500
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2011/Dec/08/t1323357428s1akyh1jxbppn9f.htm/, Retrieved Fri, 03 May 2024 07:04:59 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=152988, Retrieved Fri, 03 May 2024 07:04:59 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact84
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [] [2011-12-08 15:16:20] [c7041fab4904771a5085f5eb0f28763f] [Current]
Feedback Forum

Post a new message
Dataseries X:
4581945
3874038
4086290
4364364
3793586
4533914
4823043
3981535
4746356
5284534
4264830
3924674
3734753
3762290
3609739
3877594
3636415
3578195
3604342
3459513
3366571
3371277
3724848
3350830
3305159
3390736
3349758
3253655
3734250
3455433
2966726
2993716
3009320
3169713
3170061
3368934
3292638
3337344
3208306
3359130
3223078
3437159
3400156
3657576
3765613
3481921
3604800
3981340
3734078
4018173
3887417
3919880
4014466
4197758
3896531
3964742
4201847
4050512
3997402
4314479
4925744
5130631
4444855
3967319
3931250
4235952
4169219
3779064
3558810
3699466
3650693
3525633
3470276
3859094
3661155
3356365
3344440
3338684
3404294
3289319
3469252
3571850
3639914
3091730
3078149
3188115
3246082
3486992
3378187
3282306
3288345
3325749
3352262
3531954
3722622
3809365
3750617
3615286
3696556
4123959
4136163
3933392
4035576
4551202
4032195
3970893
4489016
5426127
4578224
4126390
4892100
4128697
4408721
4199465
4074767
4161758
3891319
4470302
4283111
3845962
3911471
3798478
3644313
3784029
3647134
3994662
3607836
3566008
3511412
3258665
3486573
3369443
3465544
3905224
3733881
3220642
3225812
3354461
3352261
3450652




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time1 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 & 1 seconds \tabularnewline
R Server & 'Gertrude Mary Cox' @ cox.wessa.net \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152988&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]1 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=152988&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152988&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 time1 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[128])
1164161758-------
1173891319-------
1184470302-------
1194283111-------
1203845962-------
1213911471-------
1223798478-------
1233644313-------
1243784029-------
1253647134-------
1263994662-------
1273607836-------
1283566008-------
12935114123746336.40493128720.86564363951.94430.2280.71640.32270.7164
13032586653799599.17443041597.96014557600.38880.08090.77190.04140.7271
13134865733736659.13532943980.93934529337.33130.26820.88140.08830.6635
13233694433816207.73952931690.22024700725.25890.16110.76740.47370.7104
13334655443742913.38042762734.66614723092.09470.28960.77240.3680.6382
13439052243699192.67742662401.05264735984.30220.34850.67060.42560.5994
13537338813672317.79462575852.71314768782.87620.45620.33860.520.5754
13632206423668078.79872505418.47624830739.12120.22530.45580.42250.5683
13732258123629271.56462410174.01574848369.11350.25830.74440.48850.5405
13833544613715665.4992444195.20834987135.78970.28880.77490.33360.5912
13933522613631799.91452306986.50974956613.31940.33960.65920.51410.5388
14034506523581085.34892205530.394956640.30790.42630.62780.50860.5086

\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[128]) \tabularnewline
116 & 4161758 & - & - & - & - & - & - & - \tabularnewline
117 & 3891319 & - & - & - & - & - & - & - \tabularnewline
118 & 4470302 & - & - & - & - & - & - & - \tabularnewline
119 & 4283111 & - & - & - & - & - & - & - \tabularnewline
120 & 3845962 & - & - & - & - & - & - & - \tabularnewline
121 & 3911471 & - & - & - & - & - & - & - \tabularnewline
122 & 3798478 & - & - & - & - & - & - & - \tabularnewline
123 & 3644313 & - & - & - & - & - & - & - \tabularnewline
124 & 3784029 & - & - & - & - & - & - & - \tabularnewline
125 & 3647134 & - & - & - & - & - & - & - \tabularnewline
126 & 3994662 & - & - & - & - & - & - & - \tabularnewline
127 & 3607836 & - & - & - & - & - & - & - \tabularnewline
128 & 3566008 & - & - & - & - & - & - & - \tabularnewline
129 & 3511412 & 3746336.4049 & 3128720.8656 & 4363951.9443 & 0.228 & 0.7164 & 0.3227 & 0.7164 \tabularnewline
130 & 3258665 & 3799599.1744 & 3041597.9601 & 4557600.3888 & 0.0809 & 0.7719 & 0.0414 & 0.7271 \tabularnewline
131 & 3486573 & 3736659.1353 & 2943980.9393 & 4529337.3313 & 0.2682 & 0.8814 & 0.0883 & 0.6635 \tabularnewline
132 & 3369443 & 3816207.7395 & 2931690.2202 & 4700725.2589 & 0.1611 & 0.7674 & 0.4737 & 0.7104 \tabularnewline
133 & 3465544 & 3742913.3804 & 2762734.6661 & 4723092.0947 & 0.2896 & 0.7724 & 0.368 & 0.6382 \tabularnewline
134 & 3905224 & 3699192.6774 & 2662401.0526 & 4735984.3022 & 0.3485 & 0.6706 & 0.4256 & 0.5994 \tabularnewline
135 & 3733881 & 3672317.7946 & 2575852.7131 & 4768782.8762 & 0.4562 & 0.3386 & 0.52 & 0.5754 \tabularnewline
136 & 3220642 & 3668078.7987 & 2505418.4762 & 4830739.1212 & 0.2253 & 0.4558 & 0.4225 & 0.5683 \tabularnewline
137 & 3225812 & 3629271.5646 & 2410174.0157 & 4848369.1135 & 0.2583 & 0.7444 & 0.4885 & 0.5405 \tabularnewline
138 & 3354461 & 3715665.499 & 2444195.2083 & 4987135.7897 & 0.2888 & 0.7749 & 0.3336 & 0.5912 \tabularnewline
139 & 3352261 & 3631799.9145 & 2306986.5097 & 4956613.3194 & 0.3396 & 0.6592 & 0.5141 & 0.5388 \tabularnewline
140 & 3450652 & 3581085.3489 & 2205530.39 & 4956640.3079 & 0.4263 & 0.6278 & 0.5086 & 0.5086 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152988&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[128])[/C][/ROW]
[ROW][C]116[/C][C]4161758[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]3891319[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]4470302[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]4283111[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]3845962[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]3911471[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]122[/C][C]3798478[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]123[/C][C]3644313[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]124[/C][C]3784029[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]125[/C][C]3647134[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]126[/C][C]3994662[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]127[/C][C]3607836[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]128[/C][C]3566008[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]129[/C][C]3511412[/C][C]3746336.4049[/C][C]3128720.8656[/C][C]4363951.9443[/C][C]0.228[/C][C]0.7164[/C][C]0.3227[/C][C]0.7164[/C][/ROW]
[ROW][C]130[/C][C]3258665[/C][C]3799599.1744[/C][C]3041597.9601[/C][C]4557600.3888[/C][C]0.0809[/C][C]0.7719[/C][C]0.0414[/C][C]0.7271[/C][/ROW]
[ROW][C]131[/C][C]3486573[/C][C]3736659.1353[/C][C]2943980.9393[/C][C]4529337.3313[/C][C]0.2682[/C][C]0.8814[/C][C]0.0883[/C][C]0.6635[/C][/ROW]
[ROW][C]132[/C][C]3369443[/C][C]3816207.7395[/C][C]2931690.2202[/C][C]4700725.2589[/C][C]0.1611[/C][C]0.7674[/C][C]0.4737[/C][C]0.7104[/C][/ROW]
[ROW][C]133[/C][C]3465544[/C][C]3742913.3804[/C][C]2762734.6661[/C][C]4723092.0947[/C][C]0.2896[/C][C]0.7724[/C][C]0.368[/C][C]0.6382[/C][/ROW]
[ROW][C]134[/C][C]3905224[/C][C]3699192.6774[/C][C]2662401.0526[/C][C]4735984.3022[/C][C]0.3485[/C][C]0.6706[/C][C]0.4256[/C][C]0.5994[/C][/ROW]
[ROW][C]135[/C][C]3733881[/C][C]3672317.7946[/C][C]2575852.7131[/C][C]4768782.8762[/C][C]0.4562[/C][C]0.3386[/C][C]0.52[/C][C]0.5754[/C][/ROW]
[ROW][C]136[/C][C]3220642[/C][C]3668078.7987[/C][C]2505418.4762[/C][C]4830739.1212[/C][C]0.2253[/C][C]0.4558[/C][C]0.4225[/C][C]0.5683[/C][/ROW]
[ROW][C]137[/C][C]3225812[/C][C]3629271.5646[/C][C]2410174.0157[/C][C]4848369.1135[/C][C]0.2583[/C][C]0.7444[/C][C]0.4885[/C][C]0.5405[/C][/ROW]
[ROW][C]138[/C][C]3354461[/C][C]3715665.499[/C][C]2444195.2083[/C][C]4987135.7897[/C][C]0.2888[/C][C]0.7749[/C][C]0.3336[/C][C]0.5912[/C][/ROW]
[ROW][C]139[/C][C]3352261[/C][C]3631799.9145[/C][C]2306986.5097[/C][C]4956613.3194[/C][C]0.3396[/C][C]0.6592[/C][C]0.5141[/C][C]0.5388[/C][/ROW]
[ROW][C]140[/C][C]3450652[/C][C]3581085.3489[/C][C]2205530.39[/C][C]4956640.3079[/C][C]0.4263[/C][C]0.6278[/C][C]0.5086[/C][C]0.5086[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=152988&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152988&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[128])
1164161758-------
1173891319-------
1184470302-------
1194283111-------
1203845962-------
1213911471-------
1223798478-------
1233644313-------
1243784029-------
1253647134-------
1263994662-------
1273607836-------
1283566008-------
12935114123746336.40493128720.86564363951.94430.2280.71640.32270.7164
13032586653799599.17443041597.96014557600.38880.08090.77190.04140.7271
13134865733736659.13532943980.93934529337.33130.26820.88140.08830.6635
13233694433816207.73952931690.22024700725.25890.16110.76740.47370.7104
13334655443742913.38042762734.66614723092.09470.28960.77240.3680.6382
13439052243699192.67742662401.05264735984.30220.34850.67060.42560.5994
13537338813672317.79462575852.71314768782.87620.45620.33860.520.5754
13632206423668078.79872505418.47624830739.12120.22530.45580.42250.5683
13732258123629271.56462410174.01574848369.11350.25830.74440.48850.5405
13833544613715665.4992444195.20834987135.78970.28880.77490.33360.5912
13933522613631799.91452306986.50974956613.31940.33960.65920.51410.5388
14034506523581085.34892205530.394956640.30790.42630.62780.50860.5086







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1290.0841-0.0627055189476039.030600
1300.1018-0.14240.1025292609781049.43173899628544.23417012.7439
1310.1082-0.06690.090762543075049.777136780777379.413369838.8533
1320.1183-0.11710.0973199598732487.484152485266156.43390493.6186
1330.1336-0.07410.092676933773178.2167137374967560.788370641.2923
1340.1430.05570.086542448905892.1044121553957282.674348645.891
1350.15230.01680.07653790028256.8209104730538850.409323620.9802
1360.1617-0.1220.0822200199688825.905116664182597.346341561.3892
1370.1714-0.11120.0854162779620277.182121788120117.328348981.547
1380.1746-0.09720.0866130468690085.806122656177114.176350223.0391
1390.1861-0.0770.085778142004722.935118609434169.517344397.2041
1400.196-0.03640.081617012858512.893110143052864.799331878.0693

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
129 & 0.0841 & -0.0627 & 0 & 55189476039.0306 & 0 & 0 \tabularnewline
130 & 0.1018 & -0.1424 & 0.1025 & 292609781049.43 & 173899628544.23 & 417012.7439 \tabularnewline
131 & 0.1082 & -0.0669 & 0.0907 & 62543075049.777 & 136780777379.413 & 369838.8533 \tabularnewline
132 & 0.1183 & -0.1171 & 0.0973 & 199598732487.484 & 152485266156.43 & 390493.6186 \tabularnewline
133 & 0.1336 & -0.0741 & 0.0926 & 76933773178.2167 & 137374967560.788 & 370641.2923 \tabularnewline
134 & 0.143 & 0.0557 & 0.0865 & 42448905892.1044 & 121553957282.674 & 348645.891 \tabularnewline
135 & 0.1523 & 0.0168 & 0.0765 & 3790028256.8209 & 104730538850.409 & 323620.9802 \tabularnewline
136 & 0.1617 & -0.122 & 0.0822 & 200199688825.905 & 116664182597.346 & 341561.3892 \tabularnewline
137 & 0.1714 & -0.1112 & 0.0854 & 162779620277.182 & 121788120117.328 & 348981.547 \tabularnewline
138 & 0.1746 & -0.0972 & 0.0866 & 130468690085.806 & 122656177114.176 & 350223.0391 \tabularnewline
139 & 0.1861 & -0.077 & 0.0857 & 78142004722.935 & 118609434169.517 & 344397.2041 \tabularnewline
140 & 0.196 & -0.0364 & 0.0816 & 17012858512.893 & 110143052864.799 & 331878.0693 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=152988&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]129[/C][C]0.0841[/C][C]-0.0627[/C][C]0[/C][C]55189476039.0306[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]130[/C][C]0.1018[/C][C]-0.1424[/C][C]0.1025[/C][C]292609781049.43[/C][C]173899628544.23[/C][C]417012.7439[/C][/ROW]
[ROW][C]131[/C][C]0.1082[/C][C]-0.0669[/C][C]0.0907[/C][C]62543075049.777[/C][C]136780777379.413[/C][C]369838.8533[/C][/ROW]
[ROW][C]132[/C][C]0.1183[/C][C]-0.1171[/C][C]0.0973[/C][C]199598732487.484[/C][C]152485266156.43[/C][C]390493.6186[/C][/ROW]
[ROW][C]133[/C][C]0.1336[/C][C]-0.0741[/C][C]0.0926[/C][C]76933773178.2167[/C][C]137374967560.788[/C][C]370641.2923[/C][/ROW]
[ROW][C]134[/C][C]0.143[/C][C]0.0557[/C][C]0.0865[/C][C]42448905892.1044[/C][C]121553957282.674[/C][C]348645.891[/C][/ROW]
[ROW][C]135[/C][C]0.1523[/C][C]0.0168[/C][C]0.0765[/C][C]3790028256.8209[/C][C]104730538850.409[/C][C]323620.9802[/C][/ROW]
[ROW][C]136[/C][C]0.1617[/C][C]-0.122[/C][C]0.0822[/C][C]200199688825.905[/C][C]116664182597.346[/C][C]341561.3892[/C][/ROW]
[ROW][C]137[/C][C]0.1714[/C][C]-0.1112[/C][C]0.0854[/C][C]162779620277.182[/C][C]121788120117.328[/C][C]348981.547[/C][/ROW]
[ROW][C]138[/C][C]0.1746[/C][C]-0.0972[/C][C]0.0866[/C][C]130468690085.806[/C][C]122656177114.176[/C][C]350223.0391[/C][/ROW]
[ROW][C]139[/C][C]0.1861[/C][C]-0.077[/C][C]0.0857[/C][C]78142004722.935[/C][C]118609434169.517[/C][C]344397.2041[/C][/ROW]
[ROW][C]140[/C][C]0.196[/C][C]-0.0364[/C][C]0.0816[/C][C]17012858512.893[/C][C]110143052864.799[/C][C]331878.0693[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=152988&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=152988&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
1290.0841-0.0627055189476039.030600
1300.1018-0.14240.1025292609781049.43173899628544.23417012.7439
1310.1082-0.06690.090762543075049.777136780777379.413369838.8533
1320.1183-0.11710.0973199598732487.484152485266156.43390493.6186
1330.1336-0.07410.092676933773178.2167137374967560.788370641.2923
1340.1430.05570.086542448905892.1044121553957282.674348645.891
1350.15230.01680.07653790028256.8209104730538850.409323620.9802
1360.1617-0.1220.0822200199688825.905116664182597.346341561.3892
1370.1714-0.11120.0854162779620277.182121788120117.328348981.547
1380.1746-0.09720.0866130468690085.806122656177114.176350223.0391
1390.1861-0.0770.085778142004722.935118609434169.517344397.2041
1400.196-0.03640.081617012858512.893110143052864.799331878.0693



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