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 computationSun, 26 Dec 2010 19:07:51 +0000
Cite this page as followsStatistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?v=date/2010/Dec/26/t1293390336gi79vynvo4gq4el.htm/, Retrieved Mon, 06 May 2024 21:40:59 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=115780, Retrieved Mon, 06 May 2024 21:40:59 +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)
-     [Classical Decomposition] [HPC Retail Sales] [2008-03-02 16:19:32] [74be16979710d4c4e7c6647856088456]
- RMPD  [ARIMA Forecasting] [WS6 - ARIMA forecast] [2010-12-14 20:24:30] [8ed0bd3560b9ca2814a2ed0a29182575]
-   PD      [ARIMA Forecasting] [Forecast Dollar] [2010-12-26 19:07:51] [c9d5faca36bd2ada281161976df30bf1] [Current]
Feedback Forum

Post a new message
Dataseries X:
0.8973
0.9383
0.9217
0.9095
0.892
0.8742
0.8532
0.8607
0.9005
0.9111
0.9059
0.8883
0.8924
0.8833
0.87
0.8758
0.8858
0.917
0.9554
0.9922
0.9778
0.9808
0.9811
1.0014
1.0183
1.0622
1.0773
1.0807
1.0848
1.1582
1.1663
1.1372
1.1139
1.1222
1.1692
1.1702
1.2286
1.2613
1.2646
1.2262
1.1985
1.2007
1.2138
1.2266
1.2176
1.2218
1.249
1.2991
1.3408
1.3119
1.3014
1.3201
1.2938
1.2694
1.2165
1.2037
1.2292
1.2256
1.2015
1.1786
1.1856
1.2103
1.1938
1.202
1.2271
1.277
1.265
1.2684
1.2811
1.2727
1.2611
1.2881
1.3213
1.2999
1.3074
1.3242
1.3516
1.3511
1.3419
1.3716
1.3622
1.3896
1.4227
1.4684
1.457
1.4718
1.4748
1.5527
1.575
1.5557
1.5553
1.577
1.4975
1.4369
1.3322
1.2732
1.3449
1.3239
1.2785
1.305
1.319
1.365
1.4016
1.4088
1.4268
1.4562
1.4816
1.4914
1.4614
1.4272
1.3686
1.3569
1.3406
1.2565
1.2208
1.277
1.2894
1.3067
1.3898
1.3661




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time5 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk

\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 & 5 seconds \tabularnewline
R Server & 'RServer@AstonUniversity' @ vre.aston.ac.uk \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115780&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]5 seconds[/C][/ROW]
[ROW][C]R Server[/C][C]'RServer@AstonUniversity' @ vre.aston.ac.uk[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115780&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115780&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 time5 seconds
R Server'RServer@AstonUniversity' @ vre.aston.ac.uk







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[108])
961.2732-------
971.3449-------
981.3239-------
991.2785-------
1001.305-------
1011.319-------
1021.365-------
1031.4016-------
1041.4088-------
1051.4268-------
1061.4562-------
1071.4816-------
1081.4914-------
1091.46141.47991.40771.55820.32160.38670.99960.3867
1101.42721.48331.36311.62150.21280.62230.98820.4545
1111.36861.48921.33831.66940.09470.75010.98910.4906
1121.35691.49571.32221.70860.10070.8790.96040.5157
1131.34061.4971.30511.73840.10210.87230.92580.5181
1141.25651.49011.28311.75610.04260.86460.82160.4961
1151.22081.48621.26531.7760.03630.93990.71640.486
1161.2771.48831.25341.80240.09370.95250.69010.4923
1171.28941.47761.2331.81020.13370.88140.61770.4676
1181.30671.46811.21451.81830.18330.84130.52640.448
1191.38981.45271.19271.8170.36740.7840.43830.4176
1201.36611.44431.17671.82440.34350.61060.4040.404

\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[108]) \tabularnewline
96 & 1.2732 & - & - & - & - & - & - & - \tabularnewline
97 & 1.3449 & - & - & - & - & - & - & - \tabularnewline
98 & 1.3239 & - & - & - & - & - & - & - \tabularnewline
99 & 1.2785 & - & - & - & - & - & - & - \tabularnewline
100 & 1.305 & - & - & - & - & - & - & - \tabularnewline
101 & 1.319 & - & - & - & - & - & - & - \tabularnewline
102 & 1.365 & - & - & - & - & - & - & - \tabularnewline
103 & 1.4016 & - & - & - & - & - & - & - \tabularnewline
104 & 1.4088 & - & - & - & - & - & - & - \tabularnewline
105 & 1.4268 & - & - & - & - & - & - & - \tabularnewline
106 & 1.4562 & - & - & - & - & - & - & - \tabularnewline
107 & 1.4816 & - & - & - & - & - & - & - \tabularnewline
108 & 1.4914 & - & - & - & - & - & - & - \tabularnewline
109 & 1.4614 & 1.4799 & 1.4077 & 1.5582 & 0.3216 & 0.3867 & 0.9996 & 0.3867 \tabularnewline
110 & 1.4272 & 1.4833 & 1.3631 & 1.6215 & 0.2128 & 0.6223 & 0.9882 & 0.4545 \tabularnewline
111 & 1.3686 & 1.4892 & 1.3383 & 1.6694 & 0.0947 & 0.7501 & 0.9891 & 0.4906 \tabularnewline
112 & 1.3569 & 1.4957 & 1.3222 & 1.7086 & 0.1007 & 0.879 & 0.9604 & 0.5157 \tabularnewline
113 & 1.3406 & 1.497 & 1.3051 & 1.7384 & 0.1021 & 0.8723 & 0.9258 & 0.5181 \tabularnewline
114 & 1.2565 & 1.4901 & 1.2831 & 1.7561 & 0.0426 & 0.8646 & 0.8216 & 0.4961 \tabularnewline
115 & 1.2208 & 1.4862 & 1.2653 & 1.776 & 0.0363 & 0.9399 & 0.7164 & 0.486 \tabularnewline
116 & 1.277 & 1.4883 & 1.2534 & 1.8024 & 0.0937 & 0.9525 & 0.6901 & 0.4923 \tabularnewline
117 & 1.2894 & 1.4776 & 1.233 & 1.8102 & 0.1337 & 0.8814 & 0.6177 & 0.4676 \tabularnewline
118 & 1.3067 & 1.4681 & 1.2145 & 1.8183 & 0.1833 & 0.8413 & 0.5264 & 0.448 \tabularnewline
119 & 1.3898 & 1.4527 & 1.1927 & 1.817 & 0.3674 & 0.784 & 0.4383 & 0.4176 \tabularnewline
120 & 1.3661 & 1.4443 & 1.1767 & 1.8244 & 0.3435 & 0.6106 & 0.404 & 0.404 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115780&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[108])[/C][/ROW]
[ROW][C]96[/C][C]1.2732[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]1.3449[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]1.3239[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]1.2785[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]1.305[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]1.319[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]1.365[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]1.4016[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]1.4088[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]1.4268[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]1.4562[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]1.4816[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]1.4914[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]1.4614[/C][C]1.4799[/C][C]1.4077[/C][C]1.5582[/C][C]0.3216[/C][C]0.3867[/C][C]0.9996[/C][C]0.3867[/C][/ROW]
[ROW][C]110[/C][C]1.4272[/C][C]1.4833[/C][C]1.3631[/C][C]1.6215[/C][C]0.2128[/C][C]0.6223[/C][C]0.9882[/C][C]0.4545[/C][/ROW]
[ROW][C]111[/C][C]1.3686[/C][C]1.4892[/C][C]1.3383[/C][C]1.6694[/C][C]0.0947[/C][C]0.7501[/C][C]0.9891[/C][C]0.4906[/C][/ROW]
[ROW][C]112[/C][C]1.3569[/C][C]1.4957[/C][C]1.3222[/C][C]1.7086[/C][C]0.1007[/C][C]0.879[/C][C]0.9604[/C][C]0.5157[/C][/ROW]
[ROW][C]113[/C][C]1.3406[/C][C]1.497[/C][C]1.3051[/C][C]1.7384[/C][C]0.1021[/C][C]0.8723[/C][C]0.9258[/C][C]0.5181[/C][/ROW]
[ROW][C]114[/C][C]1.2565[/C][C]1.4901[/C][C]1.2831[/C][C]1.7561[/C][C]0.0426[/C][C]0.8646[/C][C]0.8216[/C][C]0.4961[/C][/ROW]
[ROW][C]115[/C][C]1.2208[/C][C]1.4862[/C][C]1.2653[/C][C]1.776[/C][C]0.0363[/C][C]0.9399[/C][C]0.7164[/C][C]0.486[/C][/ROW]
[ROW][C]116[/C][C]1.277[/C][C]1.4883[/C][C]1.2534[/C][C]1.8024[/C][C]0.0937[/C][C]0.9525[/C][C]0.6901[/C][C]0.4923[/C][/ROW]
[ROW][C]117[/C][C]1.2894[/C][C]1.4776[/C][C]1.233[/C][C]1.8102[/C][C]0.1337[/C][C]0.8814[/C][C]0.6177[/C][C]0.4676[/C][/ROW]
[ROW][C]118[/C][C]1.3067[/C][C]1.4681[/C][C]1.2145[/C][C]1.8183[/C][C]0.1833[/C][C]0.8413[/C][C]0.5264[/C][C]0.448[/C][/ROW]
[ROW][C]119[/C][C]1.3898[/C][C]1.4527[/C][C]1.1927[/C][C]1.817[/C][C]0.3674[/C][C]0.784[/C][C]0.4383[/C][C]0.4176[/C][/ROW]
[ROW][C]120[/C][C]1.3661[/C][C]1.4443[/C][C]1.1767[/C][C]1.8244[/C][C]0.3435[/C][C]0.6106[/C][C]0.404[/C][C]0.404[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115780&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115780&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[108])
961.2732-------
971.3449-------
981.3239-------
991.2785-------
1001.305-------
1011.319-------
1021.365-------
1031.4016-------
1041.4088-------
1051.4268-------
1061.4562-------
1071.4816-------
1081.4914-------
1091.46141.47991.40771.55820.32160.38670.99960.3867
1101.42721.48331.36311.62150.21280.62230.98820.4545
1111.36861.48921.33831.66940.09470.75010.98910.4906
1121.35691.49571.32221.70860.10070.8790.96040.5157
1131.34061.4971.30511.73840.10210.87230.92580.5181
1141.25651.49011.28311.75610.04260.86460.82160.4961
1151.22081.48621.26531.7760.03630.93990.71640.486
1161.2771.48831.25341.80240.09370.95250.69010.4923
1171.28941.47761.2331.81020.13370.88140.61770.4676
1181.30671.46811.21451.81830.18330.84130.52640.448
1191.38981.45271.19271.8170.36740.7840.43830.4176
1201.36611.44431.17671.82440.34350.61060.4040.404







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1090.027-0.012503e-0400
1100.0475-0.03790.02520.00320.00170.0418
1110.0617-0.0810.04380.01460.0060.0776
1120.0726-0.09280.0560.01930.00930.0966
1130.0823-0.10450.06570.02450.01240.1111
1140.0911-0.15670.08090.05450.01940.1392
1150.0995-0.17860.09480.07040.02670.1633
1160.1077-0.1420.10070.04460.02890.1701
1170.1149-0.12740.10370.03540.02960.1722
1180.1217-0.10990.10430.0260.02930.1711
1190.1279-0.04330.09880.0040.0270.1643
1200.1343-0.05410.09510.00610.02520.1589

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
109 & 0.027 & -0.0125 & 0 & 3e-04 & 0 & 0 \tabularnewline
110 & 0.0475 & -0.0379 & 0.0252 & 0.0032 & 0.0017 & 0.0418 \tabularnewline
111 & 0.0617 & -0.081 & 0.0438 & 0.0146 & 0.006 & 0.0776 \tabularnewline
112 & 0.0726 & -0.0928 & 0.056 & 0.0193 & 0.0093 & 0.0966 \tabularnewline
113 & 0.0823 & -0.1045 & 0.0657 & 0.0245 & 0.0124 & 0.1111 \tabularnewline
114 & 0.0911 & -0.1567 & 0.0809 & 0.0545 & 0.0194 & 0.1392 \tabularnewline
115 & 0.0995 & -0.1786 & 0.0948 & 0.0704 & 0.0267 & 0.1633 \tabularnewline
116 & 0.1077 & -0.142 & 0.1007 & 0.0446 & 0.0289 & 0.1701 \tabularnewline
117 & 0.1149 & -0.1274 & 0.1037 & 0.0354 & 0.0296 & 0.1722 \tabularnewline
118 & 0.1217 & -0.1099 & 0.1043 & 0.026 & 0.0293 & 0.1711 \tabularnewline
119 & 0.1279 & -0.0433 & 0.0988 & 0.004 & 0.027 & 0.1643 \tabularnewline
120 & 0.1343 & -0.0541 & 0.0951 & 0.0061 & 0.0252 & 0.1589 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=115780&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]109[/C][C]0.027[/C][C]-0.0125[/C][C]0[/C][C]3e-04[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]110[/C][C]0.0475[/C][C]-0.0379[/C][C]0.0252[/C][C]0.0032[/C][C]0.0017[/C][C]0.0418[/C][/ROW]
[ROW][C]111[/C][C]0.0617[/C][C]-0.081[/C][C]0.0438[/C][C]0.0146[/C][C]0.006[/C][C]0.0776[/C][/ROW]
[ROW][C]112[/C][C]0.0726[/C][C]-0.0928[/C][C]0.056[/C][C]0.0193[/C][C]0.0093[/C][C]0.0966[/C][/ROW]
[ROW][C]113[/C][C]0.0823[/C][C]-0.1045[/C][C]0.0657[/C][C]0.0245[/C][C]0.0124[/C][C]0.1111[/C][/ROW]
[ROW][C]114[/C][C]0.0911[/C][C]-0.1567[/C][C]0.0809[/C][C]0.0545[/C][C]0.0194[/C][C]0.1392[/C][/ROW]
[ROW][C]115[/C][C]0.0995[/C][C]-0.1786[/C][C]0.0948[/C][C]0.0704[/C][C]0.0267[/C][C]0.1633[/C][/ROW]
[ROW][C]116[/C][C]0.1077[/C][C]-0.142[/C][C]0.1007[/C][C]0.0446[/C][C]0.0289[/C][C]0.1701[/C][/ROW]
[ROW][C]117[/C][C]0.1149[/C][C]-0.1274[/C][C]0.1037[/C][C]0.0354[/C][C]0.0296[/C][C]0.1722[/C][/ROW]
[ROW][C]118[/C][C]0.1217[/C][C]-0.1099[/C][C]0.1043[/C][C]0.026[/C][C]0.0293[/C][C]0.1711[/C][/ROW]
[ROW][C]119[/C][C]0.1279[/C][C]-0.0433[/C][C]0.0988[/C][C]0.004[/C][C]0.027[/C][C]0.1643[/C][/ROW]
[ROW][C]120[/C][C]0.1343[/C][C]-0.0541[/C][C]0.0951[/C][C]0.0061[/C][C]0.0252[/C][C]0.1589[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=115780&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=115780&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
1090.027-0.012503e-0400
1100.0475-0.03790.02520.00320.00170.0418
1110.0617-0.0810.04380.01460.0060.0776
1120.0726-0.09280.0560.01930.00930.0966
1130.0823-0.10450.06570.02450.01240.1111
1140.0911-0.15670.08090.05450.01940.1392
1150.0995-0.17860.09480.07040.02670.1633
1160.1077-0.1420.10070.04460.02890.1701
1170.1149-0.12740.10370.03540.02960.1722
1180.1217-0.10990.10430.0260.02930.1711
1190.1279-0.04330.09880.0040.0270.1643
1200.1343-0.05410.09510.00610.02520.1589



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