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, 17 Dec 2009 09:35:15 -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/17/t1261067805q6t28nl7z8p90gy.htm/, Retrieved Tue, 30 Apr 2024 03:15:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=68980, Retrieved Tue, 30 Apr 2024 03:15:57 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact88
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [ARIMA Forecasting] [] [2009-12-08 17:38:30] [78d53abea600e0825abda35dbfc51d4c]
-   PD    [ARIMA Forecasting] [] [2009-12-17 16:35:15] [6e025b5370bdd3143fbe248190b38274] [Current]
Feedback Forum

Post a new message
Dataseries X:
15836.8
17570.4
18252.1
16196.7
16643
17729
16446.1
15993.8
16373.5
17842.2
22321.5
22786.7
18274.1
22392.9
23899.3
21343.5
22952.3
21374.4
21164.1
20906.5
17877.4
20664.3
22160
19813.6
17735.4
19640.2
20844.4
19823.1
18594.6
21350.6
18574.1
18924.2
17343.4
19961.2
19932.1
19464.6
16165.4
17574.9
19795.4
19439.5
17170
21072.4
17751.8
17515.5
18040.3
19090.1
17746.5
19202.1
15141.6
16258.1
18586.5
17209.4
17838.7
19123.5
16583.6
15991.2
16704.4
17420.4
17872
17823.2




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=68980&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=68980&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68980&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[48])
3619464.6-------
3716165.4-------
3817574.9-------
3919795.4-------
4019439.5-------
4117170-------
4221072.4-------
4317751.8-------
4417515.5-------
4518040.3-------
4619090.1-------
4717746.5-------
4819202.1-------
4915141.613962.653711511.340216413.96720.172900.03910
5016258.115598.418312918.148318278.68840.31480.63080.07420.0042
5118586.518729.604515319.673522139.53540.46720.92230.27010.393
5217209.416679.347412186.120521172.57420.40860.20270.11430.1356
5317838.715268.440310409.714320127.16630.14990.21680.22150.0563
5419123.519649.807414018.801125280.81360.42730.73580.31020.5619
5516583.615164.16158859.920321468.40270.32950.10920.21060.1047
5615991.216002.66429300.512122704.81630.49870.43250.32910.1747
5716704.416177.32958819.034123535.62480.44420.51980.30990.2102
5817420.417006.66239169.239524844.08510.45880.53010.30120.2915
591787216548.94048306.155324791.72550.37650.41790.38790.2641
6017823.217569.5968793.124526346.06750.47740.47310.35770.3577

\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[48]) \tabularnewline
36 & 19464.6 & - & - & - & - & - & - & - \tabularnewline
37 & 16165.4 & - & - & - & - & - & - & - \tabularnewline
38 & 17574.9 & - & - & - & - & - & - & - \tabularnewline
39 & 19795.4 & - & - & - & - & - & - & - \tabularnewline
40 & 19439.5 & - & - & - & - & - & - & - \tabularnewline
41 & 17170 & - & - & - & - & - & - & - \tabularnewline
42 & 21072.4 & - & - & - & - & - & - & - \tabularnewline
43 & 17751.8 & - & - & - & - & - & - & - \tabularnewline
44 & 17515.5 & - & - & - & - & - & - & - \tabularnewline
45 & 18040.3 & - & - & - & - & - & - & - \tabularnewline
46 & 19090.1 & - & - & - & - & - & - & - \tabularnewline
47 & 17746.5 & - & - & - & - & - & - & - \tabularnewline
48 & 19202.1 & - & - & - & - & - & - & - \tabularnewline
49 & 15141.6 & 13962.6537 & 11511.3402 & 16413.9672 & 0.1729 & 0 & 0.0391 & 0 \tabularnewline
50 & 16258.1 & 15598.4183 & 12918.1483 & 18278.6884 & 0.3148 & 0.6308 & 0.0742 & 0.0042 \tabularnewline
51 & 18586.5 & 18729.6045 & 15319.6735 & 22139.5354 & 0.4672 & 0.9223 & 0.2701 & 0.393 \tabularnewline
52 & 17209.4 & 16679.3474 & 12186.1205 & 21172.5742 & 0.4086 & 0.2027 & 0.1143 & 0.1356 \tabularnewline
53 & 17838.7 & 15268.4403 & 10409.7143 & 20127.1663 & 0.1499 & 0.2168 & 0.2215 & 0.0563 \tabularnewline
54 & 19123.5 & 19649.8074 & 14018.8011 & 25280.8136 & 0.4273 & 0.7358 & 0.3102 & 0.5619 \tabularnewline
55 & 16583.6 & 15164.1615 & 8859.9203 & 21468.4027 & 0.3295 & 0.1092 & 0.2106 & 0.1047 \tabularnewline
56 & 15991.2 & 16002.6642 & 9300.5121 & 22704.8163 & 0.4987 & 0.4325 & 0.3291 & 0.1747 \tabularnewline
57 & 16704.4 & 16177.3295 & 8819.0341 & 23535.6248 & 0.4442 & 0.5198 & 0.3099 & 0.2102 \tabularnewline
58 & 17420.4 & 17006.6623 & 9169.2395 & 24844.0851 & 0.4588 & 0.5301 & 0.3012 & 0.2915 \tabularnewline
59 & 17872 & 16548.9404 & 8306.1553 & 24791.7255 & 0.3765 & 0.4179 & 0.3879 & 0.2641 \tabularnewline
60 & 17823.2 & 17569.596 & 8793.1245 & 26346.0675 & 0.4774 & 0.4731 & 0.3577 & 0.3577 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68980&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[48])[/C][/ROW]
[ROW][C]36[/C][C]19464.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]16165.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]17574.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]19795.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]19439.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]17170[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]21072.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]17751.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]17515.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]18040.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]19090.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]17746.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]19202.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]15141.6[/C][C]13962.6537[/C][C]11511.3402[/C][C]16413.9672[/C][C]0.1729[/C][C]0[/C][C]0.0391[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]16258.1[/C][C]15598.4183[/C][C]12918.1483[/C][C]18278.6884[/C][C]0.3148[/C][C]0.6308[/C][C]0.0742[/C][C]0.0042[/C][/ROW]
[ROW][C]51[/C][C]18586.5[/C][C]18729.6045[/C][C]15319.6735[/C][C]22139.5354[/C][C]0.4672[/C][C]0.9223[/C][C]0.2701[/C][C]0.393[/C][/ROW]
[ROW][C]52[/C][C]17209.4[/C][C]16679.3474[/C][C]12186.1205[/C][C]21172.5742[/C][C]0.4086[/C][C]0.2027[/C][C]0.1143[/C][C]0.1356[/C][/ROW]
[ROW][C]53[/C][C]17838.7[/C][C]15268.4403[/C][C]10409.7143[/C][C]20127.1663[/C][C]0.1499[/C][C]0.2168[/C][C]0.2215[/C][C]0.0563[/C][/ROW]
[ROW][C]54[/C][C]19123.5[/C][C]19649.8074[/C][C]14018.8011[/C][C]25280.8136[/C][C]0.4273[/C][C]0.7358[/C][C]0.3102[/C][C]0.5619[/C][/ROW]
[ROW][C]55[/C][C]16583.6[/C][C]15164.1615[/C][C]8859.9203[/C][C]21468.4027[/C][C]0.3295[/C][C]0.1092[/C][C]0.2106[/C][C]0.1047[/C][/ROW]
[ROW][C]56[/C][C]15991.2[/C][C]16002.6642[/C][C]9300.5121[/C][C]22704.8163[/C][C]0.4987[/C][C]0.4325[/C][C]0.3291[/C][C]0.1747[/C][/ROW]
[ROW][C]57[/C][C]16704.4[/C][C]16177.3295[/C][C]8819.0341[/C][C]23535.6248[/C][C]0.4442[/C][C]0.5198[/C][C]0.3099[/C][C]0.2102[/C][/ROW]
[ROW][C]58[/C][C]17420.4[/C][C]17006.6623[/C][C]9169.2395[/C][C]24844.0851[/C][C]0.4588[/C][C]0.5301[/C][C]0.3012[/C][C]0.2915[/C][/ROW]
[ROW][C]59[/C][C]17872[/C][C]16548.9404[/C][C]8306.1553[/C][C]24791.7255[/C][C]0.3765[/C][C]0.4179[/C][C]0.3879[/C][C]0.2641[/C][/ROW]
[ROW][C]60[/C][C]17823.2[/C][C]17569.596[/C][C]8793.1245[/C][C]26346.0675[/C][C]0.4774[/C][C]0.4731[/C][C]0.3577[/C][C]0.3577[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68980&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68980&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[48])
3619464.6-------
3716165.4-------
3817574.9-------
3919795.4-------
4019439.5-------
4117170-------
4221072.4-------
4317751.8-------
4417515.5-------
4518040.3-------
4619090.1-------
4717746.5-------
4819202.1-------
4915141.613962.653711511.340216413.96720.172900.03910
5016258.115598.418312918.148318278.68840.31480.63080.07420.0042
5118586.518729.604515319.673522139.53540.46720.92230.27010.393
5217209.416679.347412186.120521172.57420.40860.20270.11430.1356
5317838.715268.440310409.714320127.16630.14990.21680.22150.0563
5419123.519649.807414018.801125280.81360.42730.73580.31020.5619
5516583.615164.16158859.920321468.40270.32950.10920.21060.1047
5615991.216002.66429300.512122704.81630.49870.43250.32910.1747
5716704.416177.32958819.034123535.62480.44420.51980.30990.2102
5817420.417006.66239169.239524844.08510.45880.53010.30120.2915
591787216548.94048306.155324791.72550.37650.41790.38790.2641
6017823.217569.5968793.124526346.06750.47740.47310.35770.3577







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
490.08960.084401389914.292200
500.08770.04230.0634435179.8885912547.0904955.2733
510.0929-0.00760.044820478.893615191.0246784.3411
520.13740.03180.0415280955.8055531632.2198729.1311
530.16240.16830.06696606234.73021746552.72191321.5721
540.1462-0.02680.0602276999.46241501627.17861225.409
550.21210.09360.0652014805.63921574938.38731254.9655
560.2137-7e-040.0569131.42851378087.51741173.9197
570.23210.03260.0542277803.35171255833.72121120.6399
580.23510.02430.0512171178.87431147368.23651071.1528
590.25410.07990.05391750486.72681202197.19021096.4475
600.25490.01440.050664314.99331107373.67381052.3182

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
49 & 0.0896 & 0.0844 & 0 & 1389914.2922 & 0 & 0 \tabularnewline
50 & 0.0877 & 0.0423 & 0.0634 & 435179.8885 & 912547.0904 & 955.2733 \tabularnewline
51 & 0.0929 & -0.0076 & 0.0448 & 20478.893 & 615191.0246 & 784.3411 \tabularnewline
52 & 0.1374 & 0.0318 & 0.0415 & 280955.8055 & 531632.2198 & 729.1311 \tabularnewline
53 & 0.1624 & 0.1683 & 0.0669 & 6606234.7302 & 1746552.7219 & 1321.5721 \tabularnewline
54 & 0.1462 & -0.0268 & 0.0602 & 276999.4624 & 1501627.1786 & 1225.409 \tabularnewline
55 & 0.2121 & 0.0936 & 0.065 & 2014805.6392 & 1574938.3873 & 1254.9655 \tabularnewline
56 & 0.2137 & -7e-04 & 0.0569 & 131.4285 & 1378087.5174 & 1173.9197 \tabularnewline
57 & 0.2321 & 0.0326 & 0.0542 & 277803.3517 & 1255833.7212 & 1120.6399 \tabularnewline
58 & 0.2351 & 0.0243 & 0.0512 & 171178.8743 & 1147368.2365 & 1071.1528 \tabularnewline
59 & 0.2541 & 0.0799 & 0.0539 & 1750486.7268 & 1202197.1902 & 1096.4475 \tabularnewline
60 & 0.2549 & 0.0144 & 0.0506 & 64314.9933 & 1107373.6738 & 1052.3182 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=68980&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]49[/C][C]0.0896[/C][C]0.0844[/C][C]0[/C][C]1389914.2922[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]50[/C][C]0.0877[/C][C]0.0423[/C][C]0.0634[/C][C]435179.8885[/C][C]912547.0904[/C][C]955.2733[/C][/ROW]
[ROW][C]51[/C][C]0.0929[/C][C]-0.0076[/C][C]0.0448[/C][C]20478.893[/C][C]615191.0246[/C][C]784.3411[/C][/ROW]
[ROW][C]52[/C][C]0.1374[/C][C]0.0318[/C][C]0.0415[/C][C]280955.8055[/C][C]531632.2198[/C][C]729.1311[/C][/ROW]
[ROW][C]53[/C][C]0.1624[/C][C]0.1683[/C][C]0.0669[/C][C]6606234.7302[/C][C]1746552.7219[/C][C]1321.5721[/C][/ROW]
[ROW][C]54[/C][C]0.1462[/C][C]-0.0268[/C][C]0.0602[/C][C]276999.4624[/C][C]1501627.1786[/C][C]1225.409[/C][/ROW]
[ROW][C]55[/C][C]0.2121[/C][C]0.0936[/C][C]0.065[/C][C]2014805.6392[/C][C]1574938.3873[/C][C]1254.9655[/C][/ROW]
[ROW][C]56[/C][C]0.2137[/C][C]-7e-04[/C][C]0.0569[/C][C]131.4285[/C][C]1378087.5174[/C][C]1173.9197[/C][/ROW]
[ROW][C]57[/C][C]0.2321[/C][C]0.0326[/C][C]0.0542[/C][C]277803.3517[/C][C]1255833.7212[/C][C]1120.6399[/C][/ROW]
[ROW][C]58[/C][C]0.2351[/C][C]0.0243[/C][C]0.0512[/C][C]171178.8743[/C][C]1147368.2365[/C][C]1071.1528[/C][/ROW]
[ROW][C]59[/C][C]0.2541[/C][C]0.0799[/C][C]0.0539[/C][C]1750486.7268[/C][C]1202197.1902[/C][C]1096.4475[/C][/ROW]
[ROW][C]60[/C][C]0.2549[/C][C]0.0144[/C][C]0.0506[/C][C]64314.9933[/C][C]1107373.6738[/C][C]1052.3182[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=68980&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=68980&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
490.08960.084401389914.292200
500.08770.04230.0634435179.8885912547.0904955.2733
510.0929-0.00760.044820478.893615191.0246784.3411
520.13740.03180.0415280955.8055531632.2198729.1311
530.16240.16830.06696606234.73021746552.72191321.5721
540.1462-0.02680.0602276999.46241501627.17861225.409
550.21210.09360.0652014805.63921574938.38731254.9655
560.2137-7e-040.0569131.42851378087.51741173.9197
570.23210.03260.0542277803.35171255833.72121120.6399
580.23510.02430.0512171178.87431147368.23651071.1528
590.25410.07990.05391750486.72681202197.19021096.4475
600.25490.01440.050664314.99331107373.67381052.3182



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