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 computationWed, 17 Dec 2008 16:24:49 -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/2008/Dec/18/t1229556340xrko5g8669u0tze.htm/, Retrieved Sat, 11 May 2024 17:53:42 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=34603, Retrieved Sat, 11 May 2024 17:53:42 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact212
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [(Partial) Autocorrelation Function] [] [2008-12-17 12:54:04] [ca30429b07824e7c5d48293114d35d71]
- RMP   [ARIMA Backward Selection] [] [2008-12-17 13:46:44] [ca30429b07824e7c5d48293114d35d71]
- RMP       [ARIMA Forecasting] [] [2008-12-17 23:24:49] [c66d07e79164cd7acb2569833ec5bcd8] [Current]
Feedback Forum

Post a new message
Dataseries X:
15023.6
12083
15761.3
16943
15070.3
13659.6
14768.9
14725.1
15998.1
15370.6
14956.9
15469.7
15101.8
11703.7
16283.6
16726.5
14968.9
14861
14583.3
15305.8
17903.9
16379.4
15420.3
17870.5
15912.8
13866.5
17823.2
17872
17420.4
16704.4
15991.2
16583.6
19123.5
17838.7
17209.4
18586.5
16258.1
15141.6
19202.1
17746.5
19090.1
18040.3
17515.5
17751.8
21072.4
17170
19439.5
19795.4
17574.9
16165.4
19464.6
19932.1
19961.2
17343.4
18924.2
18574.1
21350.6
18840.1
20304.8
21132.4
19753.9




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34603&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' @ 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[49])
3716258.1-------
3815141.6-------
3919202.1-------
4017746.5-------
4119090.1-------
4218040.3-------
4317515.5-------
4417751.8-------
4521072.4-------
4617170-------
4719439.5-------
4819795.4-------
4917574.9-------
5016165.416790.586715441.206918139.96660.18190.12730.99170.1273
5119464.620220.434618871.9821568.88920.13610.93060.9999
5219932.119328.092817889.852420766.33320.20520.42620.98440.9916
5319961.220277.4618632.039521922.88050.35320.65960.92140.9994
5417343.418919.827317263.681420575.97330.0310.10890.8510.9443
5518924.218724.038716962.786120485.29130.41190.93780.91070.8995
5618574.118955.073717111.341720798.80560.34270.51310.89960.9288
5721350.621824.860419950.691823699.0290.310.99970.78431
5818840.118580.682916624.45920536.90680.39750.00280.92120.8432
5920304.820256.763718250.114122263.41330.48130.91680.78760.9956
6021132.420655.439818607.856822703.02290.3240.63140.79480.9984
6119753.918719.441116613.251520825.63080.16790.01240.85660.8566

\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[49]) \tabularnewline
37 & 16258.1 & - & - & - & - & - & - & - \tabularnewline
38 & 15141.6 & - & - & - & - & - & - & - \tabularnewline
39 & 19202.1 & - & - & - & - & - & - & - \tabularnewline
40 & 17746.5 & - & - & - & - & - & - & - \tabularnewline
41 & 19090.1 & - & - & - & - & - & - & - \tabularnewline
42 & 18040.3 & - & - & - & - & - & - & - \tabularnewline
43 & 17515.5 & - & - & - & - & - & - & - \tabularnewline
44 & 17751.8 & - & - & - & - & - & - & - \tabularnewline
45 & 21072.4 & - & - & - & - & - & - & - \tabularnewline
46 & 17170 & - & - & - & - & - & - & - \tabularnewline
47 & 19439.5 & - & - & - & - & - & - & - \tabularnewline
48 & 19795.4 & - & - & - & - & - & - & - \tabularnewline
49 & 17574.9 & - & - & - & - & - & - & - \tabularnewline
50 & 16165.4 & 16790.5867 & 15441.2069 & 18139.9666 & 0.1819 & 0.1273 & 0.9917 & 0.1273 \tabularnewline
51 & 19464.6 & 20220.4346 & 18871.98 & 21568.8892 & 0.136 & 1 & 0.9306 & 0.9999 \tabularnewline
52 & 19932.1 & 19328.0928 & 17889.8524 & 20766.3332 & 0.2052 & 0.4262 & 0.9844 & 0.9916 \tabularnewline
53 & 19961.2 & 20277.46 & 18632.0395 & 21922.8805 & 0.3532 & 0.6596 & 0.9214 & 0.9994 \tabularnewline
54 & 17343.4 & 18919.8273 & 17263.6814 & 20575.9733 & 0.031 & 0.1089 & 0.851 & 0.9443 \tabularnewline
55 & 18924.2 & 18724.0387 & 16962.7861 & 20485.2913 & 0.4119 & 0.9378 & 0.9107 & 0.8995 \tabularnewline
56 & 18574.1 & 18955.0737 & 17111.3417 & 20798.8056 & 0.3427 & 0.5131 & 0.8996 & 0.9288 \tabularnewline
57 & 21350.6 & 21824.8604 & 19950.6918 & 23699.029 & 0.31 & 0.9997 & 0.7843 & 1 \tabularnewline
58 & 18840.1 & 18580.6829 & 16624.459 & 20536.9068 & 0.3975 & 0.0028 & 0.9212 & 0.8432 \tabularnewline
59 & 20304.8 & 20256.7637 & 18250.1141 & 22263.4133 & 0.4813 & 0.9168 & 0.7876 & 0.9956 \tabularnewline
60 & 21132.4 & 20655.4398 & 18607.8568 & 22703.0229 & 0.324 & 0.6314 & 0.7948 & 0.9984 \tabularnewline
61 & 19753.9 & 18719.4411 & 16613.2515 & 20825.6308 & 0.1679 & 0.0124 & 0.8566 & 0.8566 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34603&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[49])[/C][/ROW]
[ROW][C]37[/C][C]16258.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]15141.6[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]19202.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]17746.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]19090.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]18040.3[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]17515.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]17751.8[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]21072.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]46[/C][C]17170[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]47[/C][C]19439.5[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]48[/C][C]19795.4[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]49[/C][C]17574.9[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]50[/C][C]16165.4[/C][C]16790.5867[/C][C]15441.2069[/C][C]18139.9666[/C][C]0.1819[/C][C]0.1273[/C][C]0.9917[/C][C]0.1273[/C][/ROW]
[ROW][C]51[/C][C]19464.6[/C][C]20220.4346[/C][C]18871.98[/C][C]21568.8892[/C][C]0.136[/C][C]1[/C][C]0.9306[/C][C]0.9999[/C][/ROW]
[ROW][C]52[/C][C]19932.1[/C][C]19328.0928[/C][C]17889.8524[/C][C]20766.3332[/C][C]0.2052[/C][C]0.4262[/C][C]0.9844[/C][C]0.9916[/C][/ROW]
[ROW][C]53[/C][C]19961.2[/C][C]20277.46[/C][C]18632.0395[/C][C]21922.8805[/C][C]0.3532[/C][C]0.6596[/C][C]0.9214[/C][C]0.9994[/C][/ROW]
[ROW][C]54[/C][C]17343.4[/C][C]18919.8273[/C][C]17263.6814[/C][C]20575.9733[/C][C]0.031[/C][C]0.1089[/C][C]0.851[/C][C]0.9443[/C][/ROW]
[ROW][C]55[/C][C]18924.2[/C][C]18724.0387[/C][C]16962.7861[/C][C]20485.2913[/C][C]0.4119[/C][C]0.9378[/C][C]0.9107[/C][C]0.8995[/C][/ROW]
[ROW][C]56[/C][C]18574.1[/C][C]18955.0737[/C][C]17111.3417[/C][C]20798.8056[/C][C]0.3427[/C][C]0.5131[/C][C]0.8996[/C][C]0.9288[/C][/ROW]
[ROW][C]57[/C][C]21350.6[/C][C]21824.8604[/C][C]19950.6918[/C][C]23699.029[/C][C]0.31[/C][C]0.9997[/C][C]0.7843[/C][C]1[/C][/ROW]
[ROW][C]58[/C][C]18840.1[/C][C]18580.6829[/C][C]16624.459[/C][C]20536.9068[/C][C]0.3975[/C][C]0.0028[/C][C]0.9212[/C][C]0.8432[/C][/ROW]
[ROW][C]59[/C][C]20304.8[/C][C]20256.7637[/C][C]18250.1141[/C][C]22263.4133[/C][C]0.4813[/C][C]0.9168[/C][C]0.7876[/C][C]0.9956[/C][/ROW]
[ROW][C]60[/C][C]21132.4[/C][C]20655.4398[/C][C]18607.8568[/C][C]22703.0229[/C][C]0.324[/C][C]0.6314[/C][C]0.7948[/C][C]0.9984[/C][/ROW]
[ROW][C]61[/C][C]19753.9[/C][C]18719.4411[/C][C]16613.2515[/C][C]20825.6308[/C][C]0.1679[/C][C]0.0124[/C][C]0.8566[/C][C]0.8566[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34603&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34603&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[49])
3716258.1-------
3815141.6-------
3919202.1-------
4017746.5-------
4119090.1-------
4218040.3-------
4317515.5-------
4417751.8-------
4521072.4-------
4617170-------
4719439.5-------
4819795.4-------
4917574.9-------
5016165.416790.586715441.206918139.96660.18190.12730.99170.1273
5119464.620220.434618871.9821568.88920.13610.93060.9999
5219932.119328.092817889.852420766.33320.20520.42620.98440.9916
5319961.220277.4618632.039521922.88050.35320.65960.92140.9994
5417343.418919.827317263.681420575.97330.0310.10890.8510.9443
5518924.218724.038716962.786120485.29130.41190.93780.91070.8995
5618574.118955.073717111.341720798.80560.34270.51310.89960.9288
5721350.621824.860419950.691823699.0290.310.99970.78431
5818840.118580.682916624.45920536.90680.39750.00280.92120.8432
5920304.820256.763718250.114122263.41330.48130.91680.78760.9956
6021132.420655.439818607.856822703.02290.3240.63140.79480.9984
6119753.918719.441116613.251520825.63080.16790.01240.85660.8566







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
500.041-0.03720.0031390858.459132571.5383180.4759
510.034-0.03740.0031571285.945947607.1622218.1907
520.0380.03130.0026364824.722630402.0602174.3619
530.0414-0.01560.0013100020.39438335.032991.2964
540.0447-0.08330.00692485123.0832207093.5903455.0754
550.0480.01079e-0440064.54593338.712257.7816
560.0496-0.02010.0017145140.942412095.0785109.9776
570.0438-0.02170.0018224922.897218743.5748136.9072
580.05370.0140.001267297.23265608.102774.8873
590.05050.00242e-042307.4844192.290413.8669
600.05060.02310.0019227490.988118957.5823137.6865
610.05740.05530.00461070105.117389175.4264298.6225

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
50 & 0.041 & -0.0372 & 0.0031 & 390858.4591 & 32571.5383 & 180.4759 \tabularnewline
51 & 0.034 & -0.0374 & 0.0031 & 571285.9459 & 47607.1622 & 218.1907 \tabularnewline
52 & 0.038 & 0.0313 & 0.0026 & 364824.7226 & 30402.0602 & 174.3619 \tabularnewline
53 & 0.0414 & -0.0156 & 0.0013 & 100020.3943 & 8335.0329 & 91.2964 \tabularnewline
54 & 0.0447 & -0.0833 & 0.0069 & 2485123.0832 & 207093.5903 & 455.0754 \tabularnewline
55 & 0.048 & 0.0107 & 9e-04 & 40064.5459 & 3338.7122 & 57.7816 \tabularnewline
56 & 0.0496 & -0.0201 & 0.0017 & 145140.9424 & 12095.0785 & 109.9776 \tabularnewline
57 & 0.0438 & -0.0217 & 0.0018 & 224922.8972 & 18743.5748 & 136.9072 \tabularnewline
58 & 0.0537 & 0.014 & 0.0012 & 67297.2326 & 5608.1027 & 74.8873 \tabularnewline
59 & 0.0505 & 0.0024 & 2e-04 & 2307.4844 & 192.2904 & 13.8669 \tabularnewline
60 & 0.0506 & 0.0231 & 0.0019 & 227490.9881 & 18957.5823 & 137.6865 \tabularnewline
61 & 0.0574 & 0.0553 & 0.0046 & 1070105.1173 & 89175.4264 & 298.6225 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=34603&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]50[/C][C]0.041[/C][C]-0.0372[/C][C]0.0031[/C][C]390858.4591[/C][C]32571.5383[/C][C]180.4759[/C][/ROW]
[ROW][C]51[/C][C]0.034[/C][C]-0.0374[/C][C]0.0031[/C][C]571285.9459[/C][C]47607.1622[/C][C]218.1907[/C][/ROW]
[ROW][C]52[/C][C]0.038[/C][C]0.0313[/C][C]0.0026[/C][C]364824.7226[/C][C]30402.0602[/C][C]174.3619[/C][/ROW]
[ROW][C]53[/C][C]0.0414[/C][C]-0.0156[/C][C]0.0013[/C][C]100020.3943[/C][C]8335.0329[/C][C]91.2964[/C][/ROW]
[ROW][C]54[/C][C]0.0447[/C][C]-0.0833[/C][C]0.0069[/C][C]2485123.0832[/C][C]207093.5903[/C][C]455.0754[/C][/ROW]
[ROW][C]55[/C][C]0.048[/C][C]0.0107[/C][C]9e-04[/C][C]40064.5459[/C][C]3338.7122[/C][C]57.7816[/C][/ROW]
[ROW][C]56[/C][C]0.0496[/C][C]-0.0201[/C][C]0.0017[/C][C]145140.9424[/C][C]12095.0785[/C][C]109.9776[/C][/ROW]
[ROW][C]57[/C][C]0.0438[/C][C]-0.0217[/C][C]0.0018[/C][C]224922.8972[/C][C]18743.5748[/C][C]136.9072[/C][/ROW]
[ROW][C]58[/C][C]0.0537[/C][C]0.014[/C][C]0.0012[/C][C]67297.2326[/C][C]5608.1027[/C][C]74.8873[/C][/ROW]
[ROW][C]59[/C][C]0.0505[/C][C]0.0024[/C][C]2e-04[/C][C]2307.4844[/C][C]192.2904[/C][C]13.8669[/C][/ROW]
[ROW][C]60[/C][C]0.0506[/C][C]0.0231[/C][C]0.0019[/C][C]227490.9881[/C][C]18957.5823[/C][C]137.6865[/C][/ROW]
[ROW][C]61[/C][C]0.0574[/C][C]0.0553[/C][C]0.0046[/C][C]1070105.1173[/C][C]89175.4264[/C][C]298.6225[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=34603&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=34603&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
500.041-0.03720.0031390858.459132571.5383180.4759
510.034-0.03740.0031571285.945947607.1622218.1907
520.0380.03130.0026364824.722630402.0602174.3619
530.0414-0.01560.0013100020.39438335.032991.2964
540.0447-0.08330.00692485123.0832207093.5903455.0754
550.0480.01079e-0440064.54593338.712257.7816
560.0496-0.02010.0017145140.942412095.0785109.9776
570.0438-0.02170.0018224922.897218743.5748136.9072
580.05370.0140.001267297.23265608.102774.8873
590.05050.00242e-042307.4844192.290413.8669
600.05060.02310.0019227490.988118957.5823137.6865
610.05740.05530.00461070105.117389175.4264298.6225



Parameters (Session):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; par8 = 1 ; par9 = 1 ; par10 = FALSE ;
Parameters (R input):
par1 = 12 ; par2 = 1 ; par3 = 0 ; par4 = 1 ; par5 = 12 ; par6 = 3 ; par7 = 0 ; 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,fx))
(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.se <- array(0, dim=fx)
perf.mse <- 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.mape[i] = perf.mape[i] + abs(perf.pe[i])
perf.se[i] = (x[nx+i] - forecast$pred[i])^2
perf.mse[i] = perf.mse[i] + perf.se[i]
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 = perf.mape / fx
perf.mse = perf.mse / fx
perf.rmse = sqrt(perf.mse)
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:12] <- 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.mape[i],4))
a<-table.element(a,round(perf.se[i],4))
a<-table.element(a,round(perf.mse[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')