Free Statistics

of Irreproducible Research!

Author's title

Author*Unverified author*
R Software Modulerwasp_arimaforecasting.wasp
Title produced by softwareARIMA Forecasting
Date of computationThu, 20 Dec 2007 17:42:21 -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/21/t1198196686o9w03tq5bzpfrsp.htm/, Retrieved Tue, 07 May 2024 21:57:34 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=4778, Retrieved Tue, 07 May 2024 21:57:34 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsmarij
Estimated Impact239
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-       [ARIMA Forecasting] [paper uitvoer for...] [2007-12-21 00:42:21] [bd0e3b74339db15b9ec76abfe0d5b55e] [Current]
Feedback Forum

Post a new message
Dataseries X:
89.97
99.8
112.99
93.69
108.02
99.11
94.33
83.75
106.37
109.63
105.5
96.13
102.48
101.37
112.76
95.57
102.81
104.13
97.52
85.29
101.01
108.48
101.33
87.57
97.44
96.06
106.67
102.67
104.54
102.46
103.35
83.27
108.22
115.23
103.7
93.61
100.25
100.56
108.86
105.43
104.77
109.13
106.13
82.27
113.6
117.73
104.83
104.61
102.93
106.95
123.45
111.99
103.95
122.05
108.04
93.72
119.61
118.29
117.14
112.76
105.97
107.96
122.27
114.54
110.15
120.02
103.94
96.18
121.01
110.55
120.04
114.19




Summary of compuational 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 compuational 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=4778&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]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=4778&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4778&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 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[60])
48104.61-------
49102.93-------
50106.95-------
51123.45-------
52111.99-------
53103.95-------
54122.05-------
55108.04-------
5693.72-------
57119.61-------
58118.29-------
59117.14-------
60112.76-------
61105.97106.933698.0521115.81510.41580.09930.81150.0993
62107.96115.5874106.6774124.49730.04670.98280.97130.733
63122.27129.3015120.1073138.49560.066910.89390.9998
64114.54116.6541106.238127.07020.34540.14530.80990.7681
65110.15110.192199.6927120.69160.49690.20850.8780.3158
66120.02126.7115.9109137.4890.11250.99870.80090.9943
67103.94112.3488101.1429123.55470.07070.08980.77450.4713
6896.1898.411287.1006109.72170.34950.1690.79190.0065
69121.01123.4336111.9215134.94580.339910.74250.9654
70110.55121.9651110.2628133.66730.02790.56350.73090.9384
71120.04120.7824108.9862132.57870.45090.95550.72750.9087
72114.19115.9197103.9962127.84330.38810.24910.69830.6983

\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[60]) \tabularnewline
48 & 104.61 & - & - & - & - & - & - & - \tabularnewline
49 & 102.93 & - & - & - & - & - & - & - \tabularnewline
50 & 106.95 & - & - & - & - & - & - & - \tabularnewline
51 & 123.45 & - & - & - & - & - & - & - \tabularnewline
52 & 111.99 & - & - & - & - & - & - & - \tabularnewline
53 & 103.95 & - & - & - & - & - & - & - \tabularnewline
54 & 122.05 & - & - & - & - & - & - & - \tabularnewline
55 & 108.04 & - & - & - & - & - & - & - \tabularnewline
56 & 93.72 & - & - & - & - & - & - & - \tabularnewline
57 & 119.61 & - & - & - & - & - & - & - \tabularnewline
58 & 118.29 & - & - & - & - & - & - & - \tabularnewline
59 & 117.14 & - & - & - & - & - & - & - \tabularnewline
60 & 112.76 & - & - & - & - & - & - & - \tabularnewline
61 & 105.97 & 106.9336 & 98.0521 & 115.8151 & 0.4158 & 0.0993 & 0.8115 & 0.0993 \tabularnewline
62 & 107.96 & 115.5874 & 106.6774 & 124.4973 & 0.0467 & 0.9828 & 0.9713 & 0.733 \tabularnewline
63 & 122.27 & 129.3015 & 120.1073 & 138.4956 & 0.0669 & 1 & 0.8939 & 0.9998 \tabularnewline
64 & 114.54 & 116.6541 & 106.238 & 127.0702 & 0.3454 & 0.1453 & 0.8099 & 0.7681 \tabularnewline
65 & 110.15 & 110.1921 & 99.6927 & 120.6916 & 0.4969 & 0.2085 & 0.878 & 0.3158 \tabularnewline
66 & 120.02 & 126.7 & 115.9109 & 137.489 & 0.1125 & 0.9987 & 0.8009 & 0.9943 \tabularnewline
67 & 103.94 & 112.3488 & 101.1429 & 123.5547 & 0.0707 & 0.0898 & 0.7745 & 0.4713 \tabularnewline
68 & 96.18 & 98.4112 & 87.1006 & 109.7217 & 0.3495 & 0.169 & 0.7919 & 0.0065 \tabularnewline
69 & 121.01 & 123.4336 & 111.9215 & 134.9458 & 0.3399 & 1 & 0.7425 & 0.9654 \tabularnewline
70 & 110.55 & 121.9651 & 110.2628 & 133.6673 & 0.0279 & 0.5635 & 0.7309 & 0.9384 \tabularnewline
71 & 120.04 & 120.7824 & 108.9862 & 132.5787 & 0.4509 & 0.9555 & 0.7275 & 0.9087 \tabularnewline
72 & 114.19 & 115.9197 & 103.9962 & 127.8433 & 0.3881 & 0.2491 & 0.6983 & 0.6983 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4778&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[60])[/C][/ROW]
[ROW][C]48[/C][C]104.61[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]102.93[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]106.95[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]51[/C][C]123.45[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]111.99[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]103.95[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]122.05[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]108.04[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]93.72[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]119.61[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]118.29[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]117.14[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]112.76[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]105.97[/C][C]106.9336[/C][C]98.0521[/C][C]115.8151[/C][C]0.4158[/C][C]0.0993[/C][C]0.8115[/C][C]0.0993[/C][/ROW]
[ROW][C]62[/C][C]107.96[/C][C]115.5874[/C][C]106.6774[/C][C]124.4973[/C][C]0.0467[/C][C]0.9828[/C][C]0.9713[/C][C]0.733[/C][/ROW]
[ROW][C]63[/C][C]122.27[/C][C]129.3015[/C][C]120.1073[/C][C]138.4956[/C][C]0.0669[/C][C]1[/C][C]0.8939[/C][C]0.9998[/C][/ROW]
[ROW][C]64[/C][C]114.54[/C][C]116.6541[/C][C]106.238[/C][C]127.0702[/C][C]0.3454[/C][C]0.1453[/C][C]0.8099[/C][C]0.7681[/C][/ROW]
[ROW][C]65[/C][C]110.15[/C][C]110.1921[/C][C]99.6927[/C][C]120.6916[/C][C]0.4969[/C][C]0.2085[/C][C]0.878[/C][C]0.3158[/C][/ROW]
[ROW][C]66[/C][C]120.02[/C][C]126.7[/C][C]115.9109[/C][C]137.489[/C][C]0.1125[/C][C]0.9987[/C][C]0.8009[/C][C]0.9943[/C][/ROW]
[ROW][C]67[/C][C]103.94[/C][C]112.3488[/C][C]101.1429[/C][C]123.5547[/C][C]0.0707[/C][C]0.0898[/C][C]0.7745[/C][C]0.4713[/C][/ROW]
[ROW][C]68[/C][C]96.18[/C][C]98.4112[/C][C]87.1006[/C][C]109.7217[/C][C]0.3495[/C][C]0.169[/C][C]0.7919[/C][C]0.0065[/C][/ROW]
[ROW][C]69[/C][C]121.01[/C][C]123.4336[/C][C]111.9215[/C][C]134.9458[/C][C]0.3399[/C][C]1[/C][C]0.7425[/C][C]0.9654[/C][/ROW]
[ROW][C]70[/C][C]110.55[/C][C]121.9651[/C][C]110.2628[/C][C]133.6673[/C][C]0.0279[/C][C]0.5635[/C][C]0.7309[/C][C]0.9384[/C][/ROW]
[ROW][C]71[/C][C]120.04[/C][C]120.7824[/C][C]108.9862[/C][C]132.5787[/C][C]0.4509[/C][C]0.9555[/C][C]0.7275[/C][C]0.9087[/C][/ROW]
[ROW][C]72[/C][C]114.19[/C][C]115.9197[/C][C]103.9962[/C][C]127.8433[/C][C]0.3881[/C][C]0.2491[/C][C]0.6983[/C][C]0.6983[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4778&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4778&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[60])
48104.61-------
49102.93-------
50106.95-------
51123.45-------
52111.99-------
53103.95-------
54122.05-------
55108.04-------
5693.72-------
57119.61-------
58118.29-------
59117.14-------
60112.76-------
61105.97106.933698.0521115.81510.41580.09930.81150.0993
62107.96115.5874106.6774124.49730.04670.98280.97130.733
63122.27129.3015120.1073138.49560.066910.89390.9998
64114.54116.6541106.238127.07020.34540.14530.80990.7681
65110.15110.192199.6927120.69160.49690.20850.8780.3158
66120.02126.7115.9109137.4890.11250.99870.80090.9943
67103.94112.3488101.1429123.55470.07070.08980.77450.4713
6896.1898.411287.1006109.72170.34950.1690.79190.0065
69121.01123.4336111.9215134.94580.339910.74250.9654
70110.55121.9651110.2628133.66730.02790.56350.73090.9384
71120.04120.7824108.9862132.57870.45090.95550.72750.9087
72114.19115.9197103.9962127.84330.38810.24910.69830.6983







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
610.0424-0.0098e-040.92860.07740.2782
620.0393-0.0660.005558.17674.84812.2018
630.0363-0.05440.004549.44154.12012.0298
640.0456-0.01810.00154.46930.37240.6103
650.0486-4e-0400.00181e-040.0122
660.0434-0.05270.004444.62233.71851.9283
670.0509-0.07480.006270.70855.89242.4274
680.0586-0.02270.00194.97810.41480.6441
690.0476-0.01960.00165.87390.48950.6996
700.049-0.09360.0078130.303510.85863.2952
710.0498-0.00615e-040.55120.04590.2143
720.0525-0.01490.00122.9920.24930.4993

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
61 & 0.0424 & -0.009 & 8e-04 & 0.9286 & 0.0774 & 0.2782 \tabularnewline
62 & 0.0393 & -0.066 & 0.0055 & 58.1767 & 4.8481 & 2.2018 \tabularnewline
63 & 0.0363 & -0.0544 & 0.0045 & 49.4415 & 4.1201 & 2.0298 \tabularnewline
64 & 0.0456 & -0.0181 & 0.0015 & 4.4693 & 0.3724 & 0.6103 \tabularnewline
65 & 0.0486 & -4e-04 & 0 & 0.0018 & 1e-04 & 0.0122 \tabularnewline
66 & 0.0434 & -0.0527 & 0.0044 & 44.6223 & 3.7185 & 1.9283 \tabularnewline
67 & 0.0509 & -0.0748 & 0.0062 & 70.7085 & 5.8924 & 2.4274 \tabularnewline
68 & 0.0586 & -0.0227 & 0.0019 & 4.9781 & 0.4148 & 0.6441 \tabularnewline
69 & 0.0476 & -0.0196 & 0.0016 & 5.8739 & 0.4895 & 0.6996 \tabularnewline
70 & 0.049 & -0.0936 & 0.0078 & 130.3035 & 10.8586 & 3.2952 \tabularnewline
71 & 0.0498 & -0.0061 & 5e-04 & 0.5512 & 0.0459 & 0.2143 \tabularnewline
72 & 0.0525 & -0.0149 & 0.0012 & 2.992 & 0.2493 & 0.4993 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=4778&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]61[/C][C]0.0424[/C][C]-0.009[/C][C]8e-04[/C][C]0.9286[/C][C]0.0774[/C][C]0.2782[/C][/ROW]
[ROW][C]62[/C][C]0.0393[/C][C]-0.066[/C][C]0.0055[/C][C]58.1767[/C][C]4.8481[/C][C]2.2018[/C][/ROW]
[ROW][C]63[/C][C]0.0363[/C][C]-0.0544[/C][C]0.0045[/C][C]49.4415[/C][C]4.1201[/C][C]2.0298[/C][/ROW]
[ROW][C]64[/C][C]0.0456[/C][C]-0.0181[/C][C]0.0015[/C][C]4.4693[/C][C]0.3724[/C][C]0.6103[/C][/ROW]
[ROW][C]65[/C][C]0.0486[/C][C]-4e-04[/C][C]0[/C][C]0.0018[/C][C]1e-04[/C][C]0.0122[/C][/ROW]
[ROW][C]66[/C][C]0.0434[/C][C]-0.0527[/C][C]0.0044[/C][C]44.6223[/C][C]3.7185[/C][C]1.9283[/C][/ROW]
[ROW][C]67[/C][C]0.0509[/C][C]-0.0748[/C][C]0.0062[/C][C]70.7085[/C][C]5.8924[/C][C]2.4274[/C][/ROW]
[ROW][C]68[/C][C]0.0586[/C][C]-0.0227[/C][C]0.0019[/C][C]4.9781[/C][C]0.4148[/C][C]0.6441[/C][/ROW]
[ROW][C]69[/C][C]0.0476[/C][C]-0.0196[/C][C]0.0016[/C][C]5.8739[/C][C]0.4895[/C][C]0.6996[/C][/ROW]
[ROW][C]70[/C][C]0.049[/C][C]-0.0936[/C][C]0.0078[/C][C]130.3035[/C][C]10.8586[/C][C]3.2952[/C][/ROW]
[ROW][C]71[/C][C]0.0498[/C][C]-0.0061[/C][C]5e-04[/C][C]0.5512[/C][C]0.0459[/C][C]0.2143[/C][/ROW]
[ROW][C]72[/C][C]0.0525[/C][C]-0.0149[/C][C]0.0012[/C][C]2.992[/C][C]0.2493[/C][C]0.4993[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=4778&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=4778&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
610.0424-0.0098e-040.92860.07740.2782
620.0393-0.0660.005558.17674.84812.2018
630.0363-0.05440.004549.44154.12012.0298
640.0456-0.01810.00154.46930.37240.6103
650.0486-4e-0400.00181e-040.0122
660.0434-0.05270.004444.62233.71851.9283
670.0509-0.07480.006270.70855.89242.4274
680.0586-0.02270.00194.97810.41480.6441
690.0476-0.01960.00165.87390.48950.6996
700.049-0.09360.0078130.303510.85863.2952
710.0498-0.00615e-040.55120.04590.2143
720.0525-0.01490.00122.9920.24930.4993



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