Hello,
welcome back to Papers with Backtest podcast.
Today we dive into another algo trading research paper.
We do indeed.
We're going to unpack deep learning for forecasting stock returns in the cross-section by Abe and Nakayama from 2018.
A really interesting one.
Yeah,
this paper looks into whether using deep learning can,
you know,
give us a better edge predicting Japanese stock performance over the next month.
Exactly.
It's fundamentally asking,
can these newer,
more complex machine learning tools actually
beat the traditional methods,
especially for forecasting returns.
Right.
So for you listening,
the goal today is figuring out if this deep learning approach really is a better way to predict stock moves compared to older methods and,
well,
other ML techniques too.
Yeah,
we're going to really focus on what this means for building actual trading rules and strategies,
and importantly,
the backtest results the authors found.
Okay,
so first things first,
what data were they using?
They used a pretty solid data set.
It was constituents of the MSCI Japan Index.
And they looked at 25 different factors.
You know,
the usual suspects,
book-to-market ratio,
earnings-to-price,
past returns,
like the last month's return.
Just standard factors mostly.
Pretty standard,
yeah.
Yeah.
Listed in their table one.
And the data covered a decent timeframe,
December 1990 through November 2016.
That's quite a stretch.
Now,
I saw something about a lag,
a four-month lag.
Yeah.
Yes.
That's quite important.
They built in a four-month delay.
Why is that?
Well,
it's about realism.
The idea is even if data is released,
it takes time for investors to actually get it,
digest it,
and act on it.
So this lag tries to mimic that real-world delay.
Makes sense.
So the core problem was predicting next month's return.
Using those 25 factors,
but not just the latest values,
they looked at the factors from the last five time points.
Five points.
How far apart?
Three-month intervals.
So looking back over what,
about 15 months of factor history?
Okay,
so capturing some trend information potentially,
and they pre-processed the data.
They did.
They rescaled both the inputs,
the factors,
and the outputs,
the returns,
by ranking them.
Yeah,
ranking across all the stocks at each point in time.
Kind of normalizes things,
helps the models focus on relative performance rather than absolute values.
Got it.
Okay,
let's get to the good stuff.
The trading rules and the back tests.
They looked at different neural network setups.
They did.
They compared deep neural networks,
DNNs,
with eight layers,
DNN8.
and five layers DNN5.
Against shallower ones.
Yeah,
exactly.
Against a three-layer network,
NN3.
And they tested that
NN3 both with and without something called dropout.
Ah,
dropout.
That's for preventing overfitting,
right?
Precisely.
It randomly ignores some connections during training,
makes the network a bit more robust,
hopefully less likely to just memorize the training data.
So what did they find when they compared these deep versus shallow networks?
How did they perform?
Well,
looking at their tables four and five,
the general trend was
Deeper seemed better.
More layers,
better predictions.
Generally,
yes.
Performance measured by rank correlation,
they called it ERR and directional accuracy,
tended to improve as the networks got deeper.
And COERA is?
Rank correlation.
Basically,
how well the model's predicted ranking of stocks matches the actual ranking based on future returns.
Higher is better.
And directional accuracy?
Simply,
the percentage of times the model correctly guessed if a stock would go up or down relative to the median.
Okay.
And interestingly,
even shallow networks with a similar number of parameters didn't quite match up to the DNNs.
So it wasn't just about the number of knobs to turn,
but the structure?
It seems that way.
The depth itself appeared to add value.
Right.
And the directional accuracy was statistically significant for all the network types,
which is encouraging.
Suggests they were definitely picking up something.
Right.
And the mean squared error,
the loss function,
was generally lower for the deeper networks too.
Which...
Specific models did best.
I see DNN83 mentioned for CR.
Yeah,
DNN83 hit the highest CR at 0.0591.
Now,
0.0591,
that sounds quite small.
It does,
but in this field,
forecasting cross-sectional returns,
even a small consistent edge like that can be meaningful.
It's notoriously difficult.
Okay,
fair enough.
And the directional accuracy for that model?
For DNN83,
it was about 52.6%
for tertiles,
splitting stocks into three groups.
And a bit better,
53.4%
roughly for quintiles,
so five groups.
Still only slightly better than a coin flip,
but statistically significant,
you said.
Exactly.
Better than chance,
consistently.
Okay,
so DNNs show promise,
but they compared them to other ML methods too.
They did,
yeah.
Crucial comparison point.
They used support vector regression,
SVR,
and random forests RF as benchmarks.
Pretty standard powerful ML techniques.
And did they tune those models properly?
Seems so.
They mentioned testing 24 different setups for SVR and 37 for random forests to try and find the best configuration for each.
So what were the best results for SVR and RF?
For SVR,
the best TOR was around 0.0569 directional accuracy,
similar to the DNN,
so maybe slightly lower,
around 52.5%
and 53.3%.
And random forests?
RF did a bit better on TOR,
0.0576.
Directional accuracy was quite close to the best DNNs,
actually,
around 52.6%
and 53.4%.
Okay,
so RF looks pretty competitive there.
How did the DNN stack up overall against these?
This is where it gets interesting.
Several of the top DNN patterns,
like DNN 81,
83,
84,
and 51,
they generally outperformed SVR on most metrics.
And against random forests,
it was closer.
But some DNNs showed slight advantages,
especially in TRR.
Specifically,
DNN84 actually beat the best RF model on all the metrics in their comparison table,
table six.
Really?
So a specific deep learning setup actually pulled ahead of a well-tuned random forest.
In their tests,
yes.
It suggests maybe the deep networks were better at capturing some complex,
nonlinear stuff in the data that even RF couldn't quite get.
Fascinating.
OK,
prediction accuracy is one thing,
but what about actual trading?
Did they simulate a strategy?
They did.
A classic long-short portfolio.
How did that work?
Simple idea.
Use the model's predictions to rank the stocks.
Buy the top-ranked ones,
sell the bottom-ranked ones.
Equal weighting.
OK.
And they looked at turtle and quintile portfolios again?
That's right.
Splitting the stocks into three groups or five groups based on the predictions.
One important caveat,
though.
Let me guess.
Transaction costs.
You got it.
They didn't include transaction costs in this simulation,
so real-world results would likely be lower.
Understood.
But still,
what did the simulated performance show?
The return versus risk?
That's the key metric,
right?
The return-risk ratio.
Looking at Table 8,
the highest RR ratios,
both for Turtle and Quintile portfolios,
came from the DNN models.
Ah,
okay.
Which ones?
DNN83 had the best RR for the turtle portfolio at 1.24,
and DNNN51 topped the quintile portfolio with 1.29.
So the deep learning models deliver the best risk-adjusted returns in simulation.
That's what their results suggest.
And what's interesting is,
remember,
random forests sometimes had slightly higher directional accuracy.
Yeah.
Well,
despite that,
some DNNs had better risk-adjusted returns.
It implies maybe the DNNs were better at predicting the magnitude of the returns for the winners and losers,
not just the direction.
That makes a difference for portfolio performance.
Absolutely.
Did they try combining models and an ensemble?
Yes,
briefly.
They combined the best SVR,
RF,
and their top DNN,
DNN83,
with equal weights.
Ensembles often boost performance,
right?
Often,
yeah.
The idea is different models capture different things.
In this case,
the ensemble did get the highest
COR.0604, so slightly better rank prediction.
But what about the trading simulation,
the RR?
That's the interesting part.
According to Table 8,
the improvement in directional accuracy and,
crucially,
the return risk ratio was pretty limited compared to the best individual DNNs.
So the ensemble didn't quite deliver the knockout punch in terms of risk-adjusted returns here.
Not in this specific setup,
no.
The best individual DNNs still held the top spots for RR.
Okay,
so let's try to summarize the takeaways on the trading rules and backtests.
It seems like deeper networks generally did show an advantage here.
Yeah,
that seems to be the main thrust.
Deeper networks generally perform better than shallower ones for predicting Japanese stock returns in this cross-sectional study.
And they held their own or even slightly outperformed standard ML techniques like SVR and random forests.
Right.
Particularly when looking at the simulated long-short trading performance.
Yeah.
The DNN-based strategies yielded the highest risk-adjusted returns.
Even though the ensemble improved correlations slightly.
It didn't beat the best individual DNNs on that key
RR metric.
Correct.
It suggests that maybe just averaging those specific models wasn't the optimal way to combine them.
Or perhaps the individual DNNs were already capturing most of the predictable signal effectively.
Now,
the authors did mention limitations,
right?
Like focusing on standard feedforward networks.
They did.
They pointed out that things like recurrent neural networks,
RNNs,
might be interesting to explore because they're specifically designed for time series data.
Which stock factors often are,
even if used cross-sectionally here.
Exactly.
And they also suggested just exploring a wider range of deep learning architectures in general.
There's a lot more out there now than there was even in 2018.
So there's definitely room for more research,
maybe exploring how these models handle different market regimes or incorporating transaction costs more explicitly.
Absolutely.
And I think a key question going forward is always,
how much of this improved performance is genuinely capturing economic signal?
versus potentially overfitting complex patterns that might not persist,
it's the perennial challenge.
A very important point.
It leaves us wondering how robust these deep learning advantages truly are over the very long term.
Definitely food for thought.
Okay,
well that wraps up our deep dive for today.
Thank you for tuning in to Papers with Backtest podcast.
We hope today's episode gave you useful insights.
Join us next time as we break down more research.
And for more papers and backtests,
find us at https.paperswithbacktest.com.
Happy trading.