models
Calculates valuation, credit risk, quality, and manipulation scores for selected tickers, helping assess intrinsic value and compare companies using ready financial metrics.
Instructions
Pre-computed financial models (WACC, DuPont analysis, Extended DuPont analysis, Enterprise value breakdown, intrinsic value/DCF, Gordon Growth Model, Altman Z-Score, Piotroski F-Score, Beneish M-Score, Economic Value Added (EVA), Present Value of Growth Opportunities, Sustainable Growth Rate, Internal Growth Rate, Graham Number). get_altman_z_score takes model='original' (listed manufacturers, default), 'private' (Z', book equity), 'non-manufacturing' (Z'', no sales term) or 'emerging' (Z''-EM = Z'' + 3.25), each with its own zones. get_taffler_z_score is the UK Taffler z-score (below zero is at risk). get_return_decomposition splits the share price return into EPS growth and P/E change (the multiple), plus dividends for the total return, year over year by default (lag= periods; logarithmic=true for parts that add up; NaN split when earnings are not positive). Valuation: get_reverse_discounted_cash_flow (the growth rate the share price implies, next to the historical growth), get_earnings_power_value (Greenwald's no-growth value), get_h_model (Fuller-Hsia dividend discount model with growth declining from high_growth_rate to stable_growth_rate), get_two_stage_dividend_discount_model (transition_periods= makes it three-stage), get_justified_multiples (justified trailing/leading P/E and P/B, next to the actual multiples), get_intrinsic_valuation with historical=true (the DCF value for every period), get_monte_carlo_intrinsic_valuation (percentiles of the DCF value and the probability it exceeds the price) and get_peer_comparison (valuation, margins, returns, growth and leverage against the company's peers, or peers={'AAPL': ['MSFT', 'GOOGL']}). The valuation models need no inputs: the required return defaults to each company's cost of equity (CAPM with its country's equity risk premium) and the discount rate of the DCFs to its WACC; the dividend models grow at the dividend per share growth (CAGR), the DCFs at the reinvestment rate times the return on capital, and the stable (perpetual) growth is that growth kept within 0 and 2.5%. Values per period use the rates and growth known at each period end. A company (or period) whose rate does not exceed its stable growth is left out. rate_of_return=, growth_rate= and the like override them, as one number or one per ticker ({'AAPL': 0.08}). Credit: get_merton_distance_to_default (Merton/KMV asset value, distance to default and probability of default per year), get_campbell_hilscher_szilagyi_score (Campbell-Hilscher-Szilagyi failure probability from accounting and market data: the monthly probability of failing 12 months ahead, with its eight variables, measured on each fiscal period end) and get_synthetic_credit_rating (Damodaran's rating, default spread and cost of debt from interest coverage). Quality and manipulation scores: get_magic_formula (Greenblatt ranking across the tickers given), get_mohanram_g_score (relative to the tickers given, so pass peers), get_quality_score (Quality Minus Junk: z-scores of profitability, growth, safety and payout ranked across the tickers given, at least three; growth_years= sets the growth window, so use an earlier start_date), get_dechow_f_score, get_montier_c_score and get_accruals_ratio (Sloan). weighted_average_cost_of_capital= defaults to each company's latest WACC. Requires tickers='AAPL' — use comma-separated values for multiple tickers. Supports quarterly=true and start_date/end_date. basket=true also adds up the tickers into one company, 'Total', whose models are calculated on the summed statements (e.g. the Piotroski F-Score or Altman Z-Score of a group of companies together); the models that value a share stay empty for it and the scores that rank the tickers against each other (Magic Formula, Mohanram G-Score, Quality Score) leave it out. On quarterly data the distress scores (Altman, Taffler, Ohlson, Zmijewski, Springate, Grover, Fulmer, Piotroski, Beneish) use a trailing year by default and compare with the same quarter a year earlier; trailing=1 scores single quarters. get_altman_z_score (with the cut-offs of the model asked for: original 1.81/2.99, private 1.23/2.90, non-manufacturing 1.10/2.60, emerging 4.35/5.85), get_zmijewski_score (0), get_springate_score (0.862) and get_taffler_z_score (0) add a Zone row per ticker, 'Distress', 'Grey' or 'Safe'; zone=false leaves it out. get_factor_analysis: factor analysis (predictive power) of the models across tickers: do the tickers that score high on one go on to return more than those that score low? Needs tickers= with at least ten, preferably twenty or more tickers. metrics= a model name, a comma-separated list, or a collection: 'scores' (default: Piotroski, Altman Z, Beneish M, Ohlson O, Zmijewski, Springate, Grover, Fulmer H, Taffler z, Campbell-Hilscher-Szilagyi, Dechow F, Montier C and Mohanram G) or 'all' (adds accruals ratio, Tobin's Q, growth rates, magic formula, Merton distance to default); column= picks a component instead of the score. Returns a row per metric and horizon: the mean information coefficient (IC, the Spearman rank correlation between the metric and the later returns), its standard deviation, IC information ratio, t-statistic, p-value, share of positive periods, number of periods, the Top Minus Bottom quantile spread, quantile turnover and rank autocorrelation. detail='information_coefficient', 'quantile_returns', 'quantile_turnover' or 'rank_autocorrelation' returns that part per period (or per quantile) for a single metric. period= sets how often it is evaluated (monthly by default), horizons= the periods ahead (e.g. 12 or [1, 12]), quantiles= the number of quantiles (5). Other parameters (e.g. trailing=) pass to the models. The IC is reported as measured: a negative IC means low scores go on to outperform. Scores apply from the fiscal period end, so there is no look-ahead.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"indicator": "<indicator>"
},
"name": "models"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lag | No | Number of periods to lag when computing growth rates. Leave unset to use the default of the indicator you selected. Defaults differ between indicators. | |
| rank | No | true ranks the tickers (or countries) within every period, from the highest value (rank 1) to the lowest, and compares each with its neighbour toward the middle of the ranking: the Difference (in points for returns) and the Multiple (only when both have the same sign), so the first and last rank show how far the best and the worst stand apart, e.g. a fall more than twice as large as the next one. Needs a value per period and ticker; pick one field with show_columns where there are more. | |
| seed | No | The seed of the random numbers, so that results can be reproduced. | |
| zone | No | Whether to add a "Zone" row per ticker: "Distress" below Springate's cut-off of 0.862, "Safe" from it. Not with growth or standardize. Leave unset to use the default of the indicator you selected. Defaults are True for get_altman_z_score, get_springate_score, get_taffler_z_score, get_zmijewski_score. | |
| limit | No | The rows to return, like head and tail: 5 for the first five, -5 for the last five (the most recent of a time series). A table with its periods as columns (financial statements, ratios) keeps its first or last periods instead, and rows per ticker (an earnings calendar) are selected per ticker. For ETF holdings the largest (or, negative, the smallest) by weight, and for a list (e.g. news or a screener) its length. 0 returns every row. | |
| model | No | The model to use: "original" (listed manufacturers, market value of equity), "private" (Z', book value of equity), "non-manufacturing" (Z'', book value of equity, no sales term) or "emerging" (Z''-EM, Z'' plus 3.25). | original |
| peers | No | The peers per ticker, e.g. {"AAPL": ["MSFT", "GOOGL"]}. | |
| basket | No | Also analyse the tickers as one company, 'Total': its statements are the sums of theirs and its ratios are calculated on those sums (per-share figures stay empty). | |
| column | No | The price column to use, e.g. 'Close' or 'Adj Close'; for get_factor_analysis the output of a metric with several, e.g. 'Signal Line'. | |
| detail | No | get_factor_analysis only: 'information_coefficient', 'quantile_returns', 'quantile_turnover' or 'rank_autocorrelation' returns that part for a single metric instead of the summary. | |
| growth | No | Return period-over-period growth rates instead of absolute values. | |
| period | No | Observation frequency, e.g. 'daily', 'weekly', 'monthly', 'quarterly', or 'annual' (supported values differ per method). | monthly |
| diluted | No | Whether to use the diluted Earnings per Share. | |
| metrics | No | get_factor_analysis only: the metric(s) to analyse, a method name such as 'get_price_to_earnings_ratio', a comma-separated list, or a collection of the tool (see the tool description), e.g. 'profitability'. | scores |
| periods | No | For get_earnings_power_value: The number of periods the operating margin and tax rate are averaged over; with `trailing`, the number of trailing sums, `trailing` calendar periods apart so that they do not overlap, counted back from the latest reported one. A sum that includes a missing period is left out of the average. For get_intrinsic_valuation: The number of periods to use for the cash flow projections. For get_monte_carlo_intrinsic_valuation, get_reverse_discounted_cash_flow: The number of projection periods. | |
| tickers | No | Comma-separated ticker symbols, e.g. 'AAPL,MSFT,GOOGL'. | |
| end_date | No | End of the date range in YYYY-MM-DD format; left empty, today (or the indicator's own window). | |
| horizons | No | The number of periods the forward returns cover. | |
| trailing | No | Trailing window size in number of periods. Sums the raw values over the trailing N periods (e.g. trailing=4 on quarterly data gives a trailing-4-quarter / TTM-style sum) instead of returning one value per period. | |
| firm_type | No | The table to use: "large" (market capitalization above five billion), "small" (smaller and riskier firms), "financial" (banks and other financial firms) or "auto", which picks large or small from the market capitalization of every period. | auto |
| indicator | Yes | Name of the specific metric to calculate, one of the listed values. Required — search_metrics finds the indicator (and its tool) for a metric by name. | |
| quantiles | No | The number of quantiles the tickers are sorted into per period. | |
| quarterly | No | Return quarterly data instead of annual when True. | |
| historical | No | Whether to value every period instead of only the most recent one, which gives the intrinsic value per share over time. Each period is valued from the base cash flow ending in it and the cash, debt and shares reported at its end. | |
| start_date | No | Start of the date range in YYYY-MM-DD format; left empty, five years before today (or the indicator's own window). | |
| growth_rate | No | Assumed constant growth rate as a decimal. | |
| logarithmic | No | Whether to return log returns, which add up, instead of simple returns, which multiply. | |
| simulations | No | The number of simulations. | |
| standardize | No | Return the Z-Score (standard score) instead of the raw values, i.e. how many standard deviations each value is from the mean of its own series. When combined with growth=True, the growth values are standardized instead of the raw values. | |
| growth_years | No | The number of years over which the growth and the earnings volatility are measured. | |
| show_columns | No | Comma-separated names to filter the output. For historical data use the key names visible in any response record (e.g. 'Close,Volume,Return'). For financial statements use the 'metric' field values from the response (e.g. 'Revenue,Net Income,EBITDA'). Call the tool once without this parameter to see all available names, then repeat with show_columns to reduce response size and token usage. | |
| time_horizon | No | The horizon in years over which default is measured. | |
| periods_apart | No | The number of periods between the dates the quantile turnover and the rank autocorrelation compare. | |
| cash_flow_type | No | For get_intrinsic_valuation: The type of cash flow to use for the cash flow projections. The other options are "Free Cash Flow" and "Operating Cash Flow" as reported on the cash flow statement; both are after interest, so discounting them at the WACC and subtracting the debt counts the cost of debt twice. For get_monte_carlo_intrinsic_valuation, get_reverse_discounted_cash_flow: The cash flow to project: "Free Cash Flow to Firm" (see `get_free_cash_flow_to_firm`), the cash flow to debt and equity holders that the WACC discounts into an enterprise value; or "Free Cash Flow" or "Operating Cash Flow" as reported, which are after interest (cash flows to equity), so that... | Free Cash Flow to Firm |
| rate_of_return | No | The required rate of return, one number, or a list or dict with a rate per ticker. | |
| risk_free_rate | No | The US Treasury yield used as the risk-free rate: '13w' (the 13-week bill), '5y', '10y' (default) or '30y'. | 10y |
| calculate_daily | No | Whether to calculate the PVGO using daily historical data. | |
| project_periods | No | The number of years to project the intrinsic value for, beyond the last complete period. | |
| benchmark_ticker | No | Ticker used as the market benchmark, e.g. 'SPY' or '^GSPC'; 'None' for no benchmark. | SPY |
| high_growth_rate | No | For get_h_model: The growth rate of the dividends at the start of the decline. For get_two_stage_dividend_discount_model: The constant growth rate applied to dividends during the explicit high-growth phase. Can be one number to use for all tickers, or a list or dict that contains a high growth rate for each ticker. | |
| variance_periods | No | The number of yearly values the variances of G4 (return on assets) and G5 (revenue growth) are calculated over, of which at least three (or all, when fewer are asked for) must be available. With `trailing` the values are `trailing` periods apart (one a year with 4 quarters); without it, one per... | |
| include_dividends | No | Whether to deduct Preferred Dividends Paid from Net Income when calculating the Earnings per Share, so that the earnings figure reflects what is attributable to common shareholders only. | |
| show_full_results | No | Whether to show the full results or just the WACC values. | |
| stable_growth_rate | No | For get_h_model: The growth rate the decline ends at, which holds forever after it. For get_two_stage_dividend_discount_model: The perpetual (terminal) growth rate applied to dividends from the end of the high-growth phase onward. Can be one number to use for all tickers, or a list or dict that contains a stable growth rate for each ticker. | |
| transition_periods | No | The number of years in which the growth rate declines linearly from the high to the stable growth rate (the Three-Stage Dividend Discount Model). | |
| high_growth_periods | No | For get_h_model: The number of years over which the growth rate declines from the high to the stable rate. For get_two_stage_dividend_discount_model: The number of years in the explicit high-growth phase. Leave unset to use the default of the indicator you selected. Defaults are 10 for get_h_model; 5 for get_two_stage_dividend_discount_model. | |
| market_risk_premium | No | The annual equity risk premium the Cost of Equity uses. | |
| perpetual_growth_rate | No | Terminal (perpetual) growth rate used in DCF models. Leave unset to use the default of the indicator you selected. Defaults are None for get_intrinsic_valuation, get_monte_carlo_intrinsic_valuation; 0.025 for get_reverse_discounted_cash_flow. | |
| growth_rate_volatility | No | The standard deviation of the growth rate. | |
| perpetual_growth_rate_volatility | No | Its standard deviation. | |
| weighted_average_cost_of_capital | No | WACC as a decimal, e.g. 0.09 for 9 %. | |
| weighted_average_cost_of_capital_volatility | No | Its standard deviation. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |