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 computationMon, 05 Dec 2011 13:48:24 -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/05/t13231109642jmtd1xz10nt6j8.htm/, Retrieved Fri, 03 May 2024 12:17:22 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=151161, Retrieved Fri, 03 May 2024 12:17:22 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact126
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Backward Selection] [] [2011-12-02 08:01:34] [ee8c3a74bf3b349877806e9a50913c60]
-       [ARIMA Backward Selection] [Werkloosheid Nede...] [2011-12-02 08:30:12] [ee8c3a74bf3b349877806e9a50913c60]
- RMPD    [ARIMA Forecasting] [WS9 Wine Sales Au...] [2011-12-05 18:09:59] [9d4f280afcb4ecc352d7c6f913a0a151]
- R P         [ARIMA Forecasting] [WS9 Wine Sales Au...] [2011-12-05 18:48:24] [2a6d487209befbc7c5ce02a41ecac161] [Current]
Feedback Forum

Post a new message
Dataseries X:
2564
2820
3508
3088
3299
2939
3320
3418
3604
3495
4163
4882
2211
3260
2992
2425
2707
3244
3965
3315
3333
3583
4021
4904
2252
2952
3573
3048
3059
2731
3563
3092
3478
3478
4308
5029
2075
3264
3308
3688
3136
2824
3644
4694
2914
3686
4358
5587
2265
3685
3754
3708
3210
3517
3905
3670
4221
4404
5086
5725




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=151161&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=151161&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151161&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[48])
365029-------
372075-------
383264-------
393308-------
403688-------
413136-------
422824-------
433644-------
444694-------
452914-------
463686-------
474358-------
485587-------
4922652237.07071791.92282792.80180.460800.71620
5036853091.53892476.3633859.53630.06490.98250.32990
5137543340.68332675.93094170.57290.16450.20810.53080
5237083102.90942485.47093873.73140.0620.04890.06840
5332103049.04312442.32333806.48370.33850.04410.4110
5435172905.55792327.38983627.35410.04840.20420.58760
5539053623.50912902.47814523.65810.270.59170.48220
5636703680.93282948.47524595.34690.49070.31550.01490
5742213269.68292619.05864081.93460.01090.1670.80460
5844043572.462861.5874459.92740.03310.0760.4010
5950864233.89443391.40465285.67480.05620.37560.40860.0058
6057255152.94124127.57316433.03030.19050.54080.25320.2532

\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 & 5029 & - & - & - & - & - & - & - \tabularnewline
37 & 2075 & - & - & - & - & - & - & - \tabularnewline
38 & 3264 & - & - & - & - & - & - & - \tabularnewline
39 & 3308 & - & - & - & - & - & - & - \tabularnewline
40 & 3688 & - & - & - & - & - & - & - \tabularnewline
41 & 3136 & - & - & - & - & - & - & - \tabularnewline
42 & 2824 & - & - & - & - & - & - & - \tabularnewline
43 & 3644 & - & - & - & - & - & - & - \tabularnewline
44 & 4694 & - & - & - & - & - & - & - \tabularnewline
45 & 2914 & - & - & - & - & - & - & - \tabularnewline
46 & 3686 & - & - & - & - & - & - & - \tabularnewline
47 & 4358 & - & - & - & - & - & - & - \tabularnewline
48 & 5587 & - & - & - & - & - & - & - \tabularnewline
49 & 2265 & 2237.0707 & 1791.9228 & 2792.8018 & 0.4608 & 0 & 0.7162 & 0 \tabularnewline
50 & 3685 & 3091.5389 & 2476.363 & 3859.5363 & 0.0649 & 0.9825 & 0.3299 & 0 \tabularnewline
51 & 3754 & 3340.6833 & 2675.9309 & 4170.5729 & 0.1645 & 0.2081 & 0.5308 & 0 \tabularnewline
52 & 3708 & 3102.9094 & 2485.4709 & 3873.7314 & 0.062 & 0.0489 & 0.0684 & 0 \tabularnewline
53 & 3210 & 3049.0431 & 2442.3233 & 3806.4837 & 0.3385 & 0.0441 & 0.411 & 0 \tabularnewline
54 & 3517 & 2905.5579 & 2327.3898 & 3627.3541 & 0.0484 & 0.2042 & 0.5876 & 0 \tabularnewline
55 & 3905 & 3623.5091 & 2902.4781 & 4523.6581 & 0.27 & 0.5917 & 0.4822 & 0 \tabularnewline
56 & 3670 & 3680.9328 & 2948.4752 & 4595.3469 & 0.4907 & 0.3155 & 0.0149 & 0 \tabularnewline
57 & 4221 & 3269.6829 & 2619.0586 & 4081.9346 & 0.0109 & 0.167 & 0.8046 & 0 \tabularnewline
58 & 4404 & 3572.46 & 2861.587 & 4459.9274 & 0.0331 & 0.076 & 0.401 & 0 \tabularnewline
59 & 5086 & 4233.8944 & 3391.4046 & 5285.6748 & 0.0562 & 0.3756 & 0.4086 & 0.0058 \tabularnewline
60 & 5725 & 5152.9412 & 4127.5731 & 6433.0303 & 0.1905 & 0.5408 & 0.2532 & 0.2532 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151161&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]5029[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2075[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]3264[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]3308[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]3688[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]3136[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]2824[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]3644[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]4694[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]2914[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]3686[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]4358[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]5587[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]2265[/C][C]2237.0707[/C][C]1791.9228[/C][C]2792.8018[/C][C]0.4608[/C][C]0[/C][C]0.7162[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]3685[/C][C]3091.5389[/C][C]2476.363[/C][C]3859.5363[/C][C]0.0649[/C][C]0.9825[/C][C]0.3299[/C][C]0[/C][/ROW]
[ROW][C]51[/C][C]3754[/C][C]3340.6833[/C][C]2675.9309[/C][C]4170.5729[/C][C]0.1645[/C][C]0.2081[/C][C]0.5308[/C][C]0[/C][/ROW]
[ROW][C]52[/C][C]3708[/C][C]3102.9094[/C][C]2485.4709[/C][C]3873.7314[/C][C]0.062[/C][C]0.0489[/C][C]0.0684[/C][C]0[/C][/ROW]
[ROW][C]53[/C][C]3210[/C][C]3049.0431[/C][C]2442.3233[/C][C]3806.4837[/C][C]0.3385[/C][C]0.0441[/C][C]0.411[/C][C]0[/C][/ROW]
[ROW][C]54[/C][C]3517[/C][C]2905.5579[/C][C]2327.3898[/C][C]3627.3541[/C][C]0.0484[/C][C]0.2042[/C][C]0.5876[/C][C]0[/C][/ROW]
[ROW][C]55[/C][C]3905[/C][C]3623.5091[/C][C]2902.4781[/C][C]4523.6581[/C][C]0.27[/C][C]0.5917[/C][C]0.4822[/C][C]0[/C][/ROW]
[ROW][C]56[/C][C]3670[/C][C]3680.9328[/C][C]2948.4752[/C][C]4595.3469[/C][C]0.4907[/C][C]0.3155[/C][C]0.0149[/C][C]0[/C][/ROW]
[ROW][C]57[/C][C]4221[/C][C]3269.6829[/C][C]2619.0586[/C][C]4081.9346[/C][C]0.0109[/C][C]0.167[/C][C]0.8046[/C][C]0[/C][/ROW]
[ROW][C]58[/C][C]4404[/C][C]3572.46[/C][C]2861.587[/C][C]4459.9274[/C][C]0.0331[/C][C]0.076[/C][C]0.401[/C][C]0[/C][/ROW]
[ROW][C]59[/C][C]5086[/C][C]4233.8944[/C][C]3391.4046[/C][C]5285.6748[/C][C]0.0562[/C][C]0.3756[/C][C]0.4086[/C][C]0.0058[/C][/ROW]
[ROW][C]60[/C][C]5725[/C][C]5152.9412[/C][C]4127.5731[/C][C]6433.0303[/C][C]0.1905[/C][C]0.5408[/C][C]0.2532[/C][C]0.2532[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151161&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151161&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])
365029-------
372075-------
383264-------
393308-------
403688-------
413136-------
422824-------
433644-------
444694-------
452914-------
463686-------
474358-------
485587-------
4922652237.07071791.92282792.80180.460800.71620
5036853091.53892476.3633859.53630.06490.98250.32990
5137543340.68332675.93094170.57290.16450.20810.53080
5237083102.90942485.47093873.73140.0620.04890.06840
5332103049.04312442.32333806.48370.33850.04410.4110
5435172905.55792327.38983627.35410.04840.20420.58760
5539053623.50912902.47814523.65810.270.59170.48220
5636703680.93282948.47524595.34690.49070.31550.01490
5742213269.68292619.05864081.93460.01090.1670.80460
5844043572.462861.5874459.92740.03310.0760.4010
5950864233.89443391.40465285.67480.05620.37560.40860.0058
6057255152.94124127.57316433.03030.19050.54080.25320.2532







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.12670.01250780.048400
500.12670.1920.1022352196.026176488.0372420.1048
510.12670.12370.1094170830.7251174602.2665417.8544
520.12670.1950.1308366134.6367222485.359471.6835
530.12670.05280.115225907.1298183169.7132427.9833
540.12670.21040.1311373861.4304214951.6661463.6288
550.12670.07770.123479237.1097195563.8723442.226
560.1267-0.0030.1084119.5267171133.3291413.6826
570.12670.2910.1287905004.2524252674.5428502.6674
580.12670.23280.1391691458.7735296552.9659544.5668
590.12670.20130.1447726083.9232335601.2347579.311
600.12670.1110.1419327251.2803334905.4052578.7101

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.1267 & 0.0125 & 0 & 780.0484 & 0 & 0 \tabularnewline
50 & 0.1267 & 0.192 & 0.1022 & 352196.026 & 176488.0372 & 420.1048 \tabularnewline
51 & 0.1267 & 0.1237 & 0.1094 & 170830.7251 & 174602.2665 & 417.8544 \tabularnewline
52 & 0.1267 & 0.195 & 0.1308 & 366134.6367 & 222485.359 & 471.6835 \tabularnewline
53 & 0.1267 & 0.0528 & 0.1152 & 25907.1298 & 183169.7132 & 427.9833 \tabularnewline
54 & 0.1267 & 0.2104 & 0.1311 & 373861.4304 & 214951.6661 & 463.6288 \tabularnewline
55 & 0.1267 & 0.0777 & 0.1234 & 79237.1097 & 195563.8723 & 442.226 \tabularnewline
56 & 0.1267 & -0.003 & 0.1084 & 119.5267 & 171133.3291 & 413.6826 \tabularnewline
57 & 0.1267 & 0.291 & 0.1287 & 905004.2524 & 252674.5428 & 502.6674 \tabularnewline
58 & 0.1267 & 0.2328 & 0.1391 & 691458.7735 & 296552.9659 & 544.5668 \tabularnewline
59 & 0.1267 & 0.2013 & 0.1447 & 726083.9232 & 335601.2347 & 579.311 \tabularnewline
60 & 0.1267 & 0.111 & 0.1419 & 327251.2803 & 334905.4052 & 578.7101 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=151161&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.1267[/C][C]0.0125[/C][C]0[/C][C]780.0484[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.1267[/C][C]0.192[/C][C]0.1022[/C][C]352196.026[/C][C]176488.0372[/C][C]420.1048[/C][/ROW]
[ROW][C]51[/C][C]0.1267[/C][C]0.1237[/C][C]0.1094[/C][C]170830.7251[/C][C]174602.2665[/C][C]417.8544[/C][/ROW]
[ROW][C]52[/C][C]0.1267[/C][C]0.195[/C][C]0.1308[/C][C]366134.6367[/C][C]222485.359[/C][C]471.6835[/C][/ROW]
[ROW][C]53[/C][C]0.1267[/C][C]0.0528[/C][C]0.1152[/C][C]25907.1298[/C][C]183169.7132[/C][C]427.9833[/C][/ROW]
[ROW][C]54[/C][C]0.1267[/C][C]0.2104[/C][C]0.1311[/C][C]373861.4304[/C][C]214951.6661[/C][C]463.6288[/C][/ROW]
[ROW][C]55[/C][C]0.1267[/C][C]0.0777[/C][C]0.1234[/C][C]79237.1097[/C][C]195563.8723[/C][C]442.226[/C][/ROW]
[ROW][C]56[/C][C]0.1267[/C][C]-0.003[/C][C]0.1084[/C][C]119.5267[/C][C]171133.3291[/C][C]413.6826[/C][/ROW]
[ROW][C]57[/C][C]0.1267[/C][C]0.291[/C][C]0.1287[/C][C]905004.2524[/C][C]252674.5428[/C][C]502.6674[/C][/ROW]
[ROW][C]58[/C][C]0.1267[/C][C]0.2328[/C][C]0.1391[/C][C]691458.7735[/C][C]296552.9659[/C][C]544.5668[/C][/ROW]
[ROW][C]59[/C][C]0.1267[/C][C]0.2013[/C][C]0.1447[/C][C]726083.9232[/C][C]335601.2347[/C][C]579.311[/C][/ROW]
[ROW][C]60[/C][C]0.1267[/C][C]0.111[/C][C]0.1419[/C][C]327251.2803[/C][C]334905.4052[/C][C]578.7101[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=151161&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=151161&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.12670.01250780.048400
500.12670.1920.1022352196.026176488.0372420.1048
510.12670.12370.1094170830.7251174602.2665417.8544
520.12670.1950.1308366134.6367222485.359471.6835
530.12670.05280.115225907.1298183169.7132427.9833
540.12670.21040.1311373861.4304214951.6661463.6288
550.12670.07770.123479237.1097195563.8723442.226
560.1267-0.0030.1084119.5267171133.3291413.6826
570.12670.2910.1287905004.2524252674.5428502.6674
580.12670.23280.1391691458.7735296552.9659544.5668
590.12670.20130.1447726083.9232335601.2347579.311
600.12670.1110.1419327251.2803334905.4052578.7101



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