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, 10 Nov 2011 04:16:08 -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/Nov/10/t13209170317n4uoruje1443zd.htm/, Retrieved Fri, 29 Mar 2024 11:05:00 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=141103, Retrieved Fri, 29 Mar 2024 11:05:00 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact125
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Bivariate Data Series] [Bivariate dataset] [2008-01-05 23:51:08] [74be16979710d4c4e7c6647856088456]
- RMPD  [Blocked Bootstrap Plot - Central Tendency] [Colombia Coffee] [2008-01-07 10:26:26] [74be16979710d4c4e7c6647856088456]
- RMPD      [ARIMA Forecasting] [ARIMA Yt] [2011-11-10 09:16:08] [614dd89c388120cee0dd25886939832b] [Current]
Feedback Forum

Post a new message
Dataseries X:
255
280.2
299.9
339.2
374.2
393.5
389.2
381.7
375.2
369
357.4
352.1
346.5
342.9
340.3
328.3
322.9
314.3
308.9
294
285.6
281.2
280.3
278.8
274.5
270.4
263.4
259.9
258
262.7
284.7
311.3
322.1
327
331.3
333.3
321.4
327
320
314.7
316.7
314.4
321.3
318.2
307.2
301.3
287.5
277.7
274.4
258.8
253.3
251
248.4
249.5
246.1
244.5
243.6
244
240.8
249.8
248
259.4
260.5
260.8
261.3
259.5
256.6
257.9
256.5
254.2
253.3
253.8
255.5
257.1
257.3
253.2
252.8
252
250.7
252.2
250
251
253.4
251.2
255.6
261.1
258.9
259.9
261.2
264.7
267.1
266.4
267.7
268.6
267.5
268.5
268.5
270.5
270.9
270.1
269.3
269.8
270.1
264.9
263.7
264.8
263.7
255.9
276.2
360.1
380.5
373.7
369.8
366.6
359.3
345.8
326.2
324.5
328.1
327.5
324.4
316.5
310.9
301.5
291.7
290.4
287.4
277.7
281.6
288
276
272.9
283
283.3
276.8
284.5
282.7
281.2
287.4
283.1
284
285.5
289.2
292.5
296.4
305.2
303.9
311.5
316.3
316.7
322.5
317.1
309.8
303.8
290.3
293.7
291.7
296.5
289.1
288.5
293.8
297.7
305.4
302.7
302.5
303
294.5
294.1
294.5
297.1
289.4
292.4
287.9
286.6
280.5
272.4
269.2
270.6
267.3
262.5
266.8
268.8
263.1
261.2
266
262.5
265.2
261.3
253.7
249.2
239.1
236.4
235.2
245.2
246.2
247.7
251.4
253.3
254.8
250
249.3
241.5
243.3
248
253
252.9
251.5
251.6
253.5
259.8
334.1
448
445.8
445
448.2
438.2
439.8
423.4
410.8
408.4
406.7
405.9
402.7
405.1
399.6
386.5
381.4
375.2
357.7
359
355
352.7
344.4
343.8
338
339
333.3
334.4
328.3
330.7
330
331.6
351.2
389.4
410.9
442.8
462.8
466.9
461.7
439.2
430.3
416.1
402.5
397.3
403.3
395.9
387.8
378.6
377.1
370.4
362
350.3
348.2
344.6
343.5
342.8
347.6
346.6
349.5
342.1
342
342.8
339.3
348.2
333.7
334.7
354
367.7
363.3
358.4
353.1
343.1
344.6
344.4
333.9
331.7
324.3
321.2
322.4
321.7
320.5
312.8
309.7
315.6
309.7
304.6
302.5
301.5
298.8
291.3
293.6
294.6
285.9
297.6
301.1
293.8
297.7
292.9
292.1
287.2
288.2
283.8
299.9
292.4
293.3
300.8
293.7
293.1
294.4
292.1
291.9
282.5
277.9
287.5
289.2
285.6
293.2
290.8
283.1
275
287.8
287.8
287.4
284
277.8
277.6
304.9
294
300.9
324
332.9
341.6
333.4
348.2
344.7
344.7
329.3
323.5
323.2
317.4
330.1
329.2
334.9
315.8
315.4
319.6
317.3
313.8
315.8
311.3




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=141103&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'Gwilym Jenkins' @ jenkins.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[348])
347329.3-------
348323.5-------
349323.2307.9382210.4924405.3840.37940.37710.37710.3771
350317.4307.9382210.4924405.3840.42450.37940.37940.3771
351330.1307.9382210.4924405.3840.32790.42450.42450.3771
352329.2307.9382210.4924405.3840.33450.32790.32790.3771
353334.9307.9382210.4924405.3840.29380.33450.33450.3771
354315.8307.9382210.4924405.3840.43720.29380.29380.3771
355315.4307.9382210.4924405.3840.44030.43720.43720.3771
356319.6307.9382210.4924405.3840.40730.44030.44030.3771
357317.3307.9382210.4924405.3840.42530.40730.40730.3771
358313.8307.9382210.4924405.3840.45310.42530.42530.3771
359315.8307.9382210.4924405.3840.43720.45310.45310.3771
360311.3307.9382210.4924405.3840.4730.43720.43720.3771

\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[348]) \tabularnewline
347 & 329.3 & - & - & - & - & - & - & - \tabularnewline
348 & 323.5 & - & - & - & - & - & - & - \tabularnewline
349 & 323.2 & 307.9382 & 210.4924 & 405.384 & 0.3794 & 0.3771 & 0.3771 & 0.3771 \tabularnewline
350 & 317.4 & 307.9382 & 210.4924 & 405.384 & 0.4245 & 0.3794 & 0.3794 & 0.3771 \tabularnewline
351 & 330.1 & 307.9382 & 210.4924 & 405.384 & 0.3279 & 0.4245 & 0.4245 & 0.3771 \tabularnewline
352 & 329.2 & 307.9382 & 210.4924 & 405.384 & 0.3345 & 0.3279 & 0.3279 & 0.3771 \tabularnewline
353 & 334.9 & 307.9382 & 210.4924 & 405.384 & 0.2938 & 0.3345 & 0.3345 & 0.3771 \tabularnewline
354 & 315.8 & 307.9382 & 210.4924 & 405.384 & 0.4372 & 0.2938 & 0.2938 & 0.3771 \tabularnewline
355 & 315.4 & 307.9382 & 210.4924 & 405.384 & 0.4403 & 0.4372 & 0.4372 & 0.3771 \tabularnewline
356 & 319.6 & 307.9382 & 210.4924 & 405.384 & 0.4073 & 0.4403 & 0.4403 & 0.3771 \tabularnewline
357 & 317.3 & 307.9382 & 210.4924 & 405.384 & 0.4253 & 0.4073 & 0.4073 & 0.3771 \tabularnewline
358 & 313.8 & 307.9382 & 210.4924 & 405.384 & 0.4531 & 0.4253 & 0.4253 & 0.3771 \tabularnewline
359 & 315.8 & 307.9382 & 210.4924 & 405.384 & 0.4372 & 0.4531 & 0.4531 & 0.3771 \tabularnewline
360 & 311.3 & 307.9382 & 210.4924 & 405.384 & 0.473 & 0.4372 & 0.4372 & 0.3771 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=141103&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[348])[/C][/ROW]
[ROW][C]347[/C][C]329.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]348[/C][C]323.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]349[/C][C]323.2[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.3794[/C][C]0.3771[/C][C]0.3771[/C][C]0.3771[/C][/ROW]
[ROW][C]350[/C][C]317.4[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.4245[/C][C]0.3794[/C][C]0.3794[/C][C]0.3771[/C][/ROW]
[ROW][C]351[/C][C]330.1[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.3279[/C][C]0.4245[/C][C]0.4245[/C][C]0.3771[/C][/ROW]
[ROW][C]352[/C][C]329.2[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.3345[/C][C]0.3279[/C][C]0.3279[/C][C]0.3771[/C][/ROW]
[ROW][C]353[/C][C]334.9[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.2938[/C][C]0.3345[/C][C]0.3345[/C][C]0.3771[/C][/ROW]
[ROW][C]354[/C][C]315.8[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.4372[/C][C]0.2938[/C][C]0.2938[/C][C]0.3771[/C][/ROW]
[ROW][C]355[/C][C]315.4[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.4403[/C][C]0.4372[/C][C]0.4372[/C][C]0.3771[/C][/ROW]
[ROW][C]356[/C][C]319.6[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.4073[/C][C]0.4403[/C][C]0.4403[/C][C]0.3771[/C][/ROW]
[ROW][C]357[/C][C]317.3[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.4253[/C][C]0.4073[/C][C]0.4073[/C][C]0.3771[/C][/ROW]
[ROW][C]358[/C][C]313.8[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.4531[/C][C]0.4253[/C][C]0.4253[/C][C]0.3771[/C][/ROW]
[ROW][C]359[/C][C]315.8[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.4372[/C][C]0.4531[/C][C]0.4531[/C][C]0.3771[/C][/ROW]
[ROW][C]360[/C][C]311.3[/C][C]307.9382[/C][C]210.4924[/C][C]405.384[/C][C]0.473[/C][C]0.4372[/C][C]0.4372[/C][C]0.3771[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=141103&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=141103&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[348])
347329.3-------
348323.5-------
349323.2307.9382210.4924405.3840.37940.37710.37710.3771
350317.4307.9382210.4924405.3840.42450.37940.37940.3771
351330.1307.9382210.4924405.3840.32790.42450.42450.3771
352329.2307.9382210.4924405.3840.33450.32790.32790.3771
353334.9307.9382210.4924405.3840.29380.33450.33450.3771
354315.8307.9382210.4924405.3840.43720.29380.29380.3771
355315.4307.9382210.4924405.3840.44030.43720.43720.3771
356319.6307.9382210.4924405.3840.40730.44030.44030.3771
357317.3307.9382210.4924405.3840.42530.40730.40730.3771
358313.8307.9382210.4924405.3840.45310.42530.42530.3771
359315.8307.9382210.4924405.3840.43720.45310.45310.3771
360311.3307.9382210.4924405.3840.4730.43720.43720.3771







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
3490.16150.04960232.92200
3500.16150.03070.040189.5253161.223612.6974
3510.16150.0720.0508491.1446271.197316.4681
3520.16150.0690.0553452.0634316.413817.788
3530.16150.08760.0618726.9377398.518619.9629
3540.16150.02550.055761.8076342.400118.5041
3550.16150.02420.051255.6782301.439817.362
3560.16150.03790.0496135.9972280.759516.7559
3570.16150.03040.047487.643259.302116.1029
3580.16150.0190.044634.3605236.807915.3886
3590.16150.02550.042961.8076220.898814.8627
3600.16150.01090.040211.3016203.432414.263

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
349 & 0.1615 & 0.0496 & 0 & 232.922 & 0 & 0 \tabularnewline
350 & 0.1615 & 0.0307 & 0.0401 & 89.5253 & 161.2236 & 12.6974 \tabularnewline
351 & 0.1615 & 0.072 & 0.0508 & 491.1446 & 271.1973 & 16.4681 \tabularnewline
352 & 0.1615 & 0.069 & 0.0553 & 452.0634 & 316.4138 & 17.788 \tabularnewline
353 & 0.1615 & 0.0876 & 0.0618 & 726.9377 & 398.5186 & 19.9629 \tabularnewline
354 & 0.1615 & 0.0255 & 0.0557 & 61.8076 & 342.4001 & 18.5041 \tabularnewline
355 & 0.1615 & 0.0242 & 0.0512 & 55.6782 & 301.4398 & 17.362 \tabularnewline
356 & 0.1615 & 0.0379 & 0.0496 & 135.9972 & 280.7595 & 16.7559 \tabularnewline
357 & 0.1615 & 0.0304 & 0.0474 & 87.643 & 259.3021 & 16.1029 \tabularnewline
358 & 0.1615 & 0.019 & 0.0446 & 34.3605 & 236.8079 & 15.3886 \tabularnewline
359 & 0.1615 & 0.0255 & 0.0429 & 61.8076 & 220.8988 & 14.8627 \tabularnewline
360 & 0.1615 & 0.0109 & 0.0402 & 11.3016 & 203.4324 & 14.263 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=141103&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]349[/C][C]0.1615[/C][C]0.0496[/C][C]0[/C][C]232.922[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]350[/C][C]0.1615[/C][C]0.0307[/C][C]0.0401[/C][C]89.5253[/C][C]161.2236[/C][C]12.6974[/C][/ROW]
[ROW][C]351[/C][C]0.1615[/C][C]0.072[/C][C]0.0508[/C][C]491.1446[/C][C]271.1973[/C][C]16.4681[/C][/ROW]
[ROW][C]352[/C][C]0.1615[/C][C]0.069[/C][C]0.0553[/C][C]452.0634[/C][C]316.4138[/C][C]17.788[/C][/ROW]
[ROW][C]353[/C][C]0.1615[/C][C]0.0876[/C][C]0.0618[/C][C]726.9377[/C][C]398.5186[/C][C]19.9629[/C][/ROW]
[ROW][C]354[/C][C]0.1615[/C][C]0.0255[/C][C]0.0557[/C][C]61.8076[/C][C]342.4001[/C][C]18.5041[/C][/ROW]
[ROW][C]355[/C][C]0.1615[/C][C]0.0242[/C][C]0.0512[/C][C]55.6782[/C][C]301.4398[/C][C]17.362[/C][/ROW]
[ROW][C]356[/C][C]0.1615[/C][C]0.0379[/C][C]0.0496[/C][C]135.9972[/C][C]280.7595[/C][C]16.7559[/C][/ROW]
[ROW][C]357[/C][C]0.1615[/C][C]0.0304[/C][C]0.0474[/C][C]87.643[/C][C]259.3021[/C][C]16.1029[/C][/ROW]
[ROW][C]358[/C][C]0.1615[/C][C]0.019[/C][C]0.0446[/C][C]34.3605[/C][C]236.8079[/C][C]15.3886[/C][/ROW]
[ROW][C]359[/C][C]0.1615[/C][C]0.0255[/C][C]0.0429[/C][C]61.8076[/C][C]220.8988[/C][C]14.8627[/C][/ROW]
[ROW][C]360[/C][C]0.1615[/C][C]0.0109[/C][C]0.0402[/C][C]11.3016[/C][C]203.4324[/C][C]14.263[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=141103&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=141103&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
3490.16150.04960232.92200
3500.16150.03070.040189.5253161.223612.6974
3510.16150.0720.0508491.1446271.197316.4681
3520.16150.0690.0553452.0634316.413817.788
3530.16150.08760.0618726.9377398.518619.9629
3540.16150.02550.055761.8076342.400118.5041
3550.16150.02420.051255.6782301.439817.362
3560.16150.03790.0496135.9972280.759516.7559
3570.16150.03040.047487.643259.302116.1029
3580.16150.0190.044634.3605236.807915.3886
3590.16150.02550.042961.8076220.898814.8627
3600.16150.01090.040211.3016203.432414.263



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