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 computationSat, 24 Nov 2012 08:43:48 -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/2012/Nov/24/t1353764935foi1jyt1qdagwoz.htm/, Retrieved Mon, 29 Apr 2024 03:23:03 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=192413, Retrieved Mon, 29 Apr 2024 03:23:03 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact83
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
- R  D        [ARIMA Forecasting] [Cut off last obse...] [2012-11-24 13:43:48] [c63d55528b56cf8bb48e0b5d1a959d8e] [Current]
Feedback Forum

Post a new message
Dataseries X:
236.422
250.580
279.515
264.417
283.706
281.288
271.146
283.944
269.155
270.899
276.507
319.957
250.746
247.772
280.449
274.925
296.013
287.881
279.098
294.763
261.924
291.596
287.537
326.201
255.598
253.086
285.261
284.747
300.402
288.854
295.433
307.256
273.189
287.540
290.705
337.006
268.335
259.060
293.703
294.262
312.404
301.014
309.942
317.079
293.912
304.060
301.299
357.634
281.493
282.478
319.111
315.223
328.445
321.081
328.040
326.362
313.566
319.768
324.315
387.243
293.308
295.109
339.190
335.678
345.401
351.002
351.889
355.773
333.363
336.214
343.910
405.788
318.682
314.189
362.141
351.811
373.727
366.795
362.393
376.006
346.423
349.007
357.224
418.473
329.169
323.456
374.439
358.806
391.816
376.944
372.665
388.357
354.241
368.982
378.233
426.699
343.241
344.577
373.623
369.688
398.816
379.387
384.666
383.879
351.578
350.920
336.629
385.504
311.330
300.545
329.718
331.023
348.944
345.650
349.260
354.597
325.769
339.734
340.543
401.585
315.998
312.327
362.217
358.067
367.321
360.372
363.830
364.525
347.945
357.404
368.182
429.343




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=192413&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 time2 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[120])
108385.504-------
109311.33-------
110300.545-------
111329.718-------
112331.023-------
113348.944-------
114345.65-------
115349.26-------
116354.597-------
117325.769-------
118339.734-------
119340.543-------
120401.585-------
121315.998316.4237303.5652329.54890.474700.77660
122312.327312.3193297.9841326.99120.49960.31160.94210
123362.217352.1199335.6522368.98210.120310.99540
124358.067345.3353326.3231364.88570.10090.04530.92430
125367.321366.9418346.0677388.42720.48620.79090.94978e-04
126360.372358.876336.798381.65480.44880.23370.87241e-04
127363.83359.3416335.6664383.82360.35970.46710.79024e-04
128364.525367.3486342.2187393.36890.41580.60450.83160.005
129347.945339.1538313.7942365.49860.25650.02950.84030
130357.404348.0623321.1749376.03030.25630.50330.72031e-04
131368.182349.5585321.5415378.74580.10550.29920.72752e-04
132429.343404.9692373.5983437.60470.07160.98640.58050.5805

\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[120]) \tabularnewline
108 & 385.504 & - & - & - & - & - & - & - \tabularnewline
109 & 311.33 & - & - & - & - & - & - & - \tabularnewline
110 & 300.545 & - & - & - & - & - & - & - \tabularnewline
111 & 329.718 & - & - & - & - & - & - & - \tabularnewline
112 & 331.023 & - & - & - & - & - & - & - \tabularnewline
113 & 348.944 & - & - & - & - & - & - & - \tabularnewline
114 & 345.65 & - & - & - & - & - & - & - \tabularnewline
115 & 349.26 & - & - & - & - & - & - & - \tabularnewline
116 & 354.597 & - & - & - & - & - & - & - \tabularnewline
117 & 325.769 & - & - & - & - & - & - & - \tabularnewline
118 & 339.734 & - & - & - & - & - & - & - \tabularnewline
119 & 340.543 & - & - & - & - & - & - & - \tabularnewline
120 & 401.585 & - & - & - & - & - & - & - \tabularnewline
121 & 315.998 & 316.4237 & 303.5652 & 329.5489 & 0.4747 & 0 & 0.7766 & 0 \tabularnewline
122 & 312.327 & 312.3193 & 297.9841 & 326.9912 & 0.4996 & 0.3116 & 0.9421 & 0 \tabularnewline
123 & 362.217 & 352.1199 & 335.6522 & 368.9821 & 0.1203 & 1 & 0.9954 & 0 \tabularnewline
124 & 358.067 & 345.3353 & 326.3231 & 364.8857 & 0.1009 & 0.0453 & 0.9243 & 0 \tabularnewline
125 & 367.321 & 366.9418 & 346.0677 & 388.4272 & 0.4862 & 0.7909 & 0.9497 & 8e-04 \tabularnewline
126 & 360.372 & 358.876 & 336.798 & 381.6548 & 0.4488 & 0.2337 & 0.8724 & 1e-04 \tabularnewline
127 & 363.83 & 359.3416 & 335.6664 & 383.8236 & 0.3597 & 0.4671 & 0.7902 & 4e-04 \tabularnewline
128 & 364.525 & 367.3486 & 342.2187 & 393.3689 & 0.4158 & 0.6045 & 0.8316 & 0.005 \tabularnewline
129 & 347.945 & 339.1538 & 313.7942 & 365.4986 & 0.2565 & 0.0295 & 0.8403 & 0 \tabularnewline
130 & 357.404 & 348.0623 & 321.1749 & 376.0303 & 0.2563 & 0.5033 & 0.7203 & 1e-04 \tabularnewline
131 & 368.182 & 349.5585 & 321.5415 & 378.7458 & 0.1055 & 0.2992 & 0.7275 & 2e-04 \tabularnewline
132 & 429.343 & 404.9692 & 373.5983 & 437.6047 & 0.0716 & 0.9864 & 0.5805 & 0.5805 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=192413&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[120])[/C][/ROW]
[ROW][C]108[/C][C]385.504[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]311.33[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]110[/C][C]300.545[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]111[/C][C]329.718[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]112[/C][C]331.023[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]113[/C][C]348.944[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]114[/C][C]345.65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]115[/C][C]349.26[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]116[/C][C]354.597[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]117[/C][C]325.769[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]118[/C][C]339.734[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]119[/C][C]340.543[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]120[/C][C]401.585[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]121[/C][C]315.998[/C][C]316.4237[/C][C]303.5652[/C][C]329.5489[/C][C]0.4747[/C][C]0[/C][C]0.7766[/C][C]0[/C][/ROW]
[ROW][C]122[/C][C]312.327[/C][C]312.3193[/C][C]297.9841[/C][C]326.9912[/C][C]0.4996[/C][C]0.3116[/C][C]0.9421[/C][C]0[/C][/ROW]
[ROW][C]123[/C][C]362.217[/C][C]352.1199[/C][C]335.6522[/C][C]368.9821[/C][C]0.1203[/C][C]1[/C][C]0.9954[/C][C]0[/C][/ROW]
[ROW][C]124[/C][C]358.067[/C][C]345.3353[/C][C]326.3231[/C][C]364.8857[/C][C]0.1009[/C][C]0.0453[/C][C]0.9243[/C][C]0[/C][/ROW]
[ROW][C]125[/C][C]367.321[/C][C]366.9418[/C][C]346.0677[/C][C]388.4272[/C][C]0.4862[/C][C]0.7909[/C][C]0.9497[/C][C]8e-04[/C][/ROW]
[ROW][C]126[/C][C]360.372[/C][C]358.876[/C][C]336.798[/C][C]381.6548[/C][C]0.4488[/C][C]0.2337[/C][C]0.8724[/C][C]1e-04[/C][/ROW]
[ROW][C]127[/C][C]363.83[/C][C]359.3416[/C][C]335.6664[/C][C]383.8236[/C][C]0.3597[/C][C]0.4671[/C][C]0.7902[/C][C]4e-04[/C][/ROW]
[ROW][C]128[/C][C]364.525[/C][C]367.3486[/C][C]342.2187[/C][C]393.3689[/C][C]0.4158[/C][C]0.6045[/C][C]0.8316[/C][C]0.005[/C][/ROW]
[ROW][C]129[/C][C]347.945[/C][C]339.1538[/C][C]313.7942[/C][C]365.4986[/C][C]0.2565[/C][C]0.0295[/C][C]0.8403[/C][C]0[/C][/ROW]
[ROW][C]130[/C][C]357.404[/C][C]348.0623[/C][C]321.1749[/C][C]376.0303[/C][C]0.2563[/C][C]0.5033[/C][C]0.7203[/C][C]1e-04[/C][/ROW]
[ROW][C]131[/C][C]368.182[/C][C]349.5585[/C][C]321.5415[/C][C]378.7458[/C][C]0.1055[/C][C]0.2992[/C][C]0.7275[/C][C]2e-04[/C][/ROW]
[ROW][C]132[/C][C]429.343[/C][C]404.9692[/C][C]373.5983[/C][C]437.6047[/C][C]0.0716[/C][C]0.9864[/C][C]0.5805[/C][C]0.5805[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=192413&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=192413&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[120])
108385.504-------
109311.33-------
110300.545-------
111329.718-------
112331.023-------
113348.944-------
114345.65-------
115349.26-------
116354.597-------
117325.769-------
118339.734-------
119340.543-------
120401.585-------
121315.998316.4237303.5652329.54890.474700.77660
122312.327312.3193297.9841326.99120.49960.31160.94210
123362.217352.1199335.6522368.98210.120310.99540
124358.067345.3353326.3231364.88570.10090.04530.92430
125367.321366.9418346.0677388.42720.48620.79090.94978e-04
126360.372358.876336.798381.65480.44880.23370.87241e-04
127363.83359.3416335.6664383.82360.35970.46710.79024e-04
128364.525367.3486342.2187393.36890.41580.60450.83160.005
129347.945339.1538313.7942365.49860.25650.02950.84030
130357.404348.0623321.1749376.03030.25630.50330.72031e-04
131368.182349.5585321.5415378.74580.10550.29920.72752e-04
132429.343404.9692373.5983437.60470.07160.98640.58050.5805







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1210.0212-0.001300.181200
1220.02407e-041e-040.09060.3011
1230.02440.02870.01101.950434.04395.8347
1240.02890.03690.0167162.097366.05738.1276
1250.02990.0010.01360.143852.87467.2715
1260.03240.00420.0122.238144.43526.666
1270.03480.01250.012120.145540.96526.4004
1280.0361-0.00770.01157.97336.84126.0697
1290.03960.02590.013177.285841.3356.4292
1300.0410.02680.014587.267245.92826.777
1310.04260.05330.018346.83373.28328.5606
1320.04110.06020.0215594.0805116.68310.802

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
121 & 0.0212 & -0.0013 & 0 & 0.1812 & 0 & 0 \tabularnewline
122 & 0.024 & 0 & 7e-04 & 1e-04 & 0.0906 & 0.3011 \tabularnewline
123 & 0.0244 & 0.0287 & 0.01 & 101.9504 & 34.0439 & 5.8347 \tabularnewline
124 & 0.0289 & 0.0369 & 0.0167 & 162.0973 & 66.0573 & 8.1276 \tabularnewline
125 & 0.0299 & 0.001 & 0.0136 & 0.1438 & 52.8746 & 7.2715 \tabularnewline
126 & 0.0324 & 0.0042 & 0.012 & 2.2381 & 44.4352 & 6.666 \tabularnewline
127 & 0.0348 & 0.0125 & 0.0121 & 20.1455 & 40.9652 & 6.4004 \tabularnewline
128 & 0.0361 & -0.0077 & 0.0115 & 7.973 & 36.8412 & 6.0697 \tabularnewline
129 & 0.0396 & 0.0259 & 0.0131 & 77.2858 & 41.335 & 6.4292 \tabularnewline
130 & 0.041 & 0.0268 & 0.0145 & 87.2672 & 45.9282 & 6.777 \tabularnewline
131 & 0.0426 & 0.0533 & 0.018 & 346.833 & 73.2832 & 8.5606 \tabularnewline
132 & 0.0411 & 0.0602 & 0.0215 & 594.0805 & 116.683 & 10.802 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=192413&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]121[/C][C]0.0212[/C][C]-0.0013[/C][C]0[/C][C]0.1812[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]122[/C][C]0.024[/C][C]0[/C][C]7e-04[/C][C]1e-04[/C][C]0.0906[/C][C]0.3011[/C][/ROW]
[ROW][C]123[/C][C]0.0244[/C][C]0.0287[/C][C]0.01[/C][C]101.9504[/C][C]34.0439[/C][C]5.8347[/C][/ROW]
[ROW][C]124[/C][C]0.0289[/C][C]0.0369[/C][C]0.0167[/C][C]162.0973[/C][C]66.0573[/C][C]8.1276[/C][/ROW]
[ROW][C]125[/C][C]0.0299[/C][C]0.001[/C][C]0.0136[/C][C]0.1438[/C][C]52.8746[/C][C]7.2715[/C][/ROW]
[ROW][C]126[/C][C]0.0324[/C][C]0.0042[/C][C]0.012[/C][C]2.2381[/C][C]44.4352[/C][C]6.666[/C][/ROW]
[ROW][C]127[/C][C]0.0348[/C][C]0.0125[/C][C]0.0121[/C][C]20.1455[/C][C]40.9652[/C][C]6.4004[/C][/ROW]
[ROW][C]128[/C][C]0.0361[/C][C]-0.0077[/C][C]0.0115[/C][C]7.973[/C][C]36.8412[/C][C]6.0697[/C][/ROW]
[ROW][C]129[/C][C]0.0396[/C][C]0.0259[/C][C]0.0131[/C][C]77.2858[/C][C]41.335[/C][C]6.4292[/C][/ROW]
[ROW][C]130[/C][C]0.041[/C][C]0.0268[/C][C]0.0145[/C][C]87.2672[/C][C]45.9282[/C][C]6.777[/C][/ROW]
[ROW][C]131[/C][C]0.0426[/C][C]0.0533[/C][C]0.018[/C][C]346.833[/C][C]73.2832[/C][C]8.5606[/C][/ROW]
[ROW][C]132[/C][C]0.0411[/C][C]0.0602[/C][C]0.0215[/C][C]594.0805[/C][C]116.683[/C][C]10.802[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=192413&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=192413&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
1210.0212-0.001300.181200
1220.02407e-041e-040.09060.3011
1230.02440.02870.01101.950434.04395.8347
1240.02890.03690.0167162.097366.05738.1276
1250.02990.0010.01360.143852.87467.2715
1260.03240.00420.0122.238144.43526.666
1270.03480.01250.012120.145540.96526.4004
1280.0361-0.00770.01157.97336.84126.0697
1290.03960.02590.013177.285841.3356.4292
1300.0410.02680.014587.267245.92826.777
1310.04260.05330.018346.83373.28328.5606
1320.04110.06020.0215594.0805116.68310.802



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