We discuss the model details below, but based on training data going back to 1958, the model error rate is 6.59%. The error rate is defined as the number of months where the forecast was incorrect divided by the total number of months in the sample.

The model is currently forecasting NO RECESSION. The probabiliby of a recession next month is currently 6%.

The backtest measures the accuracy of the SVM predictions versus the actual recession markers as determined by the NBER.

From an investment strategy standpoint, we go long the S&P 500 when a recession is not forecasted and switch to cash when a recession is forecasted. This provides a modest outperformance versus a buy and hold strategy, as shown in the table below.

strategy_ret | actual_ret | ret | |
---|---|---|---|

Annualized Return | 0.09 | 0.10 | 0.08 |

Annualized Std Dev | 0.14 | 0.13 | 0.15 |

Annualized Sharpe (Rf=0%) | 0.70 | 0.76 | 0.55 |

StdDev Sharpe (Rf=0%, p=95%): | 0.21 | 0.23 | 0.17 |

VaR Sharpe (Rf=0%, p=95%): | 0.14 | 0.15 | 0.11 |

ES Sharpe (Rf=0%, p=95%): | 0.08 | 0.09 | 0.07 |

Worst Drawdown | 0.36 | 0.31 | 0.53 |

Semi-Deviation | 0.03 | 0.03 | 0.03 |

`strategy_ret`

is the return from following our forecast, `actual_ret`

is the (theoretical) return one could achieve investing with the NBER decision. The returns in the `actual_ret`

are theoretical because they are not actually achievable since the NBER does not declare recessions until many months after the recession has started, but it shows us the best case scenario. The last column, `ret`

, shows the buy and hold return of the S&P 500.

This strategy increases the Sharpe ratio from 0.551 to 0.7, which is pretty close to the theoretical max of 0.759.

The full R code is available on Github.

The sample data will automatically load and be stored in the object `dat`

. Here are the important variables.

`fwdstate`

is 1 if the next month is in a recession and -1 otherwise. The model is `fwdstate ~ payems + sp500 + yld_curve + man_prod`

where each of the four independant variables includes the current value plus the most recent 11 lagged months, for a total of 48 variables.

- Recessions periods are from the NBER.
`payems`

is total nonfarm employees from ALFRED.`sp500`

is the S&P 500 monthly closing price.`yld_curve`

is GS10 - FEDFUNDS from FRED.`man_prod`

is the Manufacturing Production Index as published by the Institute for Supply Management downloaded from Quandl.

Importantly, there is a lag of 12 months on the data used to forecast recession (the `fwdstate`

variable), so that there is no look ahead bias.

This code was inspired by Nowcasting Recessions using the SVM Machine Learning Algorithm by James, Abu-Mostafa, and Qiao. Available on SSRN at https://ssrn.com/abstract=3316917.