13.08.2022 Views

advanced-algorithmic-trading

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

272

p∑

〈u, v〉 = u j v j (19.14)

j=1

Hence for two observations an inner product is defined as:

p∑

〈x i , x k 〉 = x ij x kj (19.15)

j=1

We will not dwell on the details since they are beyond the scope of this book, however it

is possible to show that a linear support vector classifier for a particular observation x can be

represented as a linear combination of inner products:

f(x) = b 0 +

With n a i coefficients, one for each of the training observations.

n∑

a i 〈x, x i 〉 (19.16)

i=1

To estimate the b 0 and a i coefficients we only need to calculate ( n

2)

= n(n − 1)/2 inner

products between all pairs of training observations. In fact, we really only need to calculate the

inner products for the subset of training observations that represent the support vectors. I will

call this subset S . This means that:

a i = 0 if x i /∈ S (19.17)

Hence we can rewrite the representation formula as:

f(x) = b 0 + ∑ i∈S

a i 〈x, x i 〉 (19.18)

It turns out that this is a major advantage for computational efficiency.

This now motivates the extension to SVMs. If we consider the inner product 〈x i , x k 〉 and

replace it with a more general inner product "kernel" function K = K(x i , x k ), we can modify

the SVC representation to use non-linear kernel functions. Hence we can adjust how we calculate

"similarity" between two observations. For instance, to recover the SVC we just take K to be as

follows:

p∑

K(x i , x k ) = x ij x kj (19.19)

j=1

Since this kernel is linear in its features the SVC is known as the linear SVC. We can also

consider polynomial kernels, of degree d:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!