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] 26 The symbol ly denotes one year, so 8t/\y is the length of <5f expressed in years. With this choice of units, a is an annualized volatility, with values roughly from 1 % (for bonds) to 50% (for stocks), and a typical value of 10% for foreign exchange. For t < -T, t < -T, we have the expectationE[z(t)z(t)] = z(-T)2 + amin(--, ~ ~ 7) (3.39)Having defined the space of processes, a short computation givese2 = zi-T)2(j dt£l(t)j +2(7 J dtw(t) J dt { )-- (3.40)The first term is the "error at initialization" corresponding to the decay of the initial value Q\- T](-T) = 0 in Equation 3.36. A better initialization is T](- T) = z(-T) /0°° co(t), corresponding to a modified definition for £2[T](t):Q[T; zKt) = z(-T) f dtco(t-t)+ f dtco(t - t) z(t) (3.41)Another interpretation for the above formula is that z is approximated by its most probable value z(-T) for t < T. With this better definition for Q, the error reduces toC°° t - T2a / dt co(t) / dt coif)- (3.42)Jt Jt iyFor a given kernel , volatility a and error e, Equation 3.42 is an equation for T. Most of the kernels introduced in the next section have the scaling form w(t, t) = -oo(3.45)for some exponents p and q. An example is the moving norm (see Section 3.3.8) with corresponding to an average and q = \/p.Nonlinear operators can also be used to build robust estimators. Data errors (outliers) should be eliminated by a data filter prior to any computation, as discussed in Chapter 4. As an alternative or in addition to prior data cleaning, robust estimators can reduce the dependency of results on outliers or the choice of the data cleaning algorithm. This problem is acute mainly when working with returns, because the difference operator needed to compute returns (r) from prices (x) is sensitive to outliers. The following modified operator achieves robustness by giving a higher weight to the center of the distribution of returns r than to the tails:fi[/;r] = /-,{fi[/(r)]} (3.46)where / is an odd, monotonic function over E. Possible mapping functions f(x) aresign(x)x) = x\x\r~l (3.47)sign(x) when -+ 0 (3.48)tanh(x/x0) (3.49)Robust operator mapping functions defined by Equation 3.47 have an exponent 0 < < 1. Tn some special applications, operators with > 1, emphasizing the tail of the distribution, may also be used. In the context of volatility estimates, the usual L2 volatility operator based on squared returns can be made more robust by using the mapping function / = sign(x)y[x (the signed square root); the resulting volatility is then based on absolute returns as in Equation 3.67. More generally, the signed power f(x) = sign(x)xp transforms an L2 volatility into an L2p volatility. This simple power law transformation is often used and therefore included in the definition of the moving norm, moving variance or volatility operators, Equation 3.60. Yet some more general transformations can also be used.3.3.5 Exponential Moving Average (EMA)The basic exponential moving average (EMA) is the simplest linear operator, the first one in a series of linear operators to be presented. It is an averaging operator with an exponentially decaying kernel:e-t/rema(r) =- (3.50)This EMA operator is our foundation stone, because its computation is very efficient and other more complex operators can be built with it, such as moving averages (MAs), differentials, derivatives, and volatilities. The numerical evaluation is efficient because of the exponential form of the kernel, which leads to a simple iterative formula first proposed by Muller (1991):EMA[r; z](r„) = (3.51)ix [ ; z](f„-i) + (v - n)zn-i + (1 - v)znwitha = -ll = e~awhere v depends on the chosen interpolation scheme,1 previous point(1 - )/ linear interpolation (3.52) next pointDue to this iterative formula, the convolution is never computed in practice; only few multiplications and additions have to be done for each tick. Tn Section 3.3.14, the EMA operator is extended to the case of complex kernels.3.3.6 The Iterated EMA OperatorThe basic EMA operator can be iterated to provide a family of iterated exponential moving average operators EMA[r, ]. Practitioners of technical analysis have[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]