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 Dec 2009 04:21:10 -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/2009/Dec/10/t12604441377an7wqzmrcf3e2z.htm/, Retrieved Thu, 28 Mar 2024 20:25:47 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=65284, Retrieved Thu, 28 Mar 2024 20:25:47 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywordsWS10, forecast
Estimated Impact140
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
F     [(Partial) Autocorrelation Function] [] [2009-11-26 15:10:30] [0750c128064677e728c9436fc3f45ae7]
-   P   [(Partial) Autocorrelation Function] [] [2009-12-04 13:46:52] [0750c128064677e728c9436fc3f45ae7]
- RM      [ARIMA Backward Selection] [] [2009-12-04 14:20:19] [0750c128064677e728c9436fc3f45ae7]
- RMP         [ARIMA Forecasting] [] [2009-12-10 11:21:10] [30f5b608e5a1bbbae86b1702c0071566] [Current]
Feedback Forum

Post a new message
Dataseries X:
1.3
1.2
1.1
1.4
1.2
1.5
1.1
1.3
1.5
1.1
1.4
1.3
1.5
1.6
1.7
1.1
1.6
1.3
1.7
1.6
1.7
1.9
1.8
1.9
1.6
1.5
1.6
1.6
1.7
2
2
1.9
1.7
1.8
1.9
1.7
2
2.1
2.4
2.5
2.5
2.6
2.2
2.5
2.8
2.8
2.9
3
3.1
2.9
2.7
2.2
2.5
2.3
2.6
2.3
2.2
1.8
1.8




Summary of computational 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 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' @ 72.249.127.135 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65284&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' @ 72.249.127.135[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65284&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65284&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' @ 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[47])
351.9-------
361.7-------
372-------
382.1-------
392.4-------
402.5-------
412.5-------
422.6-------
432.2-------
442.5-------
452.8-------
462.8-------
472.9-------
4832.92772.32983.6790.42520.52880.99930.5288
493.12.83682.20453.65040.2630.34710.97810.4395
502.92.77532.04593.76480.40250.26010.90950.4025
512.72.58991.85393.61810.41690.27720.64130.2772
522.22.61161.80633.77580.24420.44080.57450.3136
532.52.51591.69263.73970.48980.69360.51020.2692
542.32.41821.58243.69550.4280.45010.39020.2299
552.62.57211.64144.03060.48510.64270.69150.3298
562.32.45391.52853.93960.41960.42360.47570.2781
572.22.36221.43823.880.4170.5320.28590.2437
581.82.33661.39183.9230.25370.5670.28350.2432
591.82.26911.32353.89040.28530.71470.22280.2228

\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[47]) \tabularnewline
35 & 1.9 & - & - & - & - & - & - & - \tabularnewline
36 & 1.7 & - & - & - & - & - & - & - \tabularnewline
37 & 2 & - & - & - & - & - & - & - \tabularnewline
38 & 2.1 & - & - & - & - & - & - & - \tabularnewline
39 & 2.4 & - & - & - & - & - & - & - \tabularnewline
40 & 2.5 & - & - & - & - & - & - & - \tabularnewline
41 & 2.5 & - & - & - & - & - & - & - \tabularnewline
42 & 2.6 & - & - & - & - & - & - & - \tabularnewline
43 & 2.2 & - & - & - & - & - & - & - \tabularnewline
44 & 2.5 & - & - & - & - & - & - & - \tabularnewline
45 & 2.8 & - & - & - & - & - & - & - \tabularnewline
46 & 2.8 & - & - & - & - & - & - & - \tabularnewline
47 & 2.9 & - & - & - & - & - & - & - \tabularnewline
48 & 3 & 2.9277 & 2.3298 & 3.679 & 0.4252 & 0.5288 & 0.9993 & 0.5288 \tabularnewline
49 & 3.1 & 2.8368 & 2.2045 & 3.6504 & 0.263 & 0.3471 & 0.9781 & 0.4395 \tabularnewline
50 & 2.9 & 2.7753 & 2.0459 & 3.7648 & 0.4025 & 0.2601 & 0.9095 & 0.4025 \tabularnewline
51 & 2.7 & 2.5899 & 1.8539 & 3.6181 & 0.4169 & 0.2772 & 0.6413 & 0.2772 \tabularnewline
52 & 2.2 & 2.6116 & 1.8063 & 3.7758 & 0.2442 & 0.4408 & 0.5745 & 0.3136 \tabularnewline
53 & 2.5 & 2.5159 & 1.6926 & 3.7397 & 0.4898 & 0.6936 & 0.5102 & 0.2692 \tabularnewline
54 & 2.3 & 2.4182 & 1.5824 & 3.6955 & 0.428 & 0.4501 & 0.3902 & 0.2299 \tabularnewline
55 & 2.6 & 2.5721 & 1.6414 & 4.0306 & 0.4851 & 0.6427 & 0.6915 & 0.3298 \tabularnewline
56 & 2.3 & 2.4539 & 1.5285 & 3.9396 & 0.4196 & 0.4236 & 0.4757 & 0.2781 \tabularnewline
57 & 2.2 & 2.3622 & 1.4382 & 3.88 & 0.417 & 0.532 & 0.2859 & 0.2437 \tabularnewline
58 & 1.8 & 2.3366 & 1.3918 & 3.923 & 0.2537 & 0.567 & 0.2835 & 0.2432 \tabularnewline
59 & 1.8 & 2.2691 & 1.3235 & 3.8904 & 0.2853 & 0.7147 & 0.2228 & 0.2228 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65284&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[47])[/C][/ROW]
[ROW][C]35[/C][C]1.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]1.7[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]2.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]2.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]2.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]2.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]2.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]2.2[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]2.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]2.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]2.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]2.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]3[/C][C]2.9277[/C][C]2.3298[/C][C]3.679[/C][C]0.4252[/C][C]0.5288[/C][C]0.9993[/C][C]0.5288[/C][/ROW]
[ROW][C]49[/C][C]3.1[/C][C]2.8368[/C][C]2.2045[/C][C]3.6504[/C][C]0.263[/C][C]0.3471[/C][C]0.9781[/C][C]0.4395[/C][/ROW]
[ROW][C]50[/C][C]2.9[/C][C]2.7753[/C][C]2.0459[/C][C]3.7648[/C][C]0.4025[/C][C]0.2601[/C][C]0.9095[/C][C]0.4025[/C][/ROW]
[ROW][C]51[/C][C]2.7[/C][C]2.5899[/C][C]1.8539[/C][C]3.6181[/C][C]0.4169[/C][C]0.2772[/C][C]0.6413[/C][C]0.2772[/C][/ROW]
[ROW][C]52[/C][C]2.2[/C][C]2.6116[/C][C]1.8063[/C][C]3.7758[/C][C]0.2442[/C][C]0.4408[/C][C]0.5745[/C][C]0.3136[/C][/ROW]
[ROW][C]53[/C][C]2.5[/C][C]2.5159[/C][C]1.6926[/C][C]3.7397[/C][C]0.4898[/C][C]0.6936[/C][C]0.5102[/C][C]0.2692[/C][/ROW]
[ROW][C]54[/C][C]2.3[/C][C]2.4182[/C][C]1.5824[/C][C]3.6955[/C][C]0.428[/C][C]0.4501[/C][C]0.3902[/C][C]0.2299[/C][/ROW]
[ROW][C]55[/C][C]2.6[/C][C]2.5721[/C][C]1.6414[/C][C]4.0306[/C][C]0.4851[/C][C]0.6427[/C][C]0.6915[/C][C]0.3298[/C][/ROW]
[ROW][C]56[/C][C]2.3[/C][C]2.4539[/C][C]1.5285[/C][C]3.9396[/C][C]0.4196[/C][C]0.4236[/C][C]0.4757[/C][C]0.2781[/C][/ROW]
[ROW][C]57[/C][C]2.2[/C][C]2.3622[/C][C]1.4382[/C][C]3.88[/C][C]0.417[/C][C]0.532[/C][C]0.2859[/C][C]0.2437[/C][/ROW]
[ROW][C]58[/C][C]1.8[/C][C]2.3366[/C][C]1.3918[/C][C]3.923[/C][C]0.2537[/C][C]0.567[/C][C]0.2835[/C][C]0.2432[/C][/ROW]
[ROW][C]59[/C][C]1.8[/C][C]2.2691[/C][C]1.3235[/C][C]3.8904[/C][C]0.2853[/C][C]0.7147[/C][C]0.2228[/C][C]0.2228[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65284&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65284&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[47])
351.9-------
361.7-------
372-------
382.1-------
392.4-------
402.5-------
412.5-------
422.6-------
432.2-------
442.5-------
452.8-------
462.8-------
472.9-------
4832.92772.32983.6790.42520.52880.99930.5288
493.12.83682.20453.65040.2630.34710.97810.4395
502.92.77532.04593.76480.40250.26010.90950.4025
512.72.58991.85393.61810.41690.27720.64130.2772
522.22.61161.80633.77580.24420.44080.57450.3136
532.52.51591.69263.73970.48980.69360.51020.2692
542.32.41821.58243.69550.4280.45010.39020.2299
552.62.57211.64144.03060.48510.64270.69150.3298
562.32.45391.52853.93960.41960.42360.47570.2781
572.22.36221.43823.880.4170.5320.28590.2437
581.82.33661.39183.9230.25370.5670.28350.2432
591.82.26911.32353.89040.28530.71470.22280.2228







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
480.13090.024700.005200
490.14630.09280.05870.06930.03730.193
500.18190.04490.05410.01550.030.1733
510.20250.04250.05120.01210.02550.1598
520.2274-0.15760.07250.16940.05430.2331
530.2482-0.00630.06153e-040.04530.2128
540.2695-0.04890.05970.0140.04080.2021
550.28930.01080.05368e-040.03580.1893
560.3089-0.06270.05460.02370.03450.1857
570.3278-0.06870.0560.02630.03370.1835
580.3464-0.22970.07180.2880.05680.2383
590.3645-0.20670.0830.22010.07040.2653

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
48 & 0.1309 & 0.0247 & 0 & 0.0052 & 0 & 0 \tabularnewline
49 & 0.1463 & 0.0928 & 0.0587 & 0.0693 & 0.0373 & 0.193 \tabularnewline
50 & 0.1819 & 0.0449 & 0.0541 & 0.0155 & 0.03 & 0.1733 \tabularnewline
51 & 0.2025 & 0.0425 & 0.0512 & 0.0121 & 0.0255 & 0.1598 \tabularnewline
52 & 0.2274 & -0.1576 & 0.0725 & 0.1694 & 0.0543 & 0.2331 \tabularnewline
53 & 0.2482 & -0.0063 & 0.0615 & 3e-04 & 0.0453 & 0.2128 \tabularnewline
54 & 0.2695 & -0.0489 & 0.0597 & 0.014 & 0.0408 & 0.2021 \tabularnewline
55 & 0.2893 & 0.0108 & 0.0536 & 8e-04 & 0.0358 & 0.1893 \tabularnewline
56 & 0.3089 & -0.0627 & 0.0546 & 0.0237 & 0.0345 & 0.1857 \tabularnewline
57 & 0.3278 & -0.0687 & 0.056 & 0.0263 & 0.0337 & 0.1835 \tabularnewline
58 & 0.3464 & -0.2297 & 0.0718 & 0.288 & 0.0568 & 0.2383 \tabularnewline
59 & 0.3645 & -0.2067 & 0.083 & 0.2201 & 0.0704 & 0.2653 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=65284&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]48[/C][C]0.1309[/C][C]0.0247[/C][C]0[/C][C]0.0052[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]49[/C][C]0.1463[/C][C]0.0928[/C][C]0.0587[/C][C]0.0693[/C][C]0.0373[/C][C]0.193[/C][/ROW]
[ROW][C]50[/C][C]0.1819[/C][C]0.0449[/C][C]0.0541[/C][C]0.0155[/C][C]0.03[/C][C]0.1733[/C][/ROW]
[ROW][C]51[/C][C]0.2025[/C][C]0.0425[/C][C]0.0512[/C][C]0.0121[/C][C]0.0255[/C][C]0.1598[/C][/ROW]
[ROW][C]52[/C][C]0.2274[/C][C]-0.1576[/C][C]0.0725[/C][C]0.1694[/C][C]0.0543[/C][C]0.2331[/C][/ROW]
[ROW][C]53[/C][C]0.2482[/C][C]-0.0063[/C][C]0.0615[/C][C]3e-04[/C][C]0.0453[/C][C]0.2128[/C][/ROW]
[ROW][C]54[/C][C]0.2695[/C][C]-0.0489[/C][C]0.0597[/C][C]0.014[/C][C]0.0408[/C][C]0.2021[/C][/ROW]
[ROW][C]55[/C][C]0.2893[/C][C]0.0108[/C][C]0.0536[/C][C]8e-04[/C][C]0.0358[/C][C]0.1893[/C][/ROW]
[ROW][C]56[/C][C]0.3089[/C][C]-0.0627[/C][C]0.0546[/C][C]0.0237[/C][C]0.0345[/C][C]0.1857[/C][/ROW]
[ROW][C]57[/C][C]0.3278[/C][C]-0.0687[/C][C]0.056[/C][C]0.0263[/C][C]0.0337[/C][C]0.1835[/C][/ROW]
[ROW][C]58[/C][C]0.3464[/C][C]-0.2297[/C][C]0.0718[/C][C]0.288[/C][C]0.0568[/C][C]0.2383[/C][/ROW]
[ROW][C]59[/C][C]0.3645[/C][C]-0.2067[/C][C]0.083[/C][C]0.2201[/C][C]0.0704[/C][C]0.2653[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=65284&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=65284&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
480.13090.024700.005200
490.14630.09280.05870.06930.03730.193
500.18190.04490.05410.01550.030.1733
510.20250.04250.05120.01210.02550.1598
520.2274-0.15760.07250.16940.05430.2331
530.2482-0.00630.06153e-040.04530.2128
540.2695-0.04890.05970.0140.04080.2021
550.28930.01080.05368e-040.03580.1893
560.3089-0.06270.05460.02370.03450.1857
570.3278-0.06870.0560.02630.03370.1835
580.3464-0.22970.07180.2880.05680.2383
590.3645-0.20670.0830.22010.07040.2653



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