back start next


[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [ 98 ] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150]


98

Table 16.3 Expected value, min, max, and counts of the five-day forward change in the s&p 500 are shown for a combination of a 5-day and 14-day stochastic

3/1/91-12/31/91 3/1/92-12/31/92

17.38

3.52

21.77

13.55

1.85

5.46

2.86

13.63

0.22

11.37

11.3

12.62

15.4

4.45

9.04

17.3

6.25

6.61

7.86

7.73

2.09

3.52

22.32

7.44

5.44

5.43

12.34

8.52

6.82

4.44

-0.21

11.75

-0.5

1.57

16.59

19.42

4.73

5.76

8.19

6.23

6.84

-9.9

-7.94

0.14

-7.81

-9.73

-8.54

5.46

-5.7

2.41

-6.59

-9.19

-3.32

-5.3

-2.18

-9.62

3.05

-13.55

-7.29

-9.94

-2.28

-2.37

-5.06

-7.36

-3.44

-7.24

-10.02

-8.44

-11.55

0.27

-6.92

0.02

-5.96

-7.34

-8.57

-5.52

-4.96

-0.5

1.57

-11.46

-18.88

-5.96

-6.91

-4.06

-5.46

-7.8

3.4767

-2.535

1.5475

1.9572

-0.07

-3345

5.46

-0.515

5.96

0.0525

-4.485

1.669

1.2056

5.9471

-0.91

3.75

0.1175

4.1975

-2.138

2.8775

4.815

0.4214

0.5989

-2.575

3.01

-0.323

0.6573

-2.708

.4.03

-2.533

5.1837

0.1157

-0.592

-1.223

-2.533

1.26

-0.5

1.57

-1.199

-0.367

0.5625

-1.737

1.64

1.424

-0.359

Count

Count

The x-coordinate is the 14-day stochastic, the y-coordinate is the 5-day stochastic. For example, in 1991 when the 14-day stochastic is around 90, and the 5-day stochastic is around 70, the expected value of the change in the S&P 500 over the next five days is 5.18.

Use Table 16.3 to compute the expected value of what will happen in the next five days. The following formulas show how. Assume that the data is in the following format as shown under expected value (EV) in Table 16.3:



max(0 , 1 -k,X I x, -cH )

ZZij 1

E(X,,X2)= " "

£f( 4 [max(0, l-k2xx2-c2j)

j max(0 , 1 - ,X I x, -ci: max(0, 1 -k2xx2-c2i

here

Xj is the 5-day stochastic x2 is the 14-day stochastic

E(x ,x2) is the expected change in the S&P 500 over the next five days cn is the center of the z-th bin of the 5-day stochastic c,. is the center of thej-th bin of the 14-day stochastic

.. is the expected value (or min or max) of the 5-day forward change in the S&P 500

is the slope of the fuzzy membership sets for the 5-day stochastic. Assuming equal spacing between the center of each bin, l/(cJ2 - ) > = > 0. Typically, kO.SKc-cu).

is the slope of the fuzzy membership sets for the 14-day stochastic. Assuming equal spacing between the center of each bin, l/(c,2 - c21) > = > 0. Typically, k2 = 0.5/(c22-c2]).

This formula uses fuzzy logic to do the computations. Other techniques like the Generalized Regression Neural Network (GRNN) or kernel density regression can be used as well.

By way of explanation of the formula, the degree of membership of x DOM(x]), in the i triangular fuzzy membership centered at cn is: DOM(xj) = max(0 , 1 - X Ixj - Cj.l). Similarly for xr The complete matrix formed by generating the set of fuzzy rules of the form: "If x; is ]; and x2 is Then, E is .." is evaluated for all / and (the numerator). The result is defuzzified by dividing by the total area under the fuzzy antecedents (the denominator). The defuzzified result is the expected change in the S&P 500. The values for the slopes of the membership sets can be adjusted to enhance or limit smoothing as desired. When there are cells with no data, it is best to use the suggested smoothing factors.

Exponential Moving Average

Another popular transform is the exponential moving average (EMA). This is used to smooth data series and construct oscillators for identifying trends. (An oscillator is the difference of two indicators of the same type, but computed over different time windows.) The most popular oscillator of this type is the Exponential Moving

Compute the expected value of the change in the S&P 500 over the next five days as:



Average Convergence Divergence (EMACD) oscillator. It is constructed by taking the difference of two exponentially smoothed moving averages.

The exponential moving average (EMA) is computed recursively. The formula for an n-period EMA is:

EMA (t) = k x X + (1 - ) x EMA (t- 1)

nw n tX / n 4

where

kn = l/(n + 1), the smoothing coefficient

X is the value of the time series at time t t

EMAn(t) is the value of the n-period EMA at time t

To start the process, the value of the EMA is set to the n-period simple average of the prior n values of data. Some programs simply assume that the first value of x is approximately equal to the average. This formula is called an exponential average, because it can be written as a series expansion of the form:

This formulation highlights one of the problems with starting up an EMA that can be troublesome with automated systems. When we start the EMA, we are truncating this exponential series. Table 16.4 shows the impact of this. There are three solutions to the truncation problem. The first is simply to use substantial quantities of data. This works well if we have an essentially infinite supply of data without gaps

Table 16.4 Truncating an exponential series

Period (n)

Window (p)

5.6%

16.2%

38.6%

14.9

27.5%

12.3

24.2

12.7

The maximum error is shown in computing an n-period EMA when truncating the series at different points. Each row represents a different number (p) of examples over which the EMA was computed. Each column represents a different smoothing period (n). Typical errors are less than those in the table.



[start] [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28] [29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43] [44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58] [59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73] [74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88] [89] [90] [91] [92] [93] [94] [95] [96] [97] [ 98 ] [99] [100] [101] [102] [103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114] [115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126] [127] [128] [129] [130] [131] [132] [133] [134] [135] [136] [137] [138] [139] [140] [141] [142] [143] [144] [145] [146] [147] [148] [149] [150]