liveBook · Manning

Cyclically adjusted price-to-earnings ratio

As explained in Build a Robo-Advisor with Python (From Scratch)

A stock valuation ratio that divides price by inflation-adjusted average earnings over the prior ten years.

The cyclically adjusted price-to-earnings ratio (CAPE) values stocks using inflation-adjusted earnings averaged across the prior ten years. This smooths business-cycle fluctuations that can distort a standard P/E ratio based on recent earnings. section 3.1.3

A practical CAPE workflow:

  • Download annual adjusted returns for the S&P 500 proxy VFINX. section 3.1.3
  • Read Robert Shiller’s CAPE spreadsheet, convert its year-month values into dates, and resample observations annually. section 3.1.3
  • Calculate annual CAPE changes and regress excess stock returns on those changes using ordinary least squares. section 3.1.3

Estimating valuation-adjusted stock returns

Align annual VFINX returns, risk-free rates, and CAPE observations on common dates, then estimate the relationship between excess returns and percent changes in CAPE. section 3.1.3

How Build a Robo-Advisor with Python (From Scratch) covers it

How deep it goes
Defines CAPE and implements annual data preparation and OLS regression, without detailing broader valuation interpretation.
Examples
Uses VFINX returns, Robert Shiller’s CAPE spreadsheet, annual resampling, and CAPE-change regression.
What it assumes
Assumes basic stock returns, risk-free rates, tabular data, and regression while defining CAPE’s construction.
What you can do after
Apply it via pandas, yfinance, pandas-datareader, and statsmodels to construct CAPE data and estimate return relationships.
How it connects
Links P/E ratios, inflation adjustment, business cycles, S&P 500 returns, risk-free rates, and ordinary least squares.

Also explained in

Compare how 2 books explain cyclically adjusted price-to-earnings ratio →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Build a Robo-Advisor with Python (From Scratch). The section links point to the parts of the book it draws on.