Factor analysis (predictive power) of the performance metrics, or of a factor of your own: whether the tickers that score high on a metric go on to return more than those that score low. Per period, the information coefficient (IC) is the Spearman rank correlation between the metric of the tickers in the period and their return over the following horizon: 1 means the metric 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 metric 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 metric from one period to the next. With detail, it returns one of those parts per period (or per quantile) for a single metric.

Each metric is measured within each period (e.g. the volatility of a month’s daily returns) and compared with the returns from the close of the period’s last trading day onwards, using the dividend and split adjusted close, so a metric never overlaps the returns it is compared with. Each ticker keeps its own history: a ticker without a value or a return in a period is left out of that period only.

A factor of your own is a DataFrame with the dates as index and the tickers as columns, applied from each date on, or with the tickers as index and periods as columns, applied from the end of each period. Make sure each value was known on the date it is given for, or the analysis looks ahead.

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",
)

# Momentum: the return over the previous twelve months, without the latest month.
prices = toolkit.get_historical_data()["Adj Close"]
momentum = (prices.shift(21) / prices.shift(252) - 1).drop(columns="Benchmark")

toolkit.performance.get_factor_analysis(momentum, horizons=[1, 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
(‘Custom Factor’, ‘1 Month’) 0.0178 0.3743 0.0476 0.4923 0.6235 0.4953 107 0.004 0.2391 0.8822
(‘Custom Factor’, ‘12 Months’) 0.1121 0.419 0.2675 2.6214 0.0102 0.5729 96 0.0195 0.2391 0.8822

Parameters

get_factor_analysis accepts the following parameters.

ParameterTypeDescriptionExample
metricsstr | list[str] | pd.DataFrameA performance method name with a value per ticker and period, e.g. “get_sharpe_ratio”, a list of them, “all”, or a factor of your own as a DataFrame. “all” holds the returns, excess return, beta, Sharpe, Sortino, Treynor and information ratios, tracking error, Jensen’s alpha, Calmar and Omega ratios and the win rate.
periodstrThe frequency at which the metrics are measured and evaluated: weekly, monthly, quarterly or yearly. Each metric is calculated within each period from that period’s daily returns, so use monthly or longer for enough returns per period. 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 metric 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 | NoneThe output to use of a metric with several. Defaults to None, which uses the first."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 metrics that take them, e.g. alpha=0.05.2
Share