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, 25 Jan 2010 03:47:22 -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/2010/Jan/25/t1264416566132gptnz938ud49.htm/, Retrieved Mon, 06 May 2024 08:14:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=72424, Retrieved Mon, 06 May 2024 08:14:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact142
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [] [2009-12-17 19:09:08] [b98453cac15ba1066b407e146608df68]
- RMP   [ARIMA Forecasting] [] [2009-12-17 20:12:48] [b98453cac15ba1066b407e146608df68]
-   P       [ARIMA Forecasting] [Herberekening examen] [2010-01-25 10:47:22] [852eae237d08746109043531619a60c9] [Current]
Feedback Forum

Post a new message
Dataseries X:
277
260.6
291.6
275.4
275.3
231.7
238.8
274.2
277.8
299.1
286.6
232.3
294.1
267.5
309.7
280.7
287.3
235.7
256.4
289
290.8
321.9
291.8
241.4
295.5
258.2
306.1
281.5
283.1
237.4
274.8
299.3
300.4
340.9
318.8
265.7
322.7
281.6
323.5
312.6
310.8
262.8
273.8
320
310.3
342.2
320.1
265.6
327
300.7
346.4
317.3
326.2
270.7
278.2
324.6
321.8
343.5
354
278.2
330.2
307.3
375.9
335.3
339.3
280.3
293.7
341.2
345.1
368.7
369.4
288.4
341
319.1
374.2
344.5
337.3
281
282.2
321
325.4
366.3
380.3
300.7
359.3
327.6
383.6
352.4
329.4
294.5
333.5
334.3
358
396.1
387
307.2
363.9
344.7
397.6
376.8
337.1
299.3
323.1
329.1
347
462
436.5
360.4
415.5
382.1
432.2
424.3
386.7
354.5
375.8
368
402.4
426.5
433.3
338.5
416.8
381.1
445.7
412.4
394
348.2
380.1
373.7
393.6
434.2
430.7
344.5
411.9
370.5
437.3
411.3
385.5
341.3
384.2
373.2
415.8
448.6
454.3
350.3
419.1
398
456.1
430.1
399.8
362.7
384.9
385.3
432.3
468.9
442.7
370.2
439.4
393.9
468.7
438.8
430.1
366.3
391
380.9
431.4
465.4
471.5
387.5
446.4
421.5
504.8
492.1
421.3
396.7
428
421.9
465.6
525.8
499.9
435.3
479.5
473
554.4
489.6
462.2
420.3




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

\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 & 4 seconds \tabularnewline
R Server & 'Gwilym Jenkins' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=72424&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]4 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=72424&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=72424&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 time4 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[174])
162366.3-------
163391-------
164380.9-------
165431.4-------
166465.4-------
167471.5-------
168387.5-------
169446.4-------
170421.5-------
171504.8-------
172492.1-------
173421.3-------
174396.7-------
175428419.5632391.7277449.37670.28960.93360.96980.9336
176421.9413.5822383.7646445.71640.3060.18960.97690.8484
177465.6456.3108421.4116494.10030.3150.96290.90180.999
178525.8501.184461.0609544.79880.13430.94510.94611
179499.9492.0235450.4043537.48850.36710.07270.81191
180435.3401.2727366.1853439.72230.041400.75870.5922
181479.5471.909428.9611519.1570.37640.93560.8550.9991
182473434.2074393.3547479.3030.04590.02450.70960.9485
183554.4516.747466.8258572.00670.09090.93960.66411
184489.6489.6355440.8076543.8720.49950.00960.46450.9996
185462.2446.5273401.0162497.20350.27220.04790.83540.973
186420.3403.8001361.6222450.89750.24610.00750.61620.6162

\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[174]) \tabularnewline
162 & 366.3 & - & - & - & - & - & - & - \tabularnewline
163 & 391 & - & - & - & - & - & - & - \tabularnewline
164 & 380.9 & - & - & - & - & - & - & - \tabularnewline
165 & 431.4 & - & - & - & - & - & - & - \tabularnewline
166 & 465.4 & - & - & - & - & - & - & - \tabularnewline
167 & 471.5 & - & - & - & - & - & - & - \tabularnewline
168 & 387.5 & - & - & - & - & - & - & - \tabularnewline
169 & 446.4 & - & - & - & - & - & - & - \tabularnewline
170 & 421.5 & - & - & - & - & - & - & - \tabularnewline
171 & 504.8 & - & - & - & - & - & - & - \tabularnewline
172 & 492.1 & - & - & - & - & - & - & - \tabularnewline
173 & 421.3 & - & - & - & - & - & - & - \tabularnewline
174 & 396.7 & - & - & - & - & - & - & - \tabularnewline
175 & 428 & 419.5632 & 391.7277 & 449.3767 & 0.2896 & 0.9336 & 0.9698 & 0.9336 \tabularnewline
176 & 421.9 & 413.5822 & 383.7646 & 445.7164 & 0.306 & 0.1896 & 0.9769 & 0.8484 \tabularnewline
177 & 465.6 & 456.3108 & 421.4116 & 494.1003 & 0.315 & 0.9629 & 0.9018 & 0.999 \tabularnewline
178 & 525.8 & 501.184 & 461.0609 & 544.7988 & 0.1343 & 0.9451 & 0.9461 & 1 \tabularnewline
179 & 499.9 & 492.0235 & 450.4043 & 537.4885 & 0.3671 & 0.0727 & 0.8119 & 1 \tabularnewline
180 & 435.3 & 401.2727 & 366.1853 & 439.7223 & 0.0414 & 0 & 0.7587 & 0.5922 \tabularnewline
181 & 479.5 & 471.909 & 428.9611 & 519.157 & 0.3764 & 0.9356 & 0.855 & 0.9991 \tabularnewline
182 & 473 & 434.2074 & 393.3547 & 479.303 & 0.0459 & 0.0245 & 0.7096 & 0.9485 \tabularnewline
183 & 554.4 & 516.747 & 466.8258 & 572.0067 & 0.0909 & 0.9396 & 0.6641 & 1 \tabularnewline
184 & 489.6 & 489.6355 & 440.8076 & 543.872 & 0.4995 & 0.0096 & 0.4645 & 0.9996 \tabularnewline
185 & 462.2 & 446.5273 & 401.0162 & 497.2035 & 0.2722 & 0.0479 & 0.8354 & 0.973 \tabularnewline
186 & 420.3 & 403.8001 & 361.6222 & 450.8975 & 0.2461 & 0.0075 & 0.6162 & 0.6162 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=72424&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[174])[/C][/ROW]
[ROW][C]162[/C][C]366.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]163[/C][C]391[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]164[/C][C]380.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]165[/C][C]431.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]166[/C][C]465.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]167[/C][C]471.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]168[/C][C]387.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]169[/C][C]446.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]170[/C][C]421.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]171[/C][C]504.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]172[/C][C]492.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]173[/C][C]421.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]174[/C][C]396.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]175[/C][C]428[/C][C]419.5632[/C][C]391.7277[/C][C]449.3767[/C][C]0.2896[/C][C]0.9336[/C][C]0.9698[/C][C]0.9336[/C][/ROW]
[ROW][C]176[/C][C]421.9[/C][C]413.5822[/C][C]383.7646[/C][C]445.7164[/C][C]0.306[/C][C]0.1896[/C][C]0.9769[/C][C]0.8484[/C][/ROW]
[ROW][C]177[/C][C]465.6[/C][C]456.3108[/C][C]421.4116[/C][C]494.1003[/C][C]0.315[/C][C]0.9629[/C][C]0.9018[/C][C]0.999[/C][/ROW]
[ROW][C]178[/C][C]525.8[/C][C]501.184[/C][C]461.0609[/C][C]544.7988[/C][C]0.1343[/C][C]0.9451[/C][C]0.9461[/C][C]1[/C][/ROW]
[ROW][C]179[/C][C]499.9[/C][C]492.0235[/C][C]450.4043[/C][C]537.4885[/C][C]0.3671[/C][C]0.0727[/C][C]0.8119[/C][C]1[/C][/ROW]
[ROW][C]180[/C][C]435.3[/C][C]401.2727[/C][C]366.1853[/C][C]439.7223[/C][C]0.0414[/C][C]0[/C][C]0.7587[/C][C]0.5922[/C][/ROW]
[ROW][C]181[/C][C]479.5[/C][C]471.909[/C][C]428.9611[/C][C]519.157[/C][C]0.3764[/C][C]0.9356[/C][C]0.855[/C][C]0.9991[/C][/ROW]
[ROW][C]182[/C][C]473[/C][C]434.2074[/C][C]393.3547[/C][C]479.303[/C][C]0.0459[/C][C]0.0245[/C][C]0.7096[/C][C]0.9485[/C][/ROW]
[ROW][C]183[/C][C]554.4[/C][C]516.747[/C][C]466.8258[/C][C]572.0067[/C][C]0.0909[/C][C]0.9396[/C][C]0.6641[/C][C]1[/C][/ROW]
[ROW][C]184[/C][C]489.6[/C][C]489.6355[/C][C]440.8076[/C][C]543.872[/C][C]0.4995[/C][C]0.0096[/C][C]0.4645[/C][C]0.9996[/C][/ROW]
[ROW][C]185[/C][C]462.2[/C][C]446.5273[/C][C]401.0162[/C][C]497.2035[/C][C]0.2722[/C][C]0.0479[/C][C]0.8354[/C][C]0.973[/C][/ROW]
[ROW][C]186[/C][C]420.3[/C][C]403.8001[/C][C]361.6222[/C][C]450.8975[/C][C]0.2461[/C][C]0.0075[/C][C]0.6162[/C][C]0.6162[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=72424&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=72424&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[174])
162366.3-------
163391-------
164380.9-------
165431.4-------
166465.4-------
167471.5-------
168387.5-------
169446.4-------
170421.5-------
171504.8-------
172492.1-------
173421.3-------
174396.7-------
175428419.5632391.7277449.37670.28960.93360.96980.9336
176421.9413.5822383.7646445.71640.3060.18960.97690.8484
177465.6456.3108421.4116494.10030.3150.96290.90180.999
178525.8501.184461.0609544.79880.13430.94510.94611
179499.9492.0235450.4043537.48850.36710.07270.81191
180435.3401.2727366.1853439.72230.041400.75870.5922
181479.5471.909428.9611519.1570.37640.93560.8550.9991
182473434.2074393.3547479.3030.04590.02450.70960.9485
183554.4516.747466.8258572.00670.09090.93960.66411
184489.6489.6355440.8076543.8720.49950.00960.46450.9996
185462.2446.5273401.0162497.20350.27220.04790.83540.973
186420.3403.8001361.6222450.89750.24610.00750.61620.6162







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1750.03630.0201071.178800
1760.03960.02010.020169.186670.18278.3775
1770.04230.02040.020286.288475.55138.692
1780.04440.04910.0274605.9473208.150314.4274
1790.04710.0160.025162.0391178.92813.3764
1800.04890.08480.03511157.8545342.082418.4955
1810.05110.01610.032457.6228301.445417.3622
1820.0530.08930.03951504.8646451.872821.2573
1830.05460.07290.04321417.7462559.19223.6472
1840.0565-1e-040.03890.0013503.27322.4337
1850.05790.03510.0385245.6337479.851221.9055
1860.05950.04090.0387272.2472462.550921.507

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
175 & 0.0363 & 0.0201 & 0 & 71.1788 & 0 & 0 \tabularnewline
176 & 0.0396 & 0.0201 & 0.0201 & 69.1866 & 70.1827 & 8.3775 \tabularnewline
177 & 0.0423 & 0.0204 & 0.0202 & 86.2884 & 75.5513 & 8.692 \tabularnewline
178 & 0.0444 & 0.0491 & 0.0274 & 605.9473 & 208.1503 & 14.4274 \tabularnewline
179 & 0.0471 & 0.016 & 0.0251 & 62.0391 & 178.928 & 13.3764 \tabularnewline
180 & 0.0489 & 0.0848 & 0.0351 & 1157.8545 & 342.0824 & 18.4955 \tabularnewline
181 & 0.0511 & 0.0161 & 0.0324 & 57.6228 & 301.4454 & 17.3622 \tabularnewline
182 & 0.053 & 0.0893 & 0.0395 & 1504.8646 & 451.8728 & 21.2573 \tabularnewline
183 & 0.0546 & 0.0729 & 0.0432 & 1417.7462 & 559.192 & 23.6472 \tabularnewline
184 & 0.0565 & -1e-04 & 0.0389 & 0.0013 & 503.273 & 22.4337 \tabularnewline
185 & 0.0579 & 0.0351 & 0.0385 & 245.6337 & 479.8512 & 21.9055 \tabularnewline
186 & 0.0595 & 0.0409 & 0.0387 & 272.2472 & 462.5509 & 21.507 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=72424&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]175[/C][C]0.0363[/C][C]0.0201[/C][C]0[/C][C]71.1788[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]176[/C][C]0.0396[/C][C]0.0201[/C][C]0.0201[/C][C]69.1866[/C][C]70.1827[/C][C]8.3775[/C][/ROW]
[ROW][C]177[/C][C]0.0423[/C][C]0.0204[/C][C]0.0202[/C][C]86.2884[/C][C]75.5513[/C][C]8.692[/C][/ROW]
[ROW][C]178[/C][C]0.0444[/C][C]0.0491[/C][C]0.0274[/C][C]605.9473[/C][C]208.1503[/C][C]14.4274[/C][/ROW]
[ROW][C]179[/C][C]0.0471[/C][C]0.016[/C][C]0.0251[/C][C]62.0391[/C][C]178.928[/C][C]13.3764[/C][/ROW]
[ROW][C]180[/C][C]0.0489[/C][C]0.0848[/C][C]0.0351[/C][C]1157.8545[/C][C]342.0824[/C][C]18.4955[/C][/ROW]
[ROW][C]181[/C][C]0.0511[/C][C]0.0161[/C][C]0.0324[/C][C]57.6228[/C][C]301.4454[/C][C]17.3622[/C][/ROW]
[ROW][C]182[/C][C]0.053[/C][C]0.0893[/C][C]0.0395[/C][C]1504.8646[/C][C]451.8728[/C][C]21.2573[/C][/ROW]
[ROW][C]183[/C][C]0.0546[/C][C]0.0729[/C][C]0.0432[/C][C]1417.7462[/C][C]559.192[/C][C]23.6472[/C][/ROW]
[ROW][C]184[/C][C]0.0565[/C][C]-1e-04[/C][C]0.0389[/C][C]0.0013[/C][C]503.273[/C][C]22.4337[/C][/ROW]
[ROW][C]185[/C][C]0.0579[/C][C]0.0351[/C][C]0.0385[/C][C]245.6337[/C][C]479.8512[/C][C]21.9055[/C][/ROW]
[ROW][C]186[/C][C]0.0595[/C][C]0.0409[/C][C]0.0387[/C][C]272.2472[/C][C]462.5509[/C][C]21.507[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=72424&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=72424&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
1750.03630.0201071.178800
1760.03960.02010.020169.186670.18278.3775
1770.04230.02040.020286.288475.55138.692
1780.04440.04910.0274605.9473208.150314.4274
1790.04710.0160.025162.0391178.92813.3764
1800.04890.08480.03511157.8545342.082418.4955
1810.05110.01610.032457.6228301.445417.3622
1820.0530.08930.03951504.8646451.872821.2573
1830.05460.07290.04321417.7462559.19223.6472
1840.0565-1e-040.03890.0013503.27322.4337
1850.05790.03510.0385245.6337479.851221.9055
1860.05950.04090.0387272.2472462.550921.507



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