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 computationFri, 10 Dec 2010 12:43:26 +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/10/t1291984915ogod9nec3u2yt8x.htm/, Retrieved Mon, 29 Apr 2024 13:06:56 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=107615, Retrieved Mon, 29 Apr 2024 13:06:56 +0000
QR Codes:

Original text written by user:
IsPrivate?No (this computation is public)
User-defined keywords
Estimated Impact153
Family? (F = Feedback message, R = changed R code, M = changed R Module, P = changed Parameters, D = changed Data)
-     [Univariate Data Series] [data set] [2008-12-01 19:54:57] [b98453cac15ba1066b407e146608df68]
- RMP   [Standard Deviation-Mean Plot] [Unemployment] [2010-11-29 10:34:47] [b98453cac15ba1066b407e146608df68]
- RMP     [ARIMA Forecasting] [Unemployment] [2010-11-29 20:46:45] [b98453cac15ba1066b407e146608df68]
-   PD      [ARIMA Forecasting] [WS9 - ARIMA Forec...] [2010-12-04 16:25:58] [8ef49741e164ec6343c90c7935194465]
-   P         [ARIMA Forecasting] [WS9 - ARIMA Forec...] [2010-12-04 16:58:46] [8ef49741e164ec6343c90c7935194465]
-               [ARIMA Forecasting] [WS 9 arima] [2010-12-07 10:08:07] [8214fe6d084e5ad7598b249a26cc9f06]
-   PD              [ARIMA Forecasting] [paper arima forec...] [2010-12-10 12:43:26] [b47314d83d48c7bf812ec2bcd743b159] [Current]
-   PD                [ARIMA Forecasting] [arima forecasting...] [2010-12-22 20:45:09] [8214fe6d084e5ad7598b249a26cc9f06]
-    D                  [ARIMA Forecasting] [arima forecast la...] [2010-12-22 21:48:20] [8214fe6d084e5ad7598b249a26cc9f06]
-   PD                [ARIMA Forecasting] [arima forecasting...] [2010-12-22 22:14:04] [8214fe6d084e5ad7598b249a26cc9f06]
Feedback Forum

Post a new message
Dataseries X:
1579
2146
2462
3695
4831
5134
6250
5760
6249
2917
1741
2359
1511
2059
2635
2867
4403
5720
4502
5749
5627
2846
1762
2429
1169
2154
2249
2687
4359
5382
4459
6398
4596
3024
1887
2070
1351
2218
2461
3028
4784
4975
4607
6249
4809
3157
1910
2228
1594
2467
2222
3607
4685
4962
5770
5480
5000
3228
1993
2288
1580
2111
2192
3601
4665
4876
5813
5589
5331
3075
2002
2306
1507
1992
2487
3490
4647
5594
5611
5788
6204
3013
1931
2549
1504
2090
2702
2939
4500
6208
6415
5657
5964
3163
1997
2422
1376
2202
2683
3303
5202
5231
4880
7998
4977
3531
2025
2205
1442
2238
2179
3218
5139
4990
4914
6084
5672
3548
1793
2086




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

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=107615&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])
962422-------
971376-------
982202-------
992683-------
1003303-------
1015202-------
1025231-------
1034880-------
1047998-------
1054977-------
1063531-------
1072025-------
1082205-------
10914421483.45551337.62691654.49950.317400.89090
11022382204.77191942.1762524.46140.419310.50680.4994
11121792409.68712107.7622781.45630.1120.81730.07480.8597
11232183420.95142896.59454101.73330.27950.99980.63290.9998
11351394831.80943968.43746010.93760.30480.99630.26921
11449905090.96044156.03576380.87410.4390.47090.41571
11549145041.26154116.21016317.16310.42250.53140.59781
11660846513.8865180.75158436.52670.33060.94860.06511
11756725139.02524186.66856457.54410.21410.08010.59521
11835483194.65572713.41093816.2780.132600.14450.9991
11917931920.58741690.29912201.35580.186600.2330.0235
12020862255.10411964.28122615.64060.1790.9940.60730.6073

\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 & 2422 & - & - & - & - & - & - & - \tabularnewline
97 & 1376 & - & - & - & - & - & - & - \tabularnewline
98 & 2202 & - & - & - & - & - & - & - \tabularnewline
99 & 2683 & - & - & - & - & - & - & - \tabularnewline
100 & 3303 & - & - & - & - & - & - & - \tabularnewline
101 & 5202 & - & - & - & - & - & - & - \tabularnewline
102 & 5231 & - & - & - & - & - & - & - \tabularnewline
103 & 4880 & - & - & - & - & - & - & - \tabularnewline
104 & 7998 & - & - & - & - & - & - & - \tabularnewline
105 & 4977 & - & - & - & - & - & - & - \tabularnewline
106 & 3531 & - & - & - & - & - & - & - \tabularnewline
107 & 2025 & - & - & - & - & - & - & - \tabularnewline
108 & 2205 & - & - & - & - & - & - & - \tabularnewline
109 & 1442 & 1483.4555 & 1337.6269 & 1654.4995 & 0.3174 & 0 & 0.8909 & 0 \tabularnewline
110 & 2238 & 2204.7719 & 1942.176 & 2524.4614 & 0.4193 & 1 & 0.5068 & 0.4994 \tabularnewline
111 & 2179 & 2409.6871 & 2107.762 & 2781.4563 & 0.112 & 0.8173 & 0.0748 & 0.8597 \tabularnewline
112 & 3218 & 3420.9514 & 2896.5945 & 4101.7333 & 0.2795 & 0.9998 & 0.6329 & 0.9998 \tabularnewline
113 & 5139 & 4831.8094 & 3968.4374 & 6010.9376 & 0.3048 & 0.9963 & 0.2692 & 1 \tabularnewline
114 & 4990 & 5090.9604 & 4156.0357 & 6380.8741 & 0.439 & 0.4709 & 0.4157 & 1 \tabularnewline
115 & 4914 & 5041.2615 & 4116.2101 & 6317.1631 & 0.4225 & 0.5314 & 0.5978 & 1 \tabularnewline
116 & 6084 & 6513.886 & 5180.7515 & 8436.5267 & 0.3306 & 0.9486 & 0.0651 & 1 \tabularnewline
117 & 5672 & 5139.0252 & 4186.6685 & 6457.5441 & 0.2141 & 0.0801 & 0.5952 & 1 \tabularnewline
118 & 3548 & 3194.6557 & 2713.4109 & 3816.278 & 0.1326 & 0 & 0.1445 & 0.9991 \tabularnewline
119 & 1793 & 1920.5874 & 1690.2991 & 2201.3558 & 0.1866 & 0 & 0.233 & 0.0235 \tabularnewline
120 & 2086 & 2255.1041 & 1964.2812 & 2615.6406 & 0.179 & 0.994 & 0.6073 & 0.6073 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=107615&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]2422[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]97[/C][C]1376[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]98[/C][C]2202[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]99[/C][C]2683[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]100[/C][C]3303[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]101[/C][C]5202[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]102[/C][C]5231[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]103[/C][C]4880[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]104[/C][C]7998[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]105[/C][C]4977[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]106[/C][C]3531[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]107[/C][C]2025[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]108[/C][C]2205[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]109[/C][C]1442[/C][C]1483.4555[/C][C]1337.6269[/C][C]1654.4995[/C][C]0.3174[/C][C]0[/C][C]0.8909[/C][C]0[/C][/ROW]
[ROW][C]110[/C][C]2238[/C][C]2204.7719[/C][C]1942.176[/C][C]2524.4614[/C][C]0.4193[/C][C]1[/C][C]0.5068[/C][C]0.4994[/C][/ROW]
[ROW][C]111[/C][C]2179[/C][C]2409.6871[/C][C]2107.762[/C][C]2781.4563[/C][C]0.112[/C][C]0.8173[/C][C]0.0748[/C][C]0.8597[/C][/ROW]
[ROW][C]112[/C][C]3218[/C][C]3420.9514[/C][C]2896.5945[/C][C]4101.7333[/C][C]0.2795[/C][C]0.9998[/C][C]0.6329[/C][C]0.9998[/C][/ROW]
[ROW][C]113[/C][C]5139[/C][C]4831.8094[/C][C]3968.4374[/C][C]6010.9376[/C][C]0.3048[/C][C]0.9963[/C][C]0.2692[/C][C]1[/C][/ROW]
[ROW][C]114[/C][C]4990[/C][C]5090.9604[/C][C]4156.0357[/C][C]6380.8741[/C][C]0.439[/C][C]0.4709[/C][C]0.4157[/C][C]1[/C][/ROW]
[ROW][C]115[/C][C]4914[/C][C]5041.2615[/C][C]4116.2101[/C][C]6317.1631[/C][C]0.4225[/C][C]0.5314[/C][C]0.5978[/C][C]1[/C][/ROW]
[ROW][C]116[/C][C]6084[/C][C]6513.886[/C][C]5180.7515[/C][C]8436.5267[/C][C]0.3306[/C][C]0.9486[/C][C]0.0651[/C][C]1[/C][/ROW]
[ROW][C]117[/C][C]5672[/C][C]5139.0252[/C][C]4186.6685[/C][C]6457.5441[/C][C]0.2141[/C][C]0.0801[/C][C]0.5952[/C][C]1[/C][/ROW]
[ROW][C]118[/C][C]3548[/C][C]3194.6557[/C][C]2713.4109[/C][C]3816.278[/C][C]0.1326[/C][C]0[/C][C]0.1445[/C][C]0.9991[/C][/ROW]
[ROW][C]119[/C][C]1793[/C][C]1920.5874[/C][C]1690.2991[/C][C]2201.3558[/C][C]0.1866[/C][C]0[/C][C]0.233[/C][C]0.0235[/C][/ROW]
[ROW][C]120[/C][C]2086[/C][C]2255.1041[/C][C]1964.2812[/C][C]2615.6406[/C][C]0.179[/C][C]0.994[/C][C]0.6073[/C][C]0.6073[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=107615&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=107615&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])
962422-------
971376-------
982202-------
992683-------
1003303-------
1015202-------
1025231-------
1034880-------
1047998-------
1054977-------
1063531-------
1072025-------
1082205-------
10914421483.45551337.62691654.49950.317400.89090
11022382204.77191942.1762524.46140.419310.50680.4994
11121792409.68712107.7622781.45630.1120.81730.07480.8597
11232183420.95142896.59454101.73330.27950.99980.63290.9998
11351394831.80943968.43746010.93760.30480.99630.26921
11449905090.96044156.03576380.87410.4390.47090.41571
11549145041.26154116.21016317.16310.42250.53140.59781
11660846513.8865180.75158436.52670.33060.94860.06511
11756725139.02524186.66856457.54410.21410.08010.59521
11835483194.65572713.41093816.2780.132600.14450.9991
11917931920.58741690.29912201.35580.186600.2330.0235
12020862255.10411964.28122615.64060.1790.9940.60730.6073







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
1090.0588-0.027901718.561200
1100.0740.01510.02151104.10991411.335537.5677
1110.0787-0.09570.046253216.536818679.7359136.6738
1120.1015-0.05930.049541189.255324307.1158155.9074
1130.12450.06360.052394366.085638318.9097195.7522
1140.1293-0.01980.046910193.005833631.2591183.3883
1150.1291-0.02520.043816195.483231140.434176.4665
1160.1506-0.0660.0466184801.99150348.1286224.3839
1170.13090.10370.0529284062.171576316.3556276.2542
1180.09930.11060.0587124852.176581169.9377284.9034
1190.0746-0.06640.059416278.549575270.7206274.3551
1200.0816-0.0750.060728596.190971381.1764267.1726

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
109 & 0.0588 & -0.0279 & 0 & 1718.5612 & 0 & 0 \tabularnewline
110 & 0.074 & 0.0151 & 0.0215 & 1104.1099 & 1411.3355 & 37.5677 \tabularnewline
111 & 0.0787 & -0.0957 & 0.0462 & 53216.5368 & 18679.7359 & 136.6738 \tabularnewline
112 & 0.1015 & -0.0593 & 0.0495 & 41189.2553 & 24307.1158 & 155.9074 \tabularnewline
113 & 0.1245 & 0.0636 & 0.0523 & 94366.0856 & 38318.9097 & 195.7522 \tabularnewline
114 & 0.1293 & -0.0198 & 0.0469 & 10193.0058 & 33631.2591 & 183.3883 \tabularnewline
115 & 0.1291 & -0.0252 & 0.0438 & 16195.4832 & 31140.434 & 176.4665 \tabularnewline
116 & 0.1506 & -0.066 & 0.0466 & 184801.991 & 50348.1286 & 224.3839 \tabularnewline
117 & 0.1309 & 0.1037 & 0.0529 & 284062.1715 & 76316.3556 & 276.2542 \tabularnewline
118 & 0.0993 & 0.1106 & 0.0587 & 124852.1765 & 81169.9377 & 284.9034 \tabularnewline
119 & 0.0746 & -0.0664 & 0.0594 & 16278.5495 & 75270.7206 & 274.3551 \tabularnewline
120 & 0.0816 & -0.075 & 0.0607 & 28596.1909 & 71381.1764 & 267.1726 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=107615&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.0588[/C][C]-0.0279[/C][C]0[/C][C]1718.5612[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]110[/C][C]0.074[/C][C]0.0151[/C][C]0.0215[/C][C]1104.1099[/C][C]1411.3355[/C][C]37.5677[/C][/ROW]
[ROW][C]111[/C][C]0.0787[/C][C]-0.0957[/C][C]0.0462[/C][C]53216.5368[/C][C]18679.7359[/C][C]136.6738[/C][/ROW]
[ROW][C]112[/C][C]0.1015[/C][C]-0.0593[/C][C]0.0495[/C][C]41189.2553[/C][C]24307.1158[/C][C]155.9074[/C][/ROW]
[ROW][C]113[/C][C]0.1245[/C][C]0.0636[/C][C]0.0523[/C][C]94366.0856[/C][C]38318.9097[/C][C]195.7522[/C][/ROW]
[ROW][C]114[/C][C]0.1293[/C][C]-0.0198[/C][C]0.0469[/C][C]10193.0058[/C][C]33631.2591[/C][C]183.3883[/C][/ROW]
[ROW][C]115[/C][C]0.1291[/C][C]-0.0252[/C][C]0.0438[/C][C]16195.4832[/C][C]31140.434[/C][C]176.4665[/C][/ROW]
[ROW][C]116[/C][C]0.1506[/C][C]-0.066[/C][C]0.0466[/C][C]184801.991[/C][C]50348.1286[/C][C]224.3839[/C][/ROW]
[ROW][C]117[/C][C]0.1309[/C][C]0.1037[/C][C]0.0529[/C][C]284062.1715[/C][C]76316.3556[/C][C]276.2542[/C][/ROW]
[ROW][C]118[/C][C]0.0993[/C][C]0.1106[/C][C]0.0587[/C][C]124852.1765[/C][C]81169.9377[/C][C]284.9034[/C][/ROW]
[ROW][C]119[/C][C]0.0746[/C][C]-0.0664[/C][C]0.0594[/C][C]16278.5495[/C][C]75270.7206[/C][C]274.3551[/C][/ROW]
[ROW][C]120[/C][C]0.0816[/C][C]-0.075[/C][C]0.0607[/C][C]28596.1909[/C][C]71381.1764[/C][C]267.1726[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=107615&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=107615&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.0588-0.027901718.561200
1100.0740.01510.02151104.10991411.335537.5677
1110.0787-0.09570.046253216.536818679.7359136.6738
1120.1015-0.05930.049541189.255324307.1158155.9074
1130.12450.06360.052394366.085638318.9097195.7522
1140.1293-0.01980.046910193.005833631.2591183.3883
1150.1291-0.02520.043816195.483231140.434176.4665
1160.1506-0.0660.0466184801.99150348.1286224.3839
1170.13090.10370.0529284062.171576316.3556276.2542
1180.09930.11060.0587124852.176581169.9377284.9034
1190.0746-0.06640.059416278.549575270.7206274.3551
1200.0816-0.0750.060728596.190971381.1764267.1726



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