*Please read Part I for an introduction.*

Earlier, we saw that a 3rd degree polynomial kernel produced the best results on the test set. In this post, we explore if we can we get better results by tuning the degree parameter.

### Outline

- Use 1-, 2-, 5- and 10-week returns of DTWEXM to train an SVM using a polynomial kernel on subsequent 1-week returns of the NIFTY 50
- Consider two datasets: one between the years 2000 and 2018 and the other between 2005 and 2018
- Divide the dataset into training/validation/test sets in a 60/20/20 ratio
- Use the validation test to tabulate out-performing degree parameters
- Plot the cumulative return of a long-only, long-short and buy&hold NIFTY 50 strategy based on SVM predictions on the test set

### Results

We find that there is no single degree parameter between the two datasets (#2 above) that consistently outperforms.

Here are the cumulative return charts for the best performing parameter:

**2000-2018 dataset (8)**

**2005-2018 dataset (4)**

While the first model (using the 2000-2018 dataset, 8th degree polynomial) failed to “predict” the 2018 correction in the NIFTY 50, the second one (2005-2018 dataset, 4th degree polynomial) seems to be able to side-step it. However, an SVM tuned with the 4th degree polynomial on the 2000-2018 dataset again failed to side-step the 2018 correction, indicating that we need to look more closely on how we choose our dataset – sometimes going too far back in time is counter-productive because the world changes.

### Next Steps

In the next post, we will train a polynomial SVM with the other dollar indices (DTWEXB and DTWEXO) and USDINR (DEXINUS) and tabulate their predicted returns over different degrees.

Code and charts for this post are on github.

Comments are closed, but trackbacks and pingbacks are open.