Skip to main content
Glama

Haircut Sharpe ratio

validate_haircut_sharpe

Adjust an observed Sharpe for multiple testing by computing Bonferroni, independent-test, Holm, and BHY haircuts, so you can see the Sharpe a single test would need.

Instructions

Haircut Sharpe for multiple testing (Harvey and Liu 2015): the Sharpe a single test would have needed, by Bonferroni and independent tests, and with the other tests' Sharpes, Holm and BHY. For the probability the Sharpe is real, use validate_deflated_sharpe. A deflated Sharpe or overfitting probability above or below any threshold is not admission to anything and is not a forecast.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
testsNoTests run, this one included; gives the Bonferroni and independent-test haircuts.
observationsYesReturn observations behind the Sharpe.
autocorrelationNoLag-1 autocorrelation of returns, -1 to 1; default 0. Corrects the annualized Sharpe (Lo 2002).
periods_per_yearYesPeriods per year: 252 daily, 365 crypto, 52 weekly, 12 monthly.
observed_sharpe_annualizedYesAnnualized Sharpe as observed.
other_sharpe_ratios_annualizedNoAnnualized Sharpes of the other tests over the same observations; adds Holm and BHY.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
dataNo
noteNo
errorNo
limitsNo
receiptNo
computedNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changedv0.13.0
    • removedOutput schema / additionalProperties
      Removed value: -{}
    • removedOutput schema / properties / data / additionalProperties
      Removed value: -{}
    • changedOutput schema / properties / error / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": {},
      -    "properties": {},
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "properties": {},
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • changedOutput schema / properties / receipt / anyOf
      Previous value: -[
      -  {
      -    "additionalProperties": {},
      -    "properties": {},
      -    "type": "object"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "properties": {},
      +    "type": "object"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
  2. Changed7 schema fields changedv0.10.1
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedInput schema / properties / autocorrelation / description
      Previous value: -"First-order autocorrelation of the returns, -1 to 1; default 0. Corrects the annualized Sharpe as Lo (2002)."New value: +"Lag-1 autocorrelation of returns, -1 to 1; default 0. Corrects the annualized Sharpe (Lo 2002)."
    • changedInput schema / properties / observations / description
      Previous value: -"Number of return observations behind the Sharpe ratio."New value: +"Return observations behind the Sharpe."
    • changedInput schema / properties / other_sharpe_ratios_annualized / description
      Previous value: -"Annualized Sharpe ratios of the other tests, over the same observations; adds the Holm and BHY haircuts."New value: +"Annualized Sharpes of the other tests over the same observations; adds Holm and BHY."
    • changedInput schema / properties / periods_per_year / description
      Previous value: -"Observations per year: 252 daily, 365 daily crypto, 52 weekly, 12 monthly."New value: +"Periods per year: 252 daily, 365 crypto, 52 weekly, 12 monthly."
    • changedInput schema / properties / tests / description
      Previous value: -"Total tests run, this one included; gives the Bonferroni and independent-test haircuts."New value: +"Tests run, this one included; gives the Bonferroni and independent-test haircuts."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "https://json-schema.org/draft/2020-12/schema",
      +  "additionalProperties": {},
      +  "description": "data.result holds the statistics (data.plain_reading states them); limits say what the result does not establish; receipt ({id, url}) is the signed record, null when none was stored; error ({code, message}) is set only on refusal.",
      +  "properties": {
      +    "computed": {
      +      "type": "string"
      +    },
      +    "data": {
      +      "additionalProperties": {},
      +      "properties": {},
      +      "type": "object"
      +    },
      +    "error": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {},
      +          "properties": {},
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    },
      +    "limits": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    "note": {
      +      "type": "string"
      +    },
      +    "receipt": {
      +      "anyOf": [
      +        {
      +          "additionalProperties": {},
      +          "properties": {},
      +          "type": "object"
      +        },
      +        {
      +          "type": "null"
      +        }
      +      ]
      +    }
      +  },
      +  "type": "object"
      +}
  3. Addedv0.6.0

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=true, so the safety profile is covered. The description adds interpretive context — that threshold crossings are not 'admission to anything' and not a forecast — which is genuinely useful caveating. It says nothing about computational behavior such as determinism, limits, or failure modes beyond the schema's bounds.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with what the tool computes, followed by the sibling redirect and the interpretive caveat. Dense with finance jargon, but each clause carries information and nothing is padding.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained, and the description covers the computation, the sibling alternative, and the interpretation warning. For a six-parameter statistical tool it is adequately complete, though it assumes the reader knows the surrounding multiple-testing framework.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and every parameter is already documented, so the baseline is 3. The description's mapping of 'tests' to Bonferroni/independent-test haircuts and 'other_sharpe_ratios_annualized' to Holm/BHY largely restates what the schema descriptions already say, adding little beyond them.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names the specific quantity (the Haircut Sharpe for multiple testing, Harvey and Liu 2015) and the exact estimators produced (Bonferroni, independent-test, Holm, BHY), which lets an agent distinguish it from validate_deflated_sharpe. It lacks an explicit verb framing, but the resource and scope are unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly routes the agent to the alternative: 'For the probability the Sharpe is real, use validate_deflated_sharpe.' That is a clear use-when-other condition. It stops short of stating the positive condition for when this tool should be chosen (e.g., multiple-testing scenarios with a trial count), but the sibling routing is concrete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.