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, 19 Dec 2012 09:13:54 -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/Dec/19/t1355926458wi8x37z5xclipvf.htm/, Retrieved Mon, 29 Apr 2024 12:15:03 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=201976, Retrieved Mon, 29 Apr 2024 12:15:03 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact118
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-12 13:32:37] [76963dc1903f0f612b6153510a3818cf]
- R  D  [Univariate Explorative Data Analysis] [Run Sequence gebo...] [2008-12-17 12:14:40] [76963dc1903f0f612b6153510a3818cf]
-         [Univariate Explorative Data Analysis] [Run Sequence Plot...] [2008-12-22 18:19:51] [1ce0d16c8f4225c977b42c8fa93bc163]
- RMP       [Univariate Data Series] [Identifying Integ...] [2009-11-22 12:08:06] [b98453cac15ba1066b407e146608df68]
- RMP         [Standard Deviation-Mean Plot] [Births] [2010-11-29 10:52:49] [b98453cac15ba1066b407e146608df68]
- RMP           [ARIMA Backward Selection] [Births] [2010-11-29 17:47:06] [b98453cac15ba1066b407e146608df68]
-   P             [ARIMA Backward Selection] [ARIMA model d=1,D...] [2012-11-22 09:43:52] [0dc867bfbaab36a894719867823e3cb9]
- R P               [ARIMA Backward Selection] [ARIMA lambda = 0...] [2012-12-16 21:07:32] [0dc867bfbaab36a894719867823e3cb9]
- RMP                   [ARIMA Forecasting] [ARIMA Model Fore...] [2012-12-19 14:13:54] [b7b610b08ce09537f4b16b68ce5f31b7] [Current]
Feedback Forum

Post a new message
Dataseries X:
9700
9081
9084
9743
8587
9731
9563
9998
9437
10038
9918
9252
9737
9035
9133
9487
8700
9627
8947
9283
8829
9947
9628
9318
9605
8640
9214
9567
8547
9185
9470
9123
9278
10170
9434
9655
9429
8739
9552
9687
9019
9672
9206
9069
9788
10312
10105
9863
9656
9295
9946
9701
9049
10190
9706
9765
9893
9994
10433
10073
10112
9266
9820
10097
9115
10411
9678
10408
10153
10368
10581
10597
10680
9738
9556




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=201976&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 time7 seconds
R Server'George Udny Yule' @ yule.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[63])
519946-------
529701-------
539049-------
5410190-------
559705.99999999999-------
569764.99999999999-------
579893-------
589993.99999999999-------
5910433-------
6010073-------
6110112-------
629266-------
639820-------
64100979969.45319429.203210540.65680.33080.6960.82150.696
6591159075.25858577.6219601.76670.44121e-040.53890.0028
661041110176.44169615.84510769.72060.21920.99980.48210.8805
6796789765.59069210.249410354.41660.38530.01580.57860.4281
68104089868.86049303.899710468.12710.03890.73380.6330.5635
69101539846.68689272.825410456.06240.16230.03550.44080.5342
701036810247.33669644.808810887.50540.35590.61360.7810.9046
711058110352.02339736.055311006.96150.24660.48090.40430.9443
72105979990.18889390.449810628.23130.03120.03480.39960.6994
731068010083.54379476.692810729.25510.03510.05960.46560.7881
7497389287.45558723.90789887.40730.070500.52790.0409
7595569754.02229157.441110389.46880.27070.51970.41940.4194

\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[63]) \tabularnewline
51 & 9946 & - & - & - & - & - & - & - \tabularnewline
52 & 9701 & - & - & - & - & - & - & - \tabularnewline
53 & 9049 & - & - & - & - & - & - & - \tabularnewline
54 & 10190 & - & - & - & - & - & - & - \tabularnewline
55 & 9705.99999999999 & - & - & - & - & - & - & - \tabularnewline
56 & 9764.99999999999 & - & - & - & - & - & - & - \tabularnewline
57 & 9893 & - & - & - & - & - & - & - \tabularnewline
58 & 9993.99999999999 & - & - & - & - & - & - & - \tabularnewline
59 & 10433 & - & - & - & - & - & - & - \tabularnewline
60 & 10073 & - & - & - & - & - & - & - \tabularnewline
61 & 10112 & - & - & - & - & - & - & - \tabularnewline
62 & 9266 & - & - & - & - & - & - & - \tabularnewline
63 & 9820 & - & - & - & - & - & - & - \tabularnewline
64 & 10097 & 9969.4531 & 9429.2032 & 10540.6568 & 0.3308 & 0.696 & 0.8215 & 0.696 \tabularnewline
65 & 9115 & 9075.2585 & 8577.621 & 9601.7667 & 0.4412 & 1e-04 & 0.5389 & 0.0028 \tabularnewline
66 & 10411 & 10176.4416 & 9615.845 & 10769.7206 & 0.2192 & 0.9998 & 0.4821 & 0.8805 \tabularnewline
67 & 9678 & 9765.5906 & 9210.2494 & 10354.4166 & 0.3853 & 0.0158 & 0.5786 & 0.4281 \tabularnewline
68 & 10408 & 9868.8604 & 9303.8997 & 10468.1271 & 0.0389 & 0.7338 & 0.633 & 0.5635 \tabularnewline
69 & 10153 & 9846.6868 & 9272.8254 & 10456.0624 & 0.1623 & 0.0355 & 0.4408 & 0.5342 \tabularnewline
70 & 10368 & 10247.3366 & 9644.8088 & 10887.5054 & 0.3559 & 0.6136 & 0.781 & 0.9046 \tabularnewline
71 & 10581 & 10352.0233 & 9736.0553 & 11006.9615 & 0.2466 & 0.4809 & 0.4043 & 0.9443 \tabularnewline
72 & 10597 & 9990.1888 & 9390.4498 & 10628.2313 & 0.0312 & 0.0348 & 0.3996 & 0.6994 \tabularnewline
73 & 10680 & 10083.5437 & 9476.6928 & 10729.2551 & 0.0351 & 0.0596 & 0.4656 & 0.7881 \tabularnewline
74 & 9738 & 9287.4555 & 8723.9078 & 9887.4073 & 0.0705 & 0 & 0.5279 & 0.0409 \tabularnewline
75 & 9556 & 9754.0222 & 9157.4411 & 10389.4688 & 0.2707 & 0.5197 & 0.4194 & 0.4194 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=201976&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[63])[/C][/ROW]
[ROW][C]51[/C][C]9946[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]52[/C][C]9701[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]53[/C][C]9049[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]54[/C][C]10190[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]55[/C][C]9705.99999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]56[/C][C]9764.99999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]57[/C][C]9893[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]58[/C][C]9993.99999999999[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]59[/C][C]10433[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]60[/C][C]10073[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]61[/C][C]10112[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]62[/C][C]9266[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]63[/C][C]9820[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]64[/C][C]10097[/C][C]9969.4531[/C][C]9429.2032[/C][C]10540.6568[/C][C]0.3308[/C][C]0.696[/C][C]0.8215[/C][C]0.696[/C][/ROW]
[ROW][C]65[/C][C]9115[/C][C]9075.2585[/C][C]8577.621[/C][C]9601.7667[/C][C]0.4412[/C][C]1e-04[/C][C]0.5389[/C][C]0.0028[/C][/ROW]
[ROW][C]66[/C][C]10411[/C][C]10176.4416[/C][C]9615.845[/C][C]10769.7206[/C][C]0.2192[/C][C]0.9998[/C][C]0.4821[/C][C]0.8805[/C][/ROW]
[ROW][C]67[/C][C]9678[/C][C]9765.5906[/C][C]9210.2494[/C][C]10354.4166[/C][C]0.3853[/C][C]0.0158[/C][C]0.5786[/C][C]0.4281[/C][/ROW]
[ROW][C]68[/C][C]10408[/C][C]9868.8604[/C][C]9303.8997[/C][C]10468.1271[/C][C]0.0389[/C][C]0.7338[/C][C]0.633[/C][C]0.5635[/C][/ROW]
[ROW][C]69[/C][C]10153[/C][C]9846.6868[/C][C]9272.8254[/C][C]10456.0624[/C][C]0.1623[/C][C]0.0355[/C][C]0.4408[/C][C]0.5342[/C][/ROW]
[ROW][C]70[/C][C]10368[/C][C]10247.3366[/C][C]9644.8088[/C][C]10887.5054[/C][C]0.3559[/C][C]0.6136[/C][C]0.781[/C][C]0.9046[/C][/ROW]
[ROW][C]71[/C][C]10581[/C][C]10352.0233[/C][C]9736.0553[/C][C]11006.9615[/C][C]0.2466[/C][C]0.4809[/C][C]0.4043[/C][C]0.9443[/C][/ROW]
[ROW][C]72[/C][C]10597[/C][C]9990.1888[/C][C]9390.4498[/C][C]10628.2313[/C][C]0.0312[/C][C]0.0348[/C][C]0.3996[/C][C]0.6994[/C][/ROW]
[ROW][C]73[/C][C]10680[/C][C]10083.5437[/C][C]9476.6928[/C][C]10729.2551[/C][C]0.0351[/C][C]0.0596[/C][C]0.4656[/C][C]0.7881[/C][/ROW]
[ROW][C]74[/C][C]9738[/C][C]9287.4555[/C][C]8723.9078[/C][C]9887.4073[/C][C]0.0705[/C][C]0[/C][C]0.5279[/C][C]0.0409[/C][/ROW]
[ROW][C]75[/C][C]9556[/C][C]9754.0222[/C][C]9157.4411[/C][C]10389.4688[/C][C]0.2707[/C][C]0.5197[/C][C]0.4194[/C][C]0.4194[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=201976&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=201976&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[63])
519946-------
529701-------
539049-------
5410190-------
559705.99999999999-------
569764.99999999999-------
579893-------
589993.99999999999-------
5910433-------
6010073-------
6110112-------
629266-------
639820-------
64100979969.45319429.203210540.65680.33080.6960.82150.696
6591159075.25858577.6219601.76670.44121e-040.53890.0028
661041110176.44169615.84510769.72060.21920.99980.48210.8805
6796789765.59069210.249410354.41660.38530.01580.57860.4281
68104089868.86049303.899710468.12710.03890.73380.6330.5635
69101539846.68689272.825410456.06240.16230.03550.44080.5342
701036810247.33669644.808810887.50540.35590.61360.7810.9046
711058110352.02339736.055311006.96150.24660.48090.40430.9443
72105979990.18889390.449810628.23130.03120.03480.39960.6994
731068010083.54379476.692810729.25510.03510.05960.46560.7881
7497389287.45558723.90789887.40730.070500.52790.0409
7595569754.02229157.441110389.46880.27070.51970.41940.4194







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
640.02920.0128016268.218500
650.02960.00440.00861579.39038923.804494.4659
660.02970.0230.013455017.622124288.4103155.8474
670.0308-0.0090.01237672.104720134.3339141.8955
680.0310.05460.0208290671.555374241.7782272.4734
690.03160.03110.022593827.769477506.11278.3992
700.03190.01180.02114559.647968513.7583261.7513
710.03230.02210.021152430.337466503.3307257.8824
720.03260.06070.0255368219.8409100027.3874316.2711
730.03270.05920.0289355760.0715125600.6558354.4018
740.0330.04850.0307202990.3621132636.0837364.1924
750.0332-0.02030.029839212.797124850.8098353.3423

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
64 & 0.0292 & 0.0128 & 0 & 16268.2185 & 0 & 0 \tabularnewline
65 & 0.0296 & 0.0044 & 0.0086 & 1579.3903 & 8923.8044 & 94.4659 \tabularnewline
66 & 0.0297 & 0.023 & 0.0134 & 55017.6221 & 24288.4103 & 155.8474 \tabularnewline
67 & 0.0308 & -0.009 & 0.0123 & 7672.1047 & 20134.3339 & 141.8955 \tabularnewline
68 & 0.031 & 0.0546 & 0.0208 & 290671.5553 & 74241.7782 & 272.4734 \tabularnewline
69 & 0.0316 & 0.0311 & 0.0225 & 93827.7694 & 77506.11 & 278.3992 \tabularnewline
70 & 0.0319 & 0.0118 & 0.021 & 14559.6479 & 68513.7583 & 261.7513 \tabularnewline
71 & 0.0323 & 0.0221 & 0.0211 & 52430.3374 & 66503.3307 & 257.8824 \tabularnewline
72 & 0.0326 & 0.0607 & 0.0255 & 368219.8409 & 100027.3874 & 316.2711 \tabularnewline
73 & 0.0327 & 0.0592 & 0.0289 & 355760.0715 & 125600.6558 & 354.4018 \tabularnewline
74 & 0.033 & 0.0485 & 0.0307 & 202990.3621 & 132636.0837 & 364.1924 \tabularnewline
75 & 0.0332 & -0.0203 & 0.0298 & 39212.797 & 124850.8098 & 353.3423 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=201976&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]64[/C][C]0.0292[/C][C]0.0128[/C][C]0[/C][C]16268.2185[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]65[/C][C]0.0296[/C][C]0.0044[/C][C]0.0086[/C][C]1579.3903[/C][C]8923.8044[/C][C]94.4659[/C][/ROW]
[ROW][C]66[/C][C]0.0297[/C][C]0.023[/C][C]0.0134[/C][C]55017.6221[/C][C]24288.4103[/C][C]155.8474[/C][/ROW]
[ROW][C]67[/C][C]0.0308[/C][C]-0.009[/C][C]0.0123[/C][C]7672.1047[/C][C]20134.3339[/C][C]141.8955[/C][/ROW]
[ROW][C]68[/C][C]0.031[/C][C]0.0546[/C][C]0.0208[/C][C]290671.5553[/C][C]74241.7782[/C][C]272.4734[/C][/ROW]
[ROW][C]69[/C][C]0.0316[/C][C]0.0311[/C][C]0.0225[/C][C]93827.7694[/C][C]77506.11[/C][C]278.3992[/C][/ROW]
[ROW][C]70[/C][C]0.0319[/C][C]0.0118[/C][C]0.021[/C][C]14559.6479[/C][C]68513.7583[/C][C]261.7513[/C][/ROW]
[ROW][C]71[/C][C]0.0323[/C][C]0.0221[/C][C]0.0211[/C][C]52430.3374[/C][C]66503.3307[/C][C]257.8824[/C][/ROW]
[ROW][C]72[/C][C]0.0326[/C][C]0.0607[/C][C]0.0255[/C][C]368219.8409[/C][C]100027.3874[/C][C]316.2711[/C][/ROW]
[ROW][C]73[/C][C]0.0327[/C][C]0.0592[/C][C]0.0289[/C][C]355760.0715[/C][C]125600.6558[/C][C]354.4018[/C][/ROW]
[ROW][C]74[/C][C]0.033[/C][C]0.0485[/C][C]0.0307[/C][C]202990.3621[/C][C]132636.0837[/C][C]364.1924[/C][/ROW]
[ROW][C]75[/C][C]0.0332[/C][C]-0.0203[/C][C]0.0298[/C][C]39212.797[/C][C]124850.8098[/C][C]353.3423[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=201976&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=201976&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
640.02920.0128016268.218500
650.02960.00440.00861579.39038923.804494.4659
660.02970.0230.013455017.622124288.4103155.8474
670.0308-0.0090.01237672.104720134.3339141.8955
680.0310.05460.0208290671.555374241.7782272.4734
690.03160.03110.022593827.769477506.11278.3992
700.03190.01180.02114559.647968513.7583261.7513
710.03230.02210.021152430.337466503.3307257.8824
720.03260.06070.0255368219.8409100027.3874316.2711
730.03270.05920.0289355760.0715125600.6558354.4018
740.0330.04850.0307202990.3621132636.0837364.1924
750.0332-0.02030.029839212.797124850.8098353.3423



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