stereotypical cat lady who loves to read and pet all the cats in the world.

Machine Learning In Asset Pricing by Stefan Nagel

Machine Learning In Asset Pricing by Stefan Nagel

So it took me a while to finish reading and organizing my notes for this book. I found it useful, so I took the time to pull out a few takeaways that I think are valuable, hopefully this would spark your interest in picking up this copy. Even without a coding background, once one understand the core concepts, one can use AI to assist in model building.

I was initially in doubt whether I could get anything out of Stefan Nagel’s Machine Learning in Asset Pricing. The title sounds like the sort of book that might either drown you in equations or promise that an algorithm can beat the market..which is my biggest pet peeves. Luckily, it does neither.

What the book actually asks is much more interesting: how should machine learning change when the thing being predicted is an asset price?

What I find interesting in this book is that Nagel does not treat finance as just another machine learning problem. In many ML applications, the objective seems fairly straightforward: feed a model enough information, identify patterns, minimize prediction error, and test whether the model works on new data. Nice and tidy.

Bad news is investors do not simply sit there while an algorithm discovers a profitable pattern. They trade on it. Their trades move prices. (and sometimes 敵不動我不動,敵一動我亂動, I can’t find an English phrase that is as accurate as this mandarin expression…) Those price changes can then weaken the exact relationship the model just discovered.

So Nagel’s central point is not really “machine learning is purrrfect, let us use more of it.” It is closer to: machine learning is useful, but financial markets have enough quirks that you cannot just throw a giant algorithm at the data and call it a day.

Modern financial datasets contain an almost ridiculous number of possible predictors: past returns, valuation ratios, profitability, investment, leverage, volatility, liquidity, firm size, and many more. Traditional asset-pricing research often looked at these variables individually or in relatively small groups. Machine learning lets researchers consider many of them at once.

A basic return-prediction model might look like this:

r̂ᵢ,ₜ₊₁ = β₀ + β₁Mᵢ,ₜ + β₂Vᵢ,ₜ + β₃Pᵢ,ₜ

where M is momentum, V is value, and P is profitability.

Suppose:

r̂ = 0.002 + 0.04M + 0.03V + 0.02P

and a stock has:

M = 1.2
V = 0.5
P = 0.8

Then:

r̂ = 0.002 + 0.04(1.2) + 0.03(0.5) + 0.02(0.8)

= 0.081

so:

r̂ = 8.1%

The calculation itself is easy. The much harder question is deciding which variables deserve to be in the model in the first place, what the β coefficients should be, and whether the relationship is real.

This is where the famous “factor zoo” comes in.

Over the years, researchers have identified hundreds of characteristics that supposedly predict returns. Some probably capture genuine risk or investor behavior. Some are basically cousins of one another wearing different outfits. And some may just be statistical accidents that looked impressive in one dataset.

Machine learning reframes the whole problem as:

E[rᵢ,ₜ₊₁ | Xᵢ,ₜ]

where Xᵢ,ₜ represents all the information currently available about firm i.

Instead of asking, “Does momentum work?” the question becomes, “Given everything we know about this company, what combination of characteristics actually tells us something useful about future returns?”

I like this shift because it makes the problem feel much closer to how an investor actually thinks. ? You are rarely looking at one number in isolation. Usually what happens in a morning is you read the news and 10,000 things happened at once, you wonder which ones matter in what ways, which ones overlap, and which ones are just noise?

Of course, this is also where the model can get greedy.

Once you give it hundreds of predictors, nonlinear terms, and interactions, it becomes extremely easy to overfit the past. A model can look like a genius simply because it has memorized historical noise.

This is where regularization comes in.

Ordinary least squares minimizes:

∑ᵢ₌₁ⁿ (yᵢ − Xᵢβ)²

Ridge regression adds a penalty:

∑ᵢ₌₁ⁿ (yᵢ − Xᵢβ)² + λ∑ⱼ₌₁ᵖ βⱼ²

The parameter λ controls how aggressively the model punishes large coefficients.

Suppose OLS estimates:

β = (0.09, 0.11, −0.08)

After ridge regularization, those coefficients might become:

βʳⁱᵈᵍᵉ = (0.06, 0.07, −0.04)

In other words, the model is being told: calm the hell down,

I actually found this part surprisingly intuitive. Before reading the book, I thought of a better-fitting model as, well, a better model. Nagel helped me understand why that logic can be completely wrong in finance. A model may fit historical data slightly worse but become much more stable when new data arrive.

I should probably add that I do have some basic understandings of ML, so I was not going into all of this completely cold. That definitely made some of the terminology feel more familiar. Even so, I think Nagel does a good job of making the material digestible for readers who do not already have a technical background.

Which brings us to one of the book’s most useful lessons:

better in-sample fit does not equal better out-of-sample prediction

Or, in less academic language, being incredibly good at explaining yesterday does not mean you have any idea what happens tomorrow.

LASSO takes the same basic idea further. It uses the penalty:

λ∑ⱼ₌₁ᵖ |βⱼ|

and unlike ridge regression, it can push some coefficients all the way to zero.

That matters enormously in the factor zoo. If you have a hundred possible signals, LASSO can effectively say: these three seem useful, the other ninety-seven can go home.

What I like about this section is that Nagel makes regularization feel like a form of humility. The problem with modern financial data is not that we have too little information. It is that we have so much information that, if we try hard enough, we can find a pattern in almost anything.

But this is also where the book becomes more interesting than a standard machine-learning text: prediction accuracy is not enough.

Investors do not ultimately care about whether a model minimizes some abstract statistical error. They care about portfolios.

Suppose two assets have expected returns:

μ = [0.08, 0.12]

and portfolio weights:

w = [0.60, 0.40]

Expected portfolio return is:

E[rₚ] = wᵀμ

= 0.60(0.08) + 0.40(0.12)

9.6%

Lovely.

Except return is not everything. Risk depends on how those assets move together.

If the covariance matrix is:

Σ =
[0.04 0.01]
[0.01 0.09]

then portfolio variance is:

σₚ² = wᵀΣw

and portfolio volatility is:

σₚ = √(wᵀΣw)

This is why a model can predict individual returns reasonably well and still build a terrible portfolio. If all your “great” predictions load onto the same risk, congratulations, you have invented concentration.

This is another idea I found genuinely useful. A model can be statistically impressive and still be financially useless. That sounds obvious once you say it, but it is easy to forget when everyone is obsessing over prediction accuracy.

So one of Nagel’s key points becomes:

statistical accuracy does not equal economic usefulness

A machine-learning model may have excellent forecasting statistics but still be useless to an investor if it produces unattractive risk, covariance, turnover, or portfolio concentration.

This is where financial economics starts bossing machine learning around a little, and frankly it probably needs to.

The book’s discussion of cross-sectional asset pricing pushes this further. Cross-sectional asset pricing asks why some securities earn higher expected returns than others.

Traditional models often assume relatively simple relationships. Machine learning is useful because it can capture interactions between variables.

For example:

E[r] = β₀ + β₁M + β₂V + β₃MV

The term MV means that the effect of momentum depends on value.

Suppose:

β₁ = 0.03
β₂ = 0.02
β₃ = 0.04

For:

M = 1, V = 1

the contribution is:

0.03 + 0.02 + 0.04 = 9%

But for:

M = 1, V = −1

the contribution becomes:

0.03 − 0.02 − 0.04 = −3%

Same momentum signal, completely different implication.

I liked this example because it made the appeal of machine learning in asset pricing much clearer to me. A variable is not always “good” or “bad” in isolation. Its effect can depend on what else is going on around it.

But Nagel is also careful not to confuse prediction with explanation, which is a distinction finance desperately needs tattooed somewhere prominent. Sometimes I’d like to tattoo that somewhere on my arms to remind myself….

Suppose a model discovers that a certain combination of value, profitability, and momentum predicts an extra 4% return.

That gives us:

E[rₜ₊₁ | Xₜ] = rbaseline + 4%

 

But why does the extra 4% exist?

Maybe those stocks are genuinely riskier.

Maybe investors systematically underreact to information.

Maybe institutional constraints stop enough investors from exploiting the opportunity.

Maybe the model has found a proxy for something else entirely.

Maybe I should stop the list here it’s getting too long.

The algorithm can tell us that X predicts r. It does not automatically explain why.

So:

prediction does not equal to explanation

What I find interesting here is that Nagel does not let machine learning off the hook just because it produces a good forecast. “It works” is not the same thing as “we understand it.”

Machine learning is excellent at demonstrating that it has found something.

Financial economics illustrates why should that something exist.

Nagel does not really choose sides. He emphasized the importance of both.

The part I liked the most, though, is when Nagel flips the whole framework around and asks whether machine learning can also describe how investors themselves form beliefs.

Investors observe data, update expectations, and alter portfolios.

Suppose an investor initially expects:

μ₀ = 6%

New information suggests:

μsignal = 10%

If the investor gives equal weight to the prior belief and the new signal:

μ₁ = 0.5μ₀ + 0.5μsignal

= 0.5(0.06) + 0.5(0.10)

8%

So:

6% → 8%

The investor changes her mind.

That revised belief changes how much she wants to own.

And if enough investors do the same thing, their trading changes the price itself.

Which gives us this feedback loop:

Data leads to beliefs… leads to portfolio choice… leads to prices.. leads to new data

or:

Xₜ → Eₜ[rₜ₊₁] → wₜ → Pₜ → Xₜ₊₁

One example I like the most is what happens when a successful prediction starts destroying itself.

Suppose a stock trades at:

P₀ = $100

and investors expect it to be worth:

E[P₁] = $110

Expected return is:

E[r] = [E(P₁) − P₀] / P₀

= (110 − 100) / 100

10%

Now suppose a machine-learning model announces, metaphorically speaking, “Hello, this looks cheap.”

Investors pile in.

The current price rises to:

P₀ = $106

while expected future value remains $110.

Now:

E[r] = (110 − 106) / 106

3.77%

So:

10% → 3.77%

The opportunity has mostly evaporated because people found it.

This was probably the concept that stayed with me the most. In most prediction problems, the thing being predicted does not care that you predicted it. If an algorithm gets better at recognizing cats, the cats do not respond by changing their faces.

Markets absolutely do.

A predictive relationship can therefore contain the seeds of its own destruction:

signal discovered → trading increases → P₀ ↑ → expected return ↓

And that is a fairly elegant explanation for why “I found a backtest with amazing returns” should not immediately be followed by “I want that iPhone 18 Pro it is burgundy colored.”

The book’s six chapters build around these ideas. Nagel begins with supervised learning and the problems of prediction, model complexity, and regularization. He then applies those tools to cross-sectional asset pricing, where large sets of firm characteristics are used to predict differences in expected returns. Later, he changes perspective and treats learning as part of investor belief formation itself, before ending with a broader research agenda linking machine learning and financial economics.

The deeper tension running through the book can be reduced to two questions.

Machine learning asks:

r̂ₜ₊₁ = f(Xₜ)

What function of today’s information best predicts tomorrow’s return?

Financial economics asks:

Why should f(Xₜ) predict rₜ₊₁ in equilibrium?

One asks whether the relationship works.

The other asks why the relationship should exist at all.

I think this is ultimately what I got the most out of. I went into the book wondering whether it would be too technical to be useful unless you were already working in quantitative finance. It certainly has its technical moments, but Nagel’s bigger questions are surprisingly intuitive.

How much should we trust a model?

How do we know whether it has learned a real relationship or just memorized history?

Does a statistically better forecast actually make a better investment?

And what happens when investors start acting on the prediction itself?

Nagel’s answer is basically that we need both machine learning and financial economics. Machine learning can uncover relationships traditional models may overlook. Asset-pricing theory then forces us to ask whether those relationships make sense in terms of risk, portfolio choice, investor beliefs, equilibrium, and market competition.

That is why Machine Learning in Asset Pricing is less about algorithms replacing financial economics and more about making the two tolerate each other.

Its real lesson is not that machine learning will solve asset pricing. Quite the opposite. Asset pricing is precisely the sort of environment that exposes the limits of blindly trusting a model.

The Pleasure of Finding Things Out by Richard Feynman

The Pleasure of Finding Things Out by Richard Feynman