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, 29 Dec 2010 09:52:04 +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/29/t1293616185hzfrj3tc8rqvgcc.htm/, Retrieved Fri, 03 May 2024 07:12:57 +0000
Statistical Computations at FreeStatistics.org, Office for Research Development and Education, URL https://freestatistics.org/blog/index.php?pk=116660, Retrieved Fri, 03 May 2024 07:12:57 +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] [] [2008-12-08 19:22:39] [d2d412c7f4d35ffbf5ee5ee89db327d4]
- RMP   [Spectral Analysis] [spectrum analyse ...] [2010-12-14 18:46:58] [d6e648f00513dd750579ba7880c5fbf5]
- RMP     [ARIMA Forecasting] [arima forecast] [2010-12-14 19:31:52] [d6e648f00513dd750579ba7880c5fbf5]
- R PD      [ARIMA Forecasting] [] [2010-12-16 10:48:12] [b10d6b9682dfaaa479f495240bcd67cf]
-   P         [ARIMA Forecasting] [] [2010-12-16 19:09:06] [b10d6b9682dfaaa479f495240bcd67cf]
-   PD          [ARIMA Forecasting] [] [2010-12-19 15:52:35] [b10d6b9682dfaaa479f495240bcd67cf]
-    D            [ARIMA Forecasting] [] [2010-12-28 21:16:29] [58af523ef9b33032fd2497c80088399b]
-   PD                [ARIMA Forecasting] [] [2010-12-29 09:52:04] [a3cd012a7211edfe9ed4466e21aef6a6] [Current]
Feedback Forum

Post a new message
Dataseries X:
104.31
103.88
103.88
103.86
103.89
103.98
103.98
104.29
104.29
104.24
103.98
103.54
103.44
103.32
103.3
103.26
103.14
103.11
102.91
103.23
103.23
103.14
102.91
102.42
102.1
102.07
102.06
101.98
101.83
101.75
101.56
101.66
101.65
101.61
101.52
101.31
101.19
101.11
101.1
101.07
100.98
100.93
100.92
101.02
101.01
100.97
100.89
100.62
100.53
100.48
100.48
100.47
100.52
100.49
100.47
100.44




Summary of computational transaction
Raw Inputview raw input (R code)
Raw Outputview raw output of R engine
Computing time2 seconds
R Server'Sir Ronald Aylmer Fisher' @ 193.190.124.24

\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 & 'Sir Ronald Aylmer Fisher' @ 193.190.124.24 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116660&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]'Sir Ronald Aylmer Fisher' @ 193.190.124.24[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116660&T=0

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116660&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'Sir Ronald Aylmer Fisher' @ 193.190.124.24







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[44])
32101.66-------
33101.65-------
34101.61-------
35101.52-------
36101.31-------
37101.19-------
38101.11-------
39101.1-------
40101.07-------
41100.98-------
42100.93-------
43100.92-------
44101.02-------
45101.01101.0553100.8376101.2730.34160.624800.6248
46100.97101.076100.7027101.44940.28890.63550.00250.6157
47100.89101.0691100.5662101.57210.24260.65040.03950.5759
48100.62101.0595100.4467101.67230.07990.70620.21150.5503
49100.53101.1319100.424101.83980.04780.92180.43610.6216
50100.48101.1243100.3344101.91410.05490.92990.51410.6021
51100.48101.1144100.2501101.97870.07510.92490.5130.5848
52100.47101.1265100.1934102.05950.08390.91280.54720.5885
53100.52101.0905100.0934102.08750.13110.88870.5860.5551
54100.49101.0684100.0112102.12570.14180.84540.60130.5358
55100.47101.094499.9802102.20850.1360.85620.62050.552
56100.44101.1802100.0118102.34850.10720.88330.60590.6059

\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[44]) \tabularnewline
32 & 101.66 & - & - & - & - & - & - & - \tabularnewline
33 & 101.65 & - & - & - & - & - & - & - \tabularnewline
34 & 101.61 & - & - & - & - & - & - & - \tabularnewline
35 & 101.52 & - & - & - & - & - & - & - \tabularnewline
36 & 101.31 & - & - & - & - & - & - & - \tabularnewline
37 & 101.19 & - & - & - & - & - & - & - \tabularnewline
38 & 101.11 & - & - & - & - & - & - & - \tabularnewline
39 & 101.1 & - & - & - & - & - & - & - \tabularnewline
40 & 101.07 & - & - & - & - & - & - & - \tabularnewline
41 & 100.98 & - & - & - & - & - & - & - \tabularnewline
42 & 100.93 & - & - & - & - & - & - & - \tabularnewline
43 & 100.92 & - & - & - & - & - & - & - \tabularnewline
44 & 101.02 & - & - & - & - & - & - & - \tabularnewline
45 & 101.01 & 101.0553 & 100.8376 & 101.273 & 0.3416 & 0.6248 & 0 & 0.6248 \tabularnewline
46 & 100.97 & 101.076 & 100.7027 & 101.4494 & 0.2889 & 0.6355 & 0.0025 & 0.6157 \tabularnewline
47 & 100.89 & 101.0691 & 100.5662 & 101.5721 & 0.2426 & 0.6504 & 0.0395 & 0.5759 \tabularnewline
48 & 100.62 & 101.0595 & 100.4467 & 101.6723 & 0.0799 & 0.7062 & 0.2115 & 0.5503 \tabularnewline
49 & 100.53 & 101.1319 & 100.424 & 101.8398 & 0.0478 & 0.9218 & 0.4361 & 0.6216 \tabularnewline
50 & 100.48 & 101.1243 & 100.3344 & 101.9141 & 0.0549 & 0.9299 & 0.5141 & 0.6021 \tabularnewline
51 & 100.48 & 101.1144 & 100.2501 & 101.9787 & 0.0751 & 0.9249 & 0.513 & 0.5848 \tabularnewline
52 & 100.47 & 101.1265 & 100.1934 & 102.0595 & 0.0839 & 0.9128 & 0.5472 & 0.5885 \tabularnewline
53 & 100.52 & 101.0905 & 100.0934 & 102.0875 & 0.1311 & 0.8887 & 0.586 & 0.5551 \tabularnewline
54 & 100.49 & 101.0684 & 100.0112 & 102.1257 & 0.1418 & 0.8454 & 0.6013 & 0.5358 \tabularnewline
55 & 100.47 & 101.0944 & 99.9802 & 102.2085 & 0.136 & 0.8562 & 0.6205 & 0.552 \tabularnewline
56 & 100.44 & 101.1802 & 100.0118 & 102.3485 & 0.1072 & 0.8833 & 0.6059 & 0.6059 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116660&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[44])[/C][/ROW]
[ROW][C]32[/C][C]101.66[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]33[/C][C]101.65[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]34[/C][C]101.61[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]35[/C][C]101.52[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]36[/C][C]101.31[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]37[/C][C]101.19[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]38[/C][C]101.11[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]39[/C][C]101.1[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]40[/C][C]101.07[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]41[/C][C]100.98[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]42[/C][C]100.93[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]43[/C][C]100.92[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]44[/C][C]101.02[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][C]-[/C][/ROW]
[ROW][C]45[/C][C]101.01[/C][C]101.0553[/C][C]100.8376[/C][C]101.273[/C][C]0.3416[/C][C]0.6248[/C][C]0[/C][C]0.6248[/C][/ROW]
[ROW][C]46[/C][C]100.97[/C][C]101.076[/C][C]100.7027[/C][C]101.4494[/C][C]0.2889[/C][C]0.6355[/C][C]0.0025[/C][C]0.6157[/C][/ROW]
[ROW][C]47[/C][C]100.89[/C][C]101.0691[/C][C]100.5662[/C][C]101.5721[/C][C]0.2426[/C][C]0.6504[/C][C]0.0395[/C][C]0.5759[/C][/ROW]
[ROW][C]48[/C][C]100.62[/C][C]101.0595[/C][C]100.4467[/C][C]101.6723[/C][C]0.0799[/C][C]0.7062[/C][C]0.2115[/C][C]0.5503[/C][/ROW]
[ROW][C]49[/C][C]100.53[/C][C]101.1319[/C][C]100.424[/C][C]101.8398[/C][C]0.0478[/C][C]0.9218[/C][C]0.4361[/C][C]0.6216[/C][/ROW]
[ROW][C]50[/C][C]100.48[/C][C]101.1243[/C][C]100.3344[/C][C]101.9141[/C][C]0.0549[/C][C]0.9299[/C][C]0.5141[/C][C]0.6021[/C][/ROW]
[ROW][C]51[/C][C]100.48[/C][C]101.1144[/C][C]100.2501[/C][C]101.9787[/C][C]0.0751[/C][C]0.9249[/C][C]0.513[/C][C]0.5848[/C][/ROW]
[ROW][C]52[/C][C]100.47[/C][C]101.1265[/C][C]100.1934[/C][C]102.0595[/C][C]0.0839[/C][C]0.9128[/C][C]0.5472[/C][C]0.5885[/C][/ROW]
[ROW][C]53[/C][C]100.52[/C][C]101.0905[/C][C]100.0934[/C][C]102.0875[/C][C]0.1311[/C][C]0.8887[/C][C]0.586[/C][C]0.5551[/C][/ROW]
[ROW][C]54[/C][C]100.49[/C][C]101.0684[/C][C]100.0112[/C][C]102.1257[/C][C]0.1418[/C][C]0.8454[/C][C]0.6013[/C][C]0.5358[/C][/ROW]
[ROW][C]55[/C][C]100.47[/C][C]101.0944[/C][C]99.9802[/C][C]102.2085[/C][C]0.136[/C][C]0.8562[/C][C]0.6205[/C][C]0.552[/C][/ROW]
[ROW][C]56[/C][C]100.44[/C][C]101.1802[/C][C]100.0118[/C][C]102.3485[/C][C]0.1072[/C][C]0.8833[/C][C]0.6059[/C][C]0.6059[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116660&T=1

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116660&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[44])
32101.66-------
33101.65-------
34101.61-------
35101.52-------
36101.31-------
37101.19-------
38101.11-------
39101.1-------
40101.07-------
41100.98-------
42100.93-------
43100.92-------
44101.02-------
45101.01101.0553100.8376101.2730.34160.624800.6248
46100.97101.076100.7027101.44940.28890.63550.00250.6157
47100.89101.0691100.5662101.57210.24260.65040.03950.5759
48100.62101.0595100.4467101.67230.07990.70620.21150.5503
49100.53101.1319100.424101.83980.04780.92180.43610.6216
50100.48101.1243100.3344101.91410.05490.92990.51410.6021
51100.48101.1144100.2501101.97870.07510.92490.5130.5848
52100.47101.1265100.1934102.05950.08390.91280.54720.5885
53100.52101.0905100.0934102.08750.13110.88870.5860.5551
54100.49101.0684100.0112102.12570.14180.84540.60130.5358
55100.47101.094499.9802102.20850.1360.85620.62050.552
56100.44101.1802100.0118102.34850.10720.88330.60590.6059







Univariate ARIMA Extrapolation Forecast Performance
time% S.E.PEMAPESq.EMSERMSE
450.0011-4e-0400.002100
460.0019-0.0017e-040.01120.00660.0815
470.0025-0.00180.00110.03210.01510.123
480.0031-0.00430.00190.19320.05960.2442
490.0036-0.0060.00270.36230.12020.3467
500.004-0.00640.00330.41510.16930.4115
510.0044-0.00630.00370.40250.20260.4501
520.0047-0.00650.00410.43090.23120.4808
530.005-0.00560.00430.32540.24160.4916
540.0053-0.00570.00440.33460.25090.5009
550.0056-0.00620.00460.38980.26360.5134
560.0059-0.00730.00480.54790.28730.536

\begin{tabular}{lllllllll}
\hline
Univariate ARIMA Extrapolation Forecast Performance \tabularnewline
time & % S.E. & PE & MAPE & Sq.E & MSE & RMSE \tabularnewline
45 & 0.0011 & -4e-04 & 0 & 0.0021 & 0 & 0 \tabularnewline
46 & 0.0019 & -0.001 & 7e-04 & 0.0112 & 0.0066 & 0.0815 \tabularnewline
47 & 0.0025 & -0.0018 & 0.0011 & 0.0321 & 0.0151 & 0.123 \tabularnewline
48 & 0.0031 & -0.0043 & 0.0019 & 0.1932 & 0.0596 & 0.2442 \tabularnewline
49 & 0.0036 & -0.006 & 0.0027 & 0.3623 & 0.1202 & 0.3467 \tabularnewline
50 & 0.004 & -0.0064 & 0.0033 & 0.4151 & 0.1693 & 0.4115 \tabularnewline
51 & 0.0044 & -0.0063 & 0.0037 & 0.4025 & 0.2026 & 0.4501 \tabularnewline
52 & 0.0047 & -0.0065 & 0.0041 & 0.4309 & 0.2312 & 0.4808 \tabularnewline
53 & 0.005 & -0.0056 & 0.0043 & 0.3254 & 0.2416 & 0.4916 \tabularnewline
54 & 0.0053 & -0.0057 & 0.0044 & 0.3346 & 0.2509 & 0.5009 \tabularnewline
55 & 0.0056 & -0.0062 & 0.0046 & 0.3898 & 0.2636 & 0.5134 \tabularnewline
56 & 0.0059 & -0.0073 & 0.0048 & 0.5479 & 0.2873 & 0.536 \tabularnewline
\hline
\end{tabular}
%Source: https://freestatistics.org/blog/index.php?pk=116660&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]45[/C][C]0.0011[/C][C]-4e-04[/C][C]0[/C][C]0.0021[/C][C]0[/C][C]0[/C][/ROW]
[ROW][C]46[/C][C]0.0019[/C][C]-0.001[/C][C]7e-04[/C][C]0.0112[/C][C]0.0066[/C][C]0.0815[/C][/ROW]
[ROW][C]47[/C][C]0.0025[/C][C]-0.0018[/C][C]0.0011[/C][C]0.0321[/C][C]0.0151[/C][C]0.123[/C][/ROW]
[ROW][C]48[/C][C]0.0031[/C][C]-0.0043[/C][C]0.0019[/C][C]0.1932[/C][C]0.0596[/C][C]0.2442[/C][/ROW]
[ROW][C]49[/C][C]0.0036[/C][C]-0.006[/C][C]0.0027[/C][C]0.3623[/C][C]0.1202[/C][C]0.3467[/C][/ROW]
[ROW][C]50[/C][C]0.004[/C][C]-0.0064[/C][C]0.0033[/C][C]0.4151[/C][C]0.1693[/C][C]0.4115[/C][/ROW]
[ROW][C]51[/C][C]0.0044[/C][C]-0.0063[/C][C]0.0037[/C][C]0.4025[/C][C]0.2026[/C][C]0.4501[/C][/ROW]
[ROW][C]52[/C][C]0.0047[/C][C]-0.0065[/C][C]0.0041[/C][C]0.4309[/C][C]0.2312[/C][C]0.4808[/C][/ROW]
[ROW][C]53[/C][C]0.005[/C][C]-0.0056[/C][C]0.0043[/C][C]0.3254[/C][C]0.2416[/C][C]0.4916[/C][/ROW]
[ROW][C]54[/C][C]0.0053[/C][C]-0.0057[/C][C]0.0044[/C][C]0.3346[/C][C]0.2509[/C][C]0.5009[/C][/ROW]
[ROW][C]55[/C][C]0.0056[/C][C]-0.0062[/C][C]0.0046[/C][C]0.3898[/C][C]0.2636[/C][C]0.5134[/C][/ROW]
[ROW][C]56[/C][C]0.0059[/C][C]-0.0073[/C][C]0.0048[/C][C]0.5479[/C][C]0.2873[/C][C]0.536[/C][/ROW]
[/TABLE]
Source: https://freestatistics.org/blog/index.php?pk=116660&T=2

Globally Unique Identifier (entire table): ba.freestatistics.org/blog/index.php?pk=116660&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
450.0011-4e-0400.002100
460.0019-0.0017e-040.01120.00660.0815
470.0025-0.00180.00110.03210.01510.123
480.0031-0.00430.00190.19320.05960.2442
490.0036-0.0060.00270.36230.12020.3467
500.004-0.00640.00330.41510.16930.4115
510.0044-0.00630.00370.40250.20260.4501
520.0047-0.00650.00410.43090.23120.4808
530.005-0.00560.00430.32540.24160.4916
540.0053-0.00570.00440.33460.25090.5009
550.0056-0.00620.00460.38980.26360.5134
560.0059-0.00730.00480.54790.28730.536



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