Factor analysis (predictive power) of the ratios: whether the tickers that score high on a ratio go on to return more than those that score low. Per period, the information coefficient (IC) is the Spearman rank correlation between the ratio of the tickers at the end of the period and their return over the following horizon: 1 means the ratio ranks the later returns perfectly, -1 in reverse and 0 that it says nothing about them. The IC measures skill in Grinold and Kahn’s fundamental law of active management, IR ≈ IC × √breadth: a small but consistent IC across many tickers and periods gives a high information ratio.

The summary has a row per ratio and horizon with the mean IC, its standard deviation, the IC information ratio (mean divided by standard deviation), the t-statistic of the mean with its p-value, the share of periods with a positive IC, the number of periods, the top minus bottom spread (the mean forward return of the highest quantile minus that of the lowest), the mean turnover of the top and bottom quantiles and the mean rank autocorrelation of the ratio from one period to the next. With detail, it returns one of those parts per period (or per quantile) for a single ratio.

The ratios are calculated daily from the closing price where they can be (show_daily) and otherwise per statement period. Statement figures apply from the end of each fiscal period, or with point_in_time from the day they were filed, never earlier, so no day uses figures that were not known yet. The returns use the dividend and split adjusted close and start at the close of the period the ratio belongs to. Each ticker keeps its own history: a ticker without a ratio or a return in a period is left out of that period only.

Factor Analysis in Python

Install the Finance Toolkit with:

pip install financetoolkit -U

Then call get_factor_analysis as shown below.

from financetoolkit import Toolkit

toolkit = Toolkit(
    ["AAPL", "MSFT", "GOOGL", "AMZN", "META", "NVDA", "JPM", "JNJ",
     "XOM", "PG", "KO", "WMT", "V", "UNH", "HD", "CVX"],
    api_key="FINANCIAL_MODELING_PREP_KEY",
    start_date="2016-01-01",
    end_date="2025-12-31",
)

toolkit.ratios.get_factor_analysis(
    ["get_price_to_earnings_ratio", "get_price_to_book_ratio", "get_return_on_equity"],
    horizons=12,
)

Which returns:

  Mean IC IC Standard Deviation IC Information Ratio t-Statistic p-Value Positive Share Observations Top Minus Bottom Quantile Turnover Rank Autocorrelation
(‘get_price_to_earnings_ratio’, ‘12 Months’) 0.0265 0.3242 0.0817 0.8174 0.4157 0.55 100 0.0757 0.0931 0.9504
(‘get_price_to_book_ratio’, ‘12 Months’) 0.1122 0.2952 0.38 3.8004 0.0002 0.68 100 0.1655 0.0506 0.9776
(‘get_return_on_equity’, ‘12 Months’) 0.0423 0.3551 0.1191 1.1915 0.2363 0.5 100 0.065 0.0517 0.9671

Parameters

get_factor_analysis accepts the following parameters.

ParameterTypeDescriptionExample
metricsstr | list[str]A ratio method name, e.g. “get_price_to_earnings_ratio”, a list of them, or a collection: “valuation”, “profitability”, “solvency”, “liquidity”, “efficiency” or “all”. Defaults to “valuation”, the price and enterprise value multiples, yields and the market cap. Per-share figures and currency amounts are not in the collections, as their level depends on the share count or company size.
periodstrThe frequency at which the ratios are evaluated: daily, weekly, monthly, quarterly or yearly. Defaults to “monthly”."weekly"
horizonslist[int] | int | NoneThe number of periods the forward returns cover. Defaults to None, which uses about a period, a quarter and a year ahead (1, 3 and 12 months for monthly).None, which uses about a period, a quarter and a year ahead (1, 3 and 12 months for monthly)
quantilesintThe number of quantiles the tickers are sorted into per period. Defaults to 5.[0.05, 0.5, 0.95]
periods_apartintThe number of periods between the dates the quantile turnover and the rank autocorrelation compare. Defaults to 1.1
detailstr | NoneReturns one part of the analysis of a single ratio instead of the summary: “information_coefficient” (per period and horizon), “quantile_returns” (the mean forward return per quantile and horizon), “quantile_turnover” (per period and quantile) or “rank_autocorrelation” (per period). Defaults to None.None
columnstr | NoneNot used by the ratios, which have one value per ticker; it exists for the modules whose metrics have several outputs. Defaults to None."Return"
roundingint | NoneThe number of decimals to round the results to. Defaults to None, which uses the Toolkit’s rounding. **kwargs: Parameters passed to the ratios that take them, e.g. trailing=4 or diluted=False.2
Share