Server definition
- Hash
- sha256:3992288c1a5bac4f20e9f1e90dfaa7e8e62f18ccace90ebd6672346f0fab53e0
- What it is
- What a remote MCP server returned when asked what it offers: 21 tools
The blob, as servednamed by its sha256
{
"instructions": null,
"tools": [
{
"description": "Project NPV, IRR, MIRR, fractional payback, profitability index and equivalent annual annuity. Runs Capital budgeting (corporate.capital_budgeting, version 2) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$id": "urn:pyeconomics:model:corporate.capital_budgeting:2:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "Project NPV, IRR, MIRR, fractional payback, profitability index and equivalent annual annuity.",
"examples": [
{
"cash_flows": [
-100,
60,
60
],
"finance_rate": 0.1,
"rate": 0.1,
"reinvestment_rate": 0.1
}
],
"properties": {
"cash_flows": {
"description": "Signed project cash flows at t=0, 1, ...; negative means paid out",
"items": {
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1201,
"minItems": 2,
"title": "Cash Flows",
"type": "array"
},
"finance_rate": {
"default": 0,
"description": "MIRR financing rate per period for negative flows",
"maximum": 1,
"minimum": -0.99,
"title": "Finance Rate",
"type": "number",
"x-unit": "rate"
},
"rate": {
"description": "Discount rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
},
"reinvestment_rate": {
"default": 0,
"description": "MIRR reinvestment rate per period for positive flows",
"maximum": 1,
"minimum": -0.99,
"title": "Reinvestment Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"cash_flows",
"rate"
],
"title": "Capital budgeting: inputs",
"type": "object"
},
"name": "corporate_capital_budgeting",
"outputSchema": {
"$defs": {
"input": {
"additionalProperties": false,
"description": "Project NPV, IRR, MIRR, fractional payback, profitability index and equivalent annual annuity.",
"examples": [
{
"cash_flows": [
-100,
60,
60
],
"finance_rate": 0.1,
"rate": 0.1,
"reinvestment_rate": 0.1
}
],
"properties": {
"cash_flows": {
"description": "Signed project cash flows at t=0, 1, ...; negative means paid out",
"items": {
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1201,
"minItems": 2,
"title": "Cash Flows",
"type": "array"
},
"finance_rate": {
"default": 0,
"description": "MIRR financing rate per period for negative flows",
"maximum": 1,
"minimum": -0.99,
"title": "Finance Rate",
"type": "number",
"x-unit": "rate"
},
"rate": {
"description": "Discount rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
},
"reinvestment_rate": {
"default": 0,
"description": "MIRR reinvestment rate per period for positive flows",
"maximum": 1,
"minimum": -0.99,
"title": "Reinvestment Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"cash_flows",
"rate"
],
"title": "Capital budgeting: inputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "corporate.capital_budgeting"
},
"model_version": {
"const": 2
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"additionalProperties": false,
"description": "Project NPV, IRR, MIRR, fractional payback, profitability index and equivalent annual annuity.",
"properties": {
"discounted_payback": {
"anyOf": [
{
"maximum": 1200,
"minimum": 0,
"type": "number",
"x-unit": "periods"
},
{
"type": "null"
}
],
"description": "First discounted cumulative recovery time, fractional periods",
"title": "Discounted Payback"
},
"equivalent_annual_annuity": {
"anyOf": [
{
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"type": "number",
"x-unit": "money"
},
{
"type": "null"
}
],
"description": "NPV / annuity factor over the project's periods; annual only when periods are years",
"title": "Equivalent Annual Annuity"
},
"irr": {
"anyOf": [
{
"maximum": 10,
"minimum": -0.99,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"description": "Smallest IRR in [-0.99, 10], or null with warning",
"title": "Irr"
},
"mirr": {
"anyOf": [
{
"maximum": 10,
"minimum": -0.99,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"description": "Modified IRR per period, or null with warning",
"title": "Mirr"
},
"npv": {
"description": "NPV including the undiscounted t=0 flow",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Npv",
"type": "number",
"x-unit": "money"
},
"payback": {
"anyOf": [
{
"maximum": 1200,
"minimum": 0,
"type": "number",
"x-unit": "periods"
},
{
"type": "null"
}
],
"description": "First nominal cumulative recovery time, fractional periods; null if never reached",
"title": "Payback"
},
"profitability_index": {
"anyOf": [
{
"maximum": 1000000,
"minimum": 0,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"description": "PV of positive flows / absolute PV of negative flows",
"title": "Profitability Index"
}
},
"required": [
"npv",
"irr",
"mirr",
"payback",
"discounted_payback",
"profitability_index",
"equivalent_annual_annuity"
],
"title": "Capital budgeting: outputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "corporate.capital_budgeting"
},
"model_version": {
"const": 2
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Capital budgeting: result",
"type": "object"
}
},
{
"description": "CAPM, WACC with preferred equity, Hamada unlevering/relevering, and country risk premium. Runs Cost of capital and beta (corporate.cost_of_capital, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: capm, country_risk_premium, relever_beta, unlever_beta, wacc. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"CapmInputs": {
"additionalProperties": false,
"properties": {
"beta": {
"description": "Equity beta to the market portfolio",
"maximum": 5,
"minimum": -5,
"title": "Beta",
"type": "number",
"x-unit": "ratio"
},
"calculation": {
"const": "capm",
"default": "capm",
"description": "Capital asset pricing model",
"title": "Calculation",
"type": "string"
},
"equity_risk_premium": {
"description": "Expected market return less risk-free rate",
"maximum": 0.5,
"minimum": -0.5,
"title": "Equity Risk Premium",
"type": "number",
"x-unit": "rate"
},
"risk_free_rate": {
"description": "Annual risk-free rate",
"maximum": 0.5,
"minimum": -0.05,
"title": "Risk Free Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"risk_free_rate",
"equity_risk_premium",
"beta"
],
"title": "CapmInputs",
"type": "object"
},
"CountryInputs": {
"additionalProperties": false,
"properties": {
"bond_volatility": {
"description": "Sovereign bond volatility over the common period",
"maximum": 5,
"minimum": 0.000001,
"title": "Bond Volatility",
"type": "number",
"x-unit": "volatility"
},
"calculation": {
"const": "country_risk_premium",
"default": "country_risk_premium",
"description": "Volatility-scaled sovereign spread",
"title": "Calculation",
"type": "string"
},
"equity_volatility": {
"description": "Equity volatility over the common period",
"maximum": 5,
"minimum": 0.000001,
"title": "Equity Volatility",
"type": "number",
"x-unit": "volatility"
},
"sovereign_spread": {
"description": "Annual sovereign default spread",
"maximum": 1,
"minimum": 0,
"title": "Sovereign Spread",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"sovereign_spread",
"equity_volatility",
"bond_volatility"
],
"title": "CountryInputs",
"type": "object"
},
"ReleverInputs": {
"additionalProperties": false,
"properties": {
"beta": {
"description": "Levered beta to unlever, or unlevered beta to relever",
"maximum": 5,
"minimum": -5,
"title": "Beta",
"type": "number",
"x-unit": "ratio"
},
"calculation": {
"const": "relever_beta",
"default": "relever_beta",
"description": "Add financial leverage",
"title": "Calculation",
"type": "string"
},
"debt_to_equity": {
"description": "Market debt/equity ratio",
"maximum": 100,
"minimum": 0,
"title": "Debt To Equity",
"type": "number",
"x-unit": "ratio"
},
"tax_rate": {
"description": "Marginal tax rate",
"maximum": 1,
"minimum": 0,
"title": "Tax Rate",
"type": "number",
"x-unit": "probability"
}
},
"required": [
"beta",
"debt_to_equity",
"tax_rate"
],
"title": "ReleverInputs",
"type": "object"
},
"UnleverInputs": {
"additionalProperties": false,
"properties": {
"beta": {
"description": "Levered beta to unlever, or unlevered beta to relever",
"maximum": 5,
"minimum": -5,
"title": "Beta",
"type": "number",
"x-unit": "ratio"
},
"calculation": {
"const": "unlever_beta",
"default": "unlever_beta",
"description": "Remove financial leverage",
"title": "Calculation",
"type": "string"
},
"debt_to_equity": {
"description": "Market debt/equity ratio",
"maximum": 100,
"minimum": 0,
"title": "Debt To Equity",
"type": "number",
"x-unit": "ratio"
},
"tax_rate": {
"description": "Marginal tax rate",
"maximum": 1,
"minimum": 0,
"title": "Tax Rate",
"type": "number",
"x-unit": "probability"
}
},
"required": [
"beta",
"debt_to_equity",
"tax_rate"
],
"title": "UnleverInputs",
"type": "object"
},
"WaccInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "wacc",
"default": "wacc",
"description": "Weighted average cost of capital",
"title": "Calculation",
"type": "string"
},
"cost_of_debt": {
"description": "Annual pretax cost of debt",
"maximum": 1,
"minimum": 0,
"title": "Cost Of Debt",
"type": "number",
"x-unit": "rate"
},
"cost_of_equity": {
"description": "Annual cost of common equity",
"maximum": 1,
"minimum": 0,
"title": "Cost Of Equity",
"type": "number",
"x-unit": "rate"
},
"cost_of_preferred": {
"default": 0,
"description": "Annual cost of preferred stock",
"maximum": 1,
"minimum": 0,
"title": "Cost Of Preferred",
"type": "number",
"x-unit": "rate"
},
"debt": {
"description": "Market value of debt",
"maximum": 1000000000000,
"minimum": 0,
"title": "Debt",
"type": "number",
"x-unit": "money"
},
"equity": {
"description": "Market value of common equity",
"maximum": 1000000000000,
"minimum": 0,
"title": "Equity",
"type": "number",
"x-unit": "money"
},
"preferred": {
"default": 0,
"description": "Market value of preferred stock",
"maximum": 1000000000000,
"minimum": 0,
"title": "Preferred",
"type": "number",
"x-unit": "money"
},
"tax_rate": {
"description": "Marginal tax rate for debt shield",
"maximum": 1,
"minimum": 0,
"title": "Tax Rate",
"type": "number",
"x-unit": "probability"
}
},
"required": [
"equity",
"debt",
"cost_of_equity",
"cost_of_debt",
"tax_rate"
],
"title": "WaccInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:corporate.cost_of_capital:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "CAPM, WACC with preferred equity, Hamada unlevering/relevering, and country risk premium.",
"discriminator": {
"mapping": {
"capm": "#/$defs/CapmInputs",
"country_risk_premium": "#/$defs/CountryInputs",
"relever_beta": "#/$defs/ReleverInputs",
"unlever_beta": "#/$defs/UnleverInputs",
"wacc": "#/$defs/WaccInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"beta": 1.2,
"calculation": "capm",
"equity_risk_premium": 0.05,
"risk_free_rate": 0.03
},
{
"calculation": "wacc",
"cost_of_debt": 0.06,
"cost_of_equity": 0.12,
"cost_of_preferred": 0,
"debt": 400,
"equity": 600,
"preferred": 0,
"tax_rate": 0.25
},
{
"beta": 1.2,
"calculation": "unlever_beta",
"debt_to_equity": 0,
"tax_rate": 0.25
},
{
"beta": 1,
"calculation": "relever_beta",
"debt_to_equity": 0.5,
"tax_rate": 0.2
},
{
"bond_volatility": 0.2,
"calculation": "country_risk_premium",
"equity_volatility": 0.3,
"sovereign_spread": 0.02
},
{
"calculation": "wacc",
"cost_of_debt": 0.06,
"cost_of_equity": 0.12,
"cost_of_preferred": 0,
"debt": 400,
"equity": 600,
"preferred": 0,
"tax_rate": 0.25
}
],
"oneOf": [
{
"$ref": "#/$defs/CapmInputs"
},
{
"$ref": "#/$defs/WaccInputs"
},
{
"$ref": "#/$defs/UnleverInputs"
},
{
"$ref": "#/$defs/ReleverInputs"
},
{
"$ref": "#/$defs/CountryInputs"
}
],
"title": "Cost of capital and beta: inputs",
"type": "object"
},
"name": "corporate_cost_of_capital",
"outputSchema": {
"$defs": {
"input": {
"description": "CAPM, WACC with preferred equity, Hamada unlevering/relevering, and country risk premium.",
"discriminator": {
"mapping": {
"capm": "#/$defs/input.CapmInputs",
"country_risk_premium": "#/$defs/input.CountryInputs",
"relever_beta": "#/$defs/input.ReleverInputs",
"unlever_beta": "#/$defs/input.UnleverInputs",
"wacc": "#/$defs/input.WaccInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"beta": 1.2,
"calculation": "capm",
"equity_risk_premium": 0.05,
"risk_free_rate": 0.03
},
{
"calculation": "wacc",
"cost_of_debt": 0.06,
"cost_of_equity": 0.12,
"cost_of_preferred": 0,
"debt": 400,
"equity": 600,
"preferred": 0,
"tax_rate": 0.25
},
{
"beta": 1.2,
"calculation": "unlever_beta",
"debt_to_equity": 0,
"tax_rate": 0.25
},
{
"beta": 1,
"calculation": "relever_beta",
"debt_to_equity": 0.5,
"tax_rate": 0.2
},
{
"bond_volatility": 0.2,
"calculation": "country_risk_premium",
"equity_volatility": 0.3,
"sovereign_spread": 0.02
},
{
"calculation": "wacc",
"cost_of_debt": 0.06,
"cost_of_equity": 0.12,
"cost_of_preferred": 0,
"debt": 400,
"equity": 600,
"preferred": 0,
"tax_rate": 0.25
}
],
"oneOf": [
{
"$ref": "#/$defs/input.CapmInputs"
},
{
"$ref": "#/$defs/input.WaccInputs"
},
{
"$ref": "#/$defs/input.UnleverInputs"
},
{
"$ref": "#/$defs/input.ReleverInputs"
},
{
"$ref": "#/$defs/input.CountryInputs"
}
],
"title": "Cost of capital and beta: inputs"
},
"input.CapmInputs": {
"additionalProperties": false,
"properties": {
"beta": {
"description": "Equity beta to the market portfolio",
"maximum": 5,
"minimum": -5,
"title": "Beta",
"type": "number",
"x-unit": "ratio"
},
"calculation": {
"const": "capm",
"default": "capm",
"description": "Capital asset pricing model",
"title": "Calculation",
"type": "string"
},
"equity_risk_premium": {
"description": "Expected market return less risk-free rate",
"maximum": 0.5,
"minimum": -0.5,
"title": "Equity Risk Premium",
"type": "number",
"x-unit": "rate"
},
"risk_free_rate": {
"description": "Annual risk-free rate",
"maximum": 0.5,
"minimum": -0.05,
"title": "Risk Free Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"risk_free_rate",
"equity_risk_premium",
"beta"
],
"title": "CapmInputs",
"type": "object"
},
"input.CountryInputs": {
"additionalProperties": false,
"properties": {
"bond_volatility": {
"description": "Sovereign bond volatility over the common period",
"maximum": 5,
"minimum": 0.000001,
"title": "Bond Volatility",
"type": "number",
"x-unit": "volatility"
},
"calculation": {
"const": "country_risk_premium",
"default": "country_risk_premium",
"description": "Volatility-scaled sovereign spread",
"title": "Calculation",
"type": "string"
},
"equity_volatility": {
"description": "Equity volatility over the common period",
"maximum": 5,
"minimum": 0.000001,
"title": "Equity Volatility",
"type": "number",
"x-unit": "volatility"
},
"sovereign_spread": {
"description": "Annual sovereign default spread",
"maximum": 1,
"minimum": 0,
"title": "Sovereign Spread",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"sovereign_spread",
"equity_volatility",
"bond_volatility"
],
"title": "CountryInputs",
"type": "object"
},
"input.ReleverInputs": {
"additionalProperties": false,
"properties": {
"beta": {
"description": "Levered beta to unlever, or unlevered beta to relever",
"maximum": 5,
"minimum": -5,
"title": "Beta",
"type": "number",
"x-unit": "ratio"
},
"calculation": {
"const": "relever_beta",
"default": "relever_beta",
"description": "Add financial leverage",
"title": "Calculation",
"type": "string"
},
"debt_to_equity": {
"description": "Market debt/equity ratio",
"maximum": 100,
"minimum": 0,
"title": "Debt To Equity",
"type": "number",
"x-unit": "ratio"
},
"tax_rate": {
"description": "Marginal tax rate",
"maximum": 1,
"minimum": 0,
"title": "Tax Rate",
"type": "number",
"x-unit": "probability"
}
},
"required": [
"beta",
"debt_to_equity",
"tax_rate"
],
"title": "ReleverInputs",
"type": "object"
},
"input.UnleverInputs": {
"additionalProperties": false,
"properties": {
"beta": {
"description": "Levered beta to unlever, or unlevered beta to relever",
"maximum": 5,
"minimum": -5,
"title": "Beta",
"type": "number",
"x-unit": "ratio"
},
"calculation": {
"const": "unlever_beta",
"default": "unlever_beta",
"description": "Remove financial leverage",
"title": "Calculation",
"type": "string"
},
"debt_to_equity": {
"description": "Market debt/equity ratio",
"maximum": 100,
"minimum": 0,
"title": "Debt To Equity",
"type": "number",
"x-unit": "ratio"
},
"tax_rate": {
"description": "Marginal tax rate",
"maximum": 1,
"minimum": 0,
"title": "Tax Rate",
"type": "number",
"x-unit": "probability"
}
},
"required": [
"beta",
"debt_to_equity",
"tax_rate"
],
"title": "UnleverInputs",
"type": "object"
},
"input.WaccInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "wacc",
"default": "wacc",
"description": "Weighted average cost of capital",
"title": "Calculation",
"type": "string"
},
"cost_of_debt": {
"description": "Annual pretax cost of debt",
"maximum": 1,
"minimum": 0,
"title": "Cost Of Debt",
"type": "number",
"x-unit": "rate"
},
"cost_of_equity": {
"description": "Annual cost of common equity",
"maximum": 1,
"minimum": 0,
"title": "Cost Of Equity",
"type": "number",
"x-unit": "rate"
},
"cost_of_preferred": {
"default": 0,
"description": "Annual cost of preferred stock",
"maximum": 1,
"minimum": 0,
"title": "Cost Of Preferred",
"type": "number",
"x-unit": "rate"
},
"debt": {
"description": "Market value of debt",
"maximum": 1000000000000,
"minimum": 0,
"title": "Debt",
"type": "number",
"x-unit": "money"
},
"equity": {
"description": "Market value of common equity",
"maximum": 1000000000000,
"minimum": 0,
"title": "Equity",
"type": "number",
"x-unit": "money"
},
"preferred": {
"default": 0,
"description": "Market value of preferred stock",
"maximum": 1000000000000,
"minimum": 0,
"title": "Preferred",
"type": "number",
"x-unit": "money"
},
"tax_rate": {
"description": "Marginal tax rate for debt shield",
"maximum": 1,
"minimum": 0,
"title": "Tax Rate",
"type": "number",
"x-unit": "probability"
}
},
"required": [
"equity",
"debt",
"cost_of_equity",
"cost_of_debt",
"tax_rate"
],
"title": "WaccInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "corporate.cost_of_capital"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "CAPM, WACC with preferred equity, Hamada unlevering/relevering, and country risk premium.",
"discriminator": {
"mapping": {
"capm": "#/$defs/output.CapmOutputs",
"country_risk_premium": "#/$defs/output.CountryOutputs",
"relever_beta": "#/$defs/output.ReleverOutputs",
"unlever_beta": "#/$defs/output.UnleverOutputs",
"wacc": "#/$defs/output.WaccOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.CapmOutputs"
},
{
"$ref": "#/$defs/output.WaccOutputs"
},
{
"$ref": "#/$defs/output.UnleverOutputs"
},
{
"$ref": "#/$defs/output.ReleverOutputs"
},
{
"$ref": "#/$defs/output.CountryOutputs"
}
],
"title": "Cost of capital and beta: outputs"
},
"output.CapmOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "capm",
"default": "capm",
"description": "Capital asset pricing model",
"title": "Calculation",
"type": "string"
},
"cost_of_equity": {
"description": "Risk-free rate plus beta times ERP",
"maximum": 3,
"minimum": -3,
"title": "Cost Of Equity",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"cost_of_equity"
],
"title": "CapmOutputs",
"type": "object"
},
"output.CountryOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "country_risk_premium",
"default": "country_risk_premium",
"description": "Volatility-scaled sovereign spread",
"title": "Calculation",
"type": "string"
},
"premium": {
"description": "Country equity risk premium",
"maximum": 5000000,
"minimum": 0,
"title": "Premium",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"premium"
],
"title": "CountryOutputs",
"type": "object"
},
"output.ReleverOutputs": {
"additionalProperties": false,
"properties": {
"beta": {
"description": "Levered beta",
"maximum": 505,
"minimum": -505,
"title": "Beta",
"type": "number",
"x-unit": "ratio"
},
"calculation": {
"const": "relever_beta",
"default": "relever_beta",
"description": "Add financial leverage",
"title": "Calculation",
"type": "string"
}
},
"required": [
"beta"
],
"title": "ReleverOutputs",
"type": "object"
},
"output.UnleverOutputs": {
"additionalProperties": false,
"properties": {
"beta": {
"description": "Unlevered beta",
"maximum": 505,
"minimum": -505,
"title": "Beta",
"type": "number",
"x-unit": "ratio"
},
"calculation": {
"const": "unlever_beta",
"default": "unlever_beta",
"description": "Remove financial leverage",
"title": "Calculation",
"type": "string"
}
},
"required": [
"beta"
],
"title": "UnleverOutputs",
"type": "object"
},
"output.WaccOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "wacc",
"default": "wacc",
"description": "Weighted average cost of capital",
"title": "Calculation",
"type": "string"
},
"wacc": {
"description": "Market-weighted after-tax cost of capital",
"maximum": 1,
"minimum": 0,
"title": "Wacc",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"wacc"
],
"title": "WaccOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "corporate.cost_of_capital"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Cost of capital and beta: result",
"type": "object"
}
},
{
"description": "Cox-Ross-Rubinstein binomial prices of European and American calls and puts with a dividend yield, with delta and gamma from the tree. Runs Binomial option tree (derivatives.binomial_tree, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"OptionType": {
"enum": [
"call",
"put"
],
"type": "string"
}
},
"$id": "urn:pyeconomics:model:derivatives.binomial_tree:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "Cox-Ross-Rubinstein binomial prices of European and American calls and puts with a dividend yield, with delta and gamma from the tree.",
"examples": [
{
"dividend_yield": 0,
"exercise": "american",
"option_type": "put",
"risk_free_rate": 0.1,
"spot": 50,
"steps": 5,
"strike": 50,
"volatility": 0.4,
"years": 0.4167
},
{
"dividend_yield": 0.06,
"exercise": "american",
"option_type": "call",
"risk_free_rate": 0.05,
"spot": 100,
"steps": 500,
"strike": 100,
"volatility": 0.25,
"years": 1
}
],
"properties": {
"dividend_yield": {
"default": 0,
"description": "Dividend yield per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Dividend Yield",
"type": "number",
"x-unit": "rate"
},
"exercise": {
"default": "american",
"description": "European (at expiry only) or American (at any step) exercise",
"enum": [
"european",
"american"
],
"title": "Exercise",
"type": "string"
},
"option_type": {
"$ref": "#/$defs/OptionType",
"default": "call",
"description": "A call (the right to buy) or a put (to sell)"
},
"risk_free_rate": {
"description": "Risk-free rate per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Risk Free Rate",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Price of the underlying asset now",
"maximum": 10000000,
"minimum": 0.01,
"title": "Spot",
"type": "number",
"x-unit": "money"
},
"steps": {
"default": 100,
"description": "Number of time steps in the tree",
"maximum": 5000,
"minimum": 2,
"title": "Steps",
"type": "integer",
"x-unit": "count"
},
"strike": {
"description": "Strike price",
"maximum": 10000000,
"minimum": 0.01,
"title": "Strike",
"type": "number",
"x-unit": "money"
},
"volatility": {
"description": "Volatility of the asset's return per year",
"maximum": 5,
"minimum": 0.01,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
},
"years": {
"description": "Time to expiry, in years",
"maximum": 100,
"minimum": 0.001,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"strike",
"years",
"risk_free_rate",
"volatility"
],
"title": "Binomial option tree: inputs",
"type": "object"
},
"name": "derivatives_binomial_tree",
"outputSchema": {
"$defs": {
"input": {
"additionalProperties": false,
"description": "Cox-Ross-Rubinstein binomial prices of European and American calls and puts with a dividend yield, with delta and gamma from the tree.",
"examples": [
{
"dividend_yield": 0,
"exercise": "american",
"option_type": "put",
"risk_free_rate": 0.1,
"spot": 50,
"steps": 5,
"strike": 50,
"volatility": 0.4,
"years": 0.4167
},
{
"dividend_yield": 0.06,
"exercise": "american",
"option_type": "call",
"risk_free_rate": 0.05,
"spot": 100,
"steps": 500,
"strike": 100,
"volatility": 0.25,
"years": 1
}
],
"properties": {
"dividend_yield": {
"default": 0,
"description": "Dividend yield per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Dividend Yield",
"type": "number",
"x-unit": "rate"
},
"exercise": {
"default": "american",
"description": "European (at expiry only) or American (at any step) exercise",
"enum": [
"european",
"american"
],
"title": "Exercise",
"type": "string"
},
"option_type": {
"$ref": "#/$defs/input.OptionType",
"default": "call",
"description": "A call (the right to buy) or a put (to sell)"
},
"risk_free_rate": {
"description": "Risk-free rate per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Risk Free Rate",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Price of the underlying asset now",
"maximum": 10000000,
"minimum": 0.01,
"title": "Spot",
"type": "number",
"x-unit": "money"
},
"steps": {
"default": 100,
"description": "Number of time steps in the tree",
"maximum": 5000,
"minimum": 2,
"title": "Steps",
"type": "integer",
"x-unit": "count"
},
"strike": {
"description": "Strike price",
"maximum": 10000000,
"minimum": 0.01,
"title": "Strike",
"type": "number",
"x-unit": "money"
},
"volatility": {
"description": "Volatility of the asset's return per year",
"maximum": 5,
"minimum": 0.01,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
},
"years": {
"description": "Time to expiry, in years",
"maximum": 100,
"minimum": 0.001,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"strike",
"years",
"risk_free_rate",
"volatility"
],
"title": "Binomial option tree: inputs",
"type": "object"
},
"input.OptionType": {
"enum": [
"call",
"put"
],
"type": "string"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "derivatives.binomial_tree"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"additionalProperties": false,
"description": "Cox-Ross-Rubinstein binomial prices of European and American calls and puts with a dividend yield, with delta and gamma from the tree.",
"properties": {
"delta": {
"description": "Change in price per unit of spot, across the first step",
"maximum": 100000,
"minimum": -100000,
"title": "Delta",
"type": "number",
"x-unit": "ratio"
},
"gamma": {
"description": "Change in delta per unit of spot, across the second step",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Gamma",
"type": "number",
"x-unit": "ratio"
},
"price": {
"description": "Option price",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Price",
"type": "number",
"x-unit": "money"
},
"up_factor": {
"description": "Price ratio of a move up: e^(sigma sqrt(dt))",
"exclusiveMinimum": 1,
"maximum": 10000000000000000,
"title": "Up Factor",
"type": "number",
"x-unit": "ratio"
},
"up_probability": {
"description": "Risk-neutral probability of a move up",
"exclusiveMaximum": 1,
"exclusiveMinimum": 0,
"title": "Up Probability",
"type": "number",
"x-unit": "probability"
}
},
"required": [
"price",
"delta",
"gamma",
"up_factor",
"up_probability"
],
"title": "Binomial option tree: outputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "derivatives.binomial_tree"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Binomial option tree: result",
"type": "object"
}
},
{
"description": "Price, Greeks and implied volatility of European calls and puts on an asset with a continuous dividend yield. Runs Black-Scholes-Merton options (derivatives.black_scholes_merton, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: implied_volatility, price. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"ImpliedVolatilityInputs": {
"additionalProperties": false,
"description": "A European option and its price.",
"properties": {
"calculation": {
"const": "implied_volatility",
"default": "implied_volatility",
"description": "Volatility implied by a price",
"title": "Calculation",
"type": "string"
},
"dividend_yield": {
"default": 0,
"description": "Dividend yield per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Dividend Yield",
"type": "number",
"x-unit": "rate"
},
"option_price": {
"description": "The option's price",
"maximum": 1000000000000,
"minimum": 0,
"title": "Option Price",
"type": "number",
"x-unit": "money"
},
"option_type": {
"$ref": "#/$defs/OptionType",
"default": "call",
"description": "A call (the right to buy) or a put (to sell)"
},
"risk_free_rate": {
"description": "Risk-free rate per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Risk Free Rate",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Price of the underlying asset now",
"maximum": 10000000,
"minimum": 0.01,
"title": "Spot",
"type": "number",
"x-unit": "money"
},
"strike": {
"description": "Strike price",
"maximum": 10000000,
"minimum": 0.01,
"title": "Strike",
"type": "number",
"x-unit": "money"
},
"years": {
"description": "Time to expiry, in years",
"maximum": 100,
"minimum": 0.001,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"strike",
"years",
"risk_free_rate",
"option_price"
],
"title": "ImpliedVolatilityInputs",
"type": "object"
},
"OptionType": {
"enum": [
"call",
"put"
],
"type": "string"
},
"PriceInputs": {
"additionalProperties": false,
"description": "A European option and the volatility to price it at.",
"properties": {
"calculation": {
"const": "price",
"default": "price",
"description": "Price, Greeks and the put-call parity residual",
"title": "Calculation",
"type": "string"
},
"dividend_yield": {
"default": 0,
"description": "Dividend yield per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Dividend Yield",
"type": "number",
"x-unit": "rate"
},
"option_type": {
"$ref": "#/$defs/OptionType",
"default": "call",
"description": "A call (the right to buy) or a put (to sell)"
},
"risk_free_rate": {
"description": "Risk-free rate per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Risk Free Rate",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Price of the underlying asset now",
"maximum": 10000000,
"minimum": 0.01,
"title": "Spot",
"type": "number",
"x-unit": "money"
},
"strike": {
"description": "Strike price",
"maximum": 10000000,
"minimum": 0.01,
"title": "Strike",
"type": "number",
"x-unit": "money"
},
"volatility": {
"description": "Volatility of the asset's return per year",
"maximum": 5,
"minimum": 0.001,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
},
"years": {
"description": "Time to expiry, in years",
"maximum": 100,
"minimum": 0.001,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"strike",
"years",
"risk_free_rate",
"volatility"
],
"title": "PriceInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:derivatives.black_scholes_merton:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Price, Greeks and implied volatility of European calls and puts on an asset with a continuous dividend yield.",
"discriminator": {
"mapping": {
"implied_volatility": "#/$defs/ImpliedVolatilityInputs",
"price": "#/$defs/PriceInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "price",
"dividend_yield": 0,
"option_type": "call",
"risk_free_rate": 0.1,
"spot": 42,
"strike": 40,
"volatility": 0.2,
"years": 0.5
},
{
"calculation": "price",
"dividend_yield": 0.05,
"option_type": "put",
"risk_free_rate": 0.1,
"spot": 100,
"strike": 95,
"volatility": 0.2,
"years": 0.5
},
{
"calculation": "implied_volatility",
"dividend_yield": 0,
"option_price": 1.875,
"option_type": "call",
"risk_free_rate": 0.1,
"spot": 21,
"strike": 20,
"years": 0.25
}
],
"oneOf": [
{
"$ref": "#/$defs/PriceInputs"
},
{
"$ref": "#/$defs/ImpliedVolatilityInputs"
}
],
"title": "Black-Scholes-Merton options: inputs",
"type": "object"
},
"name": "derivatives_black_scholes_merton",
"outputSchema": {
"$defs": {
"input": {
"description": "Price, Greeks and implied volatility of European calls and puts on an asset with a continuous dividend yield.",
"discriminator": {
"mapping": {
"implied_volatility": "#/$defs/input.ImpliedVolatilityInputs",
"price": "#/$defs/input.PriceInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "price",
"dividend_yield": 0,
"option_type": "call",
"risk_free_rate": 0.1,
"spot": 42,
"strike": 40,
"volatility": 0.2,
"years": 0.5
},
{
"calculation": "price",
"dividend_yield": 0.05,
"option_type": "put",
"risk_free_rate": 0.1,
"spot": 100,
"strike": 95,
"volatility": 0.2,
"years": 0.5
},
{
"calculation": "implied_volatility",
"dividend_yield": 0,
"option_price": 1.875,
"option_type": "call",
"risk_free_rate": 0.1,
"spot": 21,
"strike": 20,
"years": 0.25
}
],
"oneOf": [
{
"$ref": "#/$defs/input.PriceInputs"
},
{
"$ref": "#/$defs/input.ImpliedVolatilityInputs"
}
],
"title": "Black-Scholes-Merton options: inputs"
},
"input.ImpliedVolatilityInputs": {
"additionalProperties": false,
"description": "A European option and its price.",
"properties": {
"calculation": {
"const": "implied_volatility",
"default": "implied_volatility",
"description": "Volatility implied by a price",
"title": "Calculation",
"type": "string"
},
"dividend_yield": {
"default": 0,
"description": "Dividend yield per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Dividend Yield",
"type": "number",
"x-unit": "rate"
},
"option_price": {
"description": "The option's price",
"maximum": 1000000000000,
"minimum": 0,
"title": "Option Price",
"type": "number",
"x-unit": "money"
},
"option_type": {
"$ref": "#/$defs/input.OptionType",
"default": "call",
"description": "A call (the right to buy) or a put (to sell)"
},
"risk_free_rate": {
"description": "Risk-free rate per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Risk Free Rate",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Price of the underlying asset now",
"maximum": 10000000,
"minimum": 0.01,
"title": "Spot",
"type": "number",
"x-unit": "money"
},
"strike": {
"description": "Strike price",
"maximum": 10000000,
"minimum": 0.01,
"title": "Strike",
"type": "number",
"x-unit": "money"
},
"years": {
"description": "Time to expiry, in years",
"maximum": 100,
"minimum": 0.001,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"strike",
"years",
"risk_free_rate",
"option_price"
],
"title": "ImpliedVolatilityInputs",
"type": "object"
},
"input.OptionType": {
"enum": [
"call",
"put"
],
"type": "string"
},
"input.PriceInputs": {
"additionalProperties": false,
"description": "A European option and the volatility to price it at.",
"properties": {
"calculation": {
"const": "price",
"default": "price",
"description": "Price, Greeks and the put-call parity residual",
"title": "Calculation",
"type": "string"
},
"dividend_yield": {
"default": 0,
"description": "Dividend yield per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Dividend Yield",
"type": "number",
"x-unit": "rate"
},
"option_type": {
"$ref": "#/$defs/input.OptionType",
"default": "call",
"description": "A call (the right to buy) or a put (to sell)"
},
"risk_free_rate": {
"description": "Risk-free rate per year, continuously compounded",
"maximum": 1,
"minimum": -0.1,
"title": "Risk Free Rate",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Price of the underlying asset now",
"maximum": 10000000,
"minimum": 0.01,
"title": "Spot",
"type": "number",
"x-unit": "money"
},
"strike": {
"description": "Strike price",
"maximum": 10000000,
"minimum": 0.01,
"title": "Strike",
"type": "number",
"x-unit": "money"
},
"volatility": {
"description": "Volatility of the asset's return per year",
"maximum": 5,
"minimum": 0.001,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
},
"years": {
"description": "Time to expiry, in years",
"maximum": 100,
"minimum": 0.001,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"strike",
"years",
"risk_free_rate",
"volatility"
],
"title": "PriceInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "derivatives.black_scholes_merton"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "Price, Greeks and implied volatility of European calls and puts on an asset with a continuous dividend yield.",
"discriminator": {
"mapping": {
"implied_volatility": "#/$defs/output.ImpliedVolatilityOutputs",
"price": "#/$defs/output.PriceOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.PriceOutputs"
},
{
"$ref": "#/$defs/output.ImpliedVolatilityOutputs"
}
],
"title": "Black-Scholes-Merton options: outputs"
},
"output.ImpliedVolatilityOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "implied_volatility",
"default": "implied_volatility",
"description": "Volatility implied by a price",
"title": "Calculation",
"type": "string"
},
"implied_volatility": {
"anyOf": [
{
"maximum": 5,
"minimum": 0.001,
"type": "number",
"x-unit": "volatility"
},
{
"type": "null"
}
],
"description": "Volatility whose price is the price given; null when the price is outside the no-arbitrage bounds or the solver's range",
"title": "Implied Volatility"
},
"lower_bound": {
"description": "No-arbitrage lower bound on the price",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Lower Bound",
"type": "number",
"x-unit": "money"
},
"upper_bound": {
"description": "No-arbitrage upper bound on the price",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Upper Bound",
"type": "number",
"x-unit": "money"
}
},
"required": [
"implied_volatility",
"lower_bound",
"upper_bound"
],
"title": "ImpliedVolatilityOutputs",
"type": "object"
},
"output.PriceOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "price",
"default": "price",
"description": "Price, Greeks and the put-call parity residual",
"title": "Calculation",
"type": "string"
},
"delta": {
"description": "Change in price per unit of spot",
"maximum": 100000,
"minimum": -100000,
"title": "Delta",
"type": "number",
"x-unit": "ratio"
},
"dividend_rho": {
"description": "Change in price per 1.00 of the dividend yield",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Dividend Rho",
"type": "number",
"x-unit": "money"
},
"gamma": {
"description": "Change in delta per unit of spot",
"maximum": 1000000000000,
"minimum": 0,
"title": "Gamma",
"type": "number",
"x-unit": "ratio"
},
"price": {
"description": "Option price",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Price",
"type": "number",
"x-unit": "money"
},
"put_call_parity_residual": {
"description": "Call less put less (S e^-qT - K e^-rT): zero up to rounding",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Put Call Parity Residual",
"type": "number",
"x-unit": "money"
},
"rho": {
"description": "Change in price per 1.00 of the risk-free rate",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Rho",
"type": "number",
"x-unit": "money"
},
"theta": {
"description": "Change in price per year that passes",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Theta",
"type": "number",
"x-unit": "money"
},
"vega": {
"description": "Change in price per 1.00 of volatility",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Vega",
"type": "number",
"x-unit": "money"
}
},
"required": [
"price",
"delta",
"gamma",
"vega",
"theta",
"rho",
"dividend_rho",
"put_call_parity_residual"
],
"title": "PriceOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "derivatives.black_scholes_merton"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Black-Scholes-Merton options: result",
"type": "object"
}
},
{
"description": "Describes one model: its formula, assumptions, limitations, references, examples, data bindings, input and output schemas (JSON Schema 2020-12, every number with its unit; rates are decimals) and its model card.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "The model to describe.",
"properties": {
"model_id": {
"description": "A model id, or an alias of one, as search_models lists them.",
"maxLength": 128,
"minLength": 1,
"type": "string"
}
},
"required": [
"model_id"
],
"title": "describe_model: inputs",
"type": "object"
},
"name": "describe_model",
"outputSchema": {
"$defs": {
"alias": {
"additionalProperties": false,
"properties": {
"id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"removed_in": {
"type": "string"
}
},
"required": [
"id",
"removed_in"
],
"type": "object"
},
"binding": {
"additionalProperties": false,
"properties": {
"as_of": {
"enum": [
"last_on_or_before",
"period",
"window"
]
},
"columns": {
"items": {
"type": "string"
},
"type": "array"
},
"concept": {
"type": "string"
},
"field": {
"type": "string"
},
"profile": {
"type": "string"
},
"tenors": {
"type": [
"string",
"null"
]
},
"transform": {
"type": [
"string",
"null"
]
},
"vintage": {
"enum": [
"real_time",
"latest"
]
},
"window": {
"minimum": 1,
"type": [
"integer",
"null"
]
}
},
"required": [
"field",
"concept",
"transform",
"as_of",
"window",
"vintage",
"profile",
"tenors",
"columns"
],
"type": "object"
},
"changelog_entry": {
"additionalProperties": false,
"properties": {
"note": {
"type": "string"
},
"version": {
"minimum": 1,
"type": "integer"
}
},
"required": [
"version",
"note"
],
"type": "object"
},
"chart": {
"additionalProperties": false,
"properties": {
"calculation": {
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
"kind": {
"enum": [
"line",
"bar",
"scatter",
"band"
]
},
"title": {
"type": "string"
},
"x": {
"type": "string"
},
"x_label": {
"type": [
"string",
"null"
]
},
"y": {
"items": {
"type": "string"
},
"minItems": 1,
"type": "array"
},
"y_label": {
"type": [
"string",
"null"
]
}
},
"required": [
"id",
"title",
"kind",
"x",
"y",
"x_label",
"y_label",
"calculation"
],
"type": "object"
},
"example": {
"additionalProperties": false,
"properties": {
"inputs": {
"type": "object"
},
"name": {
"type": "string"
},
"note": {
"type": [
"string",
"null"
]
}
},
"required": [
"name",
"note",
"inputs"
],
"type": "object"
},
"invariant": {
"additionalProperties": false,
"properties": {
"id": {
"type": "string"
},
"statement": {
"type": "string"
}
},
"required": [
"id",
"statement"
],
"type": "object"
},
"reference": {
"additionalProperties": false,
"properties": {
"citation": {
"type": "string"
},
"doi": {
"type": [
"string",
"null"
]
},
"isbn": {
"type": [
"string",
"null"
]
},
"key": {
"type": "string"
},
"locator": {
"type": [
"string",
"null"
]
},
"url": {
"type": [
"string",
"null"
]
}
},
"required": [
"key",
"citation",
"doi",
"url",
"locator",
"isbn"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "A model's specification, its input and output schemas and its card.",
"properties": {
"aliases": {
"items": {
"$ref": "#/$defs/alias"
},
"type": "array"
},
"assumptions": {
"items": {
"type": "string"
},
"type": "array"
},
"bindings": {
"items": {
"$ref": "#/$defs/binding"
},
"type": "array"
},
"card": {
"description": "The model card as MyST Markdown.",
"type": "string"
},
"changelog": {
"items": {
"$ref": "#/$defs/changelog_entry"
},
"type": "array"
},
"charts": {
"items": {
"$ref": "#/$defs/chart"
},
"type": "array"
},
"cost": {
"enum": [
"instant",
"light",
"heavy",
null
]
},
"domain": {
"pattern": "^[a-z][a-z0-9_]*$",
"type": "string"
},
"evidence": {
"enum": [
"standard",
"practitioner",
"contested",
"rejected",
"historical",
null
]
},
"examples": {
"items": {
"$ref": "#/$defs/example"
},
"minItems": 1,
"type": "array"
},
"extra": {
"type": [
"string",
"null"
]
},
"formula": {
"description": "LaTeX, one line per item.",
"items": {
"type": "string"
},
"type": "array"
},
"id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"input_schema": {
"description": "The model's JSON Schema 2020-12 input document.",
"type": "object"
},
"invariants": {
"items": {
"$ref": "#/$defs/invariant"
},
"type": "array"
},
"limitations": {
"items": {
"type": "string"
},
"type": "array"
},
"no_invariants_reason": {
"type": [
"string",
"null"
]
},
"output_schema": {
"description": "The model's JSON Schema 2020-12 output document.",
"type": "object"
},
"references": {
"items": {
"$ref": "#/$defs/reference"
},
"type": "array"
},
"summary": {
"type": "string"
},
"tags": {
"items": {
"type": "string"
},
"type": "array"
},
"title": {
"type": "string"
},
"version": {
"minimum": 1,
"type": "integer"
}
},
"required": [
"id",
"version",
"domain",
"title",
"summary",
"tags",
"formula",
"assumptions",
"limitations",
"evidence",
"cost",
"references",
"invariants",
"no_invariants_reason",
"examples",
"charts",
"aliases",
"bindings",
"extra",
"changelog",
"input_schema",
"output_schema",
"card"
],
"title": "describe_model: result",
"type": "object"
}
},
{
"description": "Gordon, two-stage and H-model values, PVGO and the Gordon implied return. Runs Dividend discount valuation (equity.dividend_discount, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: gordon, h_model, implied_return, pvgo, two_stage. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"GordonInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "gordon",
"default": "gordon",
"description": "Constant growth",
"title": "Calculation",
"type": "string"
},
"growth": {
"description": "Perpetual annual dividend growth",
"maximum": 1,
"minimum": -0.5,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"next_dividend": {
"description": "Dividend per share at t=1",
"maximum": 1000000000,
"minimum": 0,
"title": "Next Dividend",
"type": "number",
"x-unit": "money"
},
"required_return": {
"description": "Annual cost of equity",
"exclusiveMinimum": 0,
"maximum": 1,
"title": "Required Return",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"next_dividend",
"required_return",
"growth"
],
"title": "GordonInputs",
"type": "object"
},
"HModelInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "h_model",
"default": "h_model",
"description": "Linear-growth approximation",
"title": "Calculation",
"type": "string"
},
"dividend": {
"description": "Dividend per share just paid, D0",
"maximum": 1000000000,
"minimum": 0,
"title": "Dividend",
"type": "number",
"x-unit": "money"
},
"growth": {
"description": "Initial annual dividend growth",
"maximum": 1,
"minimum": -0.5,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"half_life": {
"description": "H, half the growth transition duration",
"maximum": 50,
"minimum": 0,
"title": "Half Life",
"type": "number",
"x-unit": "years"
},
"required_return": {
"description": "Annual cost of equity",
"exclusiveMinimum": 0,
"maximum": 1,
"title": "Required Return",
"type": "number",
"x-unit": "rate"
},
"terminal_growth": {
"description": "Stable annual dividend growth",
"maximum": 1,
"minimum": -0.5,
"title": "Terminal Growth",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"dividend",
"required_return",
"growth",
"terminal_growth",
"half_life"
],
"title": "HModelInputs",
"type": "object"
},
"ImpliedInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "implied_return",
"default": "implied_return",
"description": "Gordon implied return",
"title": "Calculation",
"type": "string"
},
"growth": {
"description": "Perpetual annual growth",
"maximum": 1,
"minimum": -0.5,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"next_dividend": {
"description": "Dividend per share at t=1",
"maximum": 1000000000,
"minimum": 0,
"title": "Next Dividend",
"type": "number",
"x-unit": "money"
},
"price": {
"description": "Observed price per share",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Price",
"type": "number",
"x-unit": "money"
}
},
"required": [
"price",
"next_dividend",
"growth"
],
"title": "ImpliedInputs",
"type": "object"
},
"PvgoInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "pvgo",
"default": "pvgo",
"description": "Value of growth opportunities",
"title": "Calculation",
"type": "string"
},
"earnings": {
"description": "Next year's earnings per share",
"maximum": 1000000000,
"minimum": -1000000000,
"title": "Earnings",
"type": "number",
"x-unit": "money"
},
"price": {
"description": "Observed price per share",
"maximum": 1000000000,
"minimum": 0,
"title": "Price",
"type": "number",
"x-unit": "money"
},
"required_return": {
"description": "Annual cost of equity",
"exclusiveMinimum": 0,
"maximum": 1,
"title": "Required Return",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"price",
"earnings",
"required_return"
],
"title": "PvgoInputs",
"type": "object"
},
"TwoStageInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "two_stage",
"default": "two_stage",
"description": "Two-stage DDM",
"title": "Calculation",
"type": "string"
},
"growth": {
"description": "Growth within the first stage",
"maximum": 1,
"minimum": -0.5,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"next_dividend": {
"description": "Dividend per share at t=1",
"maximum": 1000000000,
"minimum": 0,
"title": "Next Dividend",
"type": "number",
"x-unit": "money"
},
"required_return": {
"description": "Annual cost of equity",
"exclusiveMinimum": 0,
"maximum": 1,
"title": "Required Return",
"type": "number",
"x-unit": "rate"
},
"terminal_growth": {
"description": "Growth after the first stage",
"maximum": 1,
"minimum": -0.5,
"title": "Terminal Growth",
"type": "number",
"x-unit": "rate"
},
"years": {
"description": "Number of first-stage dividends",
"maximum": 100,
"minimum": 1,
"title": "Years",
"type": "integer",
"x-unit": "count"
}
},
"required": [
"next_dividend",
"required_return",
"growth",
"years",
"terminal_growth"
],
"title": "TwoStageInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:equity.dividend_discount:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Gordon, two-stage and H-model values, PVGO and the Gordon implied return.",
"discriminator": {
"mapping": {
"gordon": "#/$defs/GordonInputs",
"h_model": "#/$defs/HModelInputs",
"implied_return": "#/$defs/ImpliedInputs",
"pvgo": "#/$defs/PvgoInputs",
"two_stage": "#/$defs/TwoStageInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "gordon",
"growth": 0,
"next_dividend": 2,
"required_return": 0.1
},
{
"calculation": "h_model",
"dividend": 2,
"growth": 0.12,
"half_life": 5,
"required_return": 0.1,
"terminal_growth": 0.04
},
{
"calculation": "two_stage",
"growth": 0.02,
"next_dividend": 2,
"required_return": 0.1,
"terminal_growth": 0.02,
"years": 10
},
{
"calculation": "pvgo",
"earnings": 3,
"price": 50,
"required_return": 0.1
},
{
"calculation": "implied_return",
"growth": 0.02,
"next_dividend": 2,
"price": 50
},
{
"calculation": "gordon",
"growth": 0.02,
"next_dividend": 2,
"required_return": 0.1
}
],
"oneOf": [
{
"$ref": "#/$defs/GordonInputs"
},
{
"$ref": "#/$defs/TwoStageInputs"
},
{
"$ref": "#/$defs/HModelInputs"
},
{
"$ref": "#/$defs/PvgoInputs"
},
{
"$ref": "#/$defs/ImpliedInputs"
}
],
"title": "Dividend discount valuation: inputs",
"type": "object"
},
"name": "equity_dividend_discount",
"outputSchema": {
"$defs": {
"input": {
"description": "Gordon, two-stage and H-model values, PVGO and the Gordon implied return.",
"discriminator": {
"mapping": {
"gordon": "#/$defs/input.GordonInputs",
"h_model": "#/$defs/input.HModelInputs",
"implied_return": "#/$defs/input.ImpliedInputs",
"pvgo": "#/$defs/input.PvgoInputs",
"two_stage": "#/$defs/input.TwoStageInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "gordon",
"growth": 0,
"next_dividend": 2,
"required_return": 0.1
},
{
"calculation": "h_model",
"dividend": 2,
"growth": 0.12,
"half_life": 5,
"required_return": 0.1,
"terminal_growth": 0.04
},
{
"calculation": "two_stage",
"growth": 0.02,
"next_dividend": 2,
"required_return": 0.1,
"terminal_growth": 0.02,
"years": 10
},
{
"calculation": "pvgo",
"earnings": 3,
"price": 50,
"required_return": 0.1
},
{
"calculation": "implied_return",
"growth": 0.02,
"next_dividend": 2,
"price": 50
},
{
"calculation": "gordon",
"growth": 0.02,
"next_dividend": 2,
"required_return": 0.1
}
],
"oneOf": [
{
"$ref": "#/$defs/input.GordonInputs"
},
{
"$ref": "#/$defs/input.TwoStageInputs"
},
{
"$ref": "#/$defs/input.HModelInputs"
},
{
"$ref": "#/$defs/input.PvgoInputs"
},
{
"$ref": "#/$defs/input.ImpliedInputs"
}
],
"title": "Dividend discount valuation: inputs"
},
"input.GordonInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "gordon",
"default": "gordon",
"description": "Constant growth",
"title": "Calculation",
"type": "string"
},
"growth": {
"description": "Perpetual annual dividend growth",
"maximum": 1,
"minimum": -0.5,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"next_dividend": {
"description": "Dividend per share at t=1",
"maximum": 1000000000,
"minimum": 0,
"title": "Next Dividend",
"type": "number",
"x-unit": "money"
},
"required_return": {
"description": "Annual cost of equity",
"exclusiveMinimum": 0,
"maximum": 1,
"title": "Required Return",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"next_dividend",
"required_return",
"growth"
],
"title": "GordonInputs",
"type": "object"
},
"input.HModelInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "h_model",
"default": "h_model",
"description": "Linear-growth approximation",
"title": "Calculation",
"type": "string"
},
"dividend": {
"description": "Dividend per share just paid, D0",
"maximum": 1000000000,
"minimum": 0,
"title": "Dividend",
"type": "number",
"x-unit": "money"
},
"growth": {
"description": "Initial annual dividend growth",
"maximum": 1,
"minimum": -0.5,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"half_life": {
"description": "H, half the growth transition duration",
"maximum": 50,
"minimum": 0,
"title": "Half Life",
"type": "number",
"x-unit": "years"
},
"required_return": {
"description": "Annual cost of equity",
"exclusiveMinimum": 0,
"maximum": 1,
"title": "Required Return",
"type": "number",
"x-unit": "rate"
},
"terminal_growth": {
"description": "Stable annual dividend growth",
"maximum": 1,
"minimum": -0.5,
"title": "Terminal Growth",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"dividend",
"required_return",
"growth",
"terminal_growth",
"half_life"
],
"title": "HModelInputs",
"type": "object"
},
"input.ImpliedInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "implied_return",
"default": "implied_return",
"description": "Gordon implied return",
"title": "Calculation",
"type": "string"
},
"growth": {
"description": "Perpetual annual growth",
"maximum": 1,
"minimum": -0.5,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"next_dividend": {
"description": "Dividend per share at t=1",
"maximum": 1000000000,
"minimum": 0,
"title": "Next Dividend",
"type": "number",
"x-unit": "money"
},
"price": {
"description": "Observed price per share",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Price",
"type": "number",
"x-unit": "money"
}
},
"required": [
"price",
"next_dividend",
"growth"
],
"title": "ImpliedInputs",
"type": "object"
},
"input.PvgoInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "pvgo",
"default": "pvgo",
"description": "Value of growth opportunities",
"title": "Calculation",
"type": "string"
},
"earnings": {
"description": "Next year's earnings per share",
"maximum": 1000000000,
"minimum": -1000000000,
"title": "Earnings",
"type": "number",
"x-unit": "money"
},
"price": {
"description": "Observed price per share",
"maximum": 1000000000,
"minimum": 0,
"title": "Price",
"type": "number",
"x-unit": "money"
},
"required_return": {
"description": "Annual cost of equity",
"exclusiveMinimum": 0,
"maximum": 1,
"title": "Required Return",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"price",
"earnings",
"required_return"
],
"title": "PvgoInputs",
"type": "object"
},
"input.TwoStageInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "two_stage",
"default": "two_stage",
"description": "Two-stage DDM",
"title": "Calculation",
"type": "string"
},
"growth": {
"description": "Growth within the first stage",
"maximum": 1,
"minimum": -0.5,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"next_dividend": {
"description": "Dividend per share at t=1",
"maximum": 1000000000,
"minimum": 0,
"title": "Next Dividend",
"type": "number",
"x-unit": "money"
},
"required_return": {
"description": "Annual cost of equity",
"exclusiveMinimum": 0,
"maximum": 1,
"title": "Required Return",
"type": "number",
"x-unit": "rate"
},
"terminal_growth": {
"description": "Growth after the first stage",
"maximum": 1,
"minimum": -0.5,
"title": "Terminal Growth",
"type": "number",
"x-unit": "rate"
},
"years": {
"description": "Number of first-stage dividends",
"maximum": 100,
"minimum": 1,
"title": "Years",
"type": "integer",
"x-unit": "count"
}
},
"required": [
"next_dividend",
"required_return",
"growth",
"years",
"terminal_growth"
],
"title": "TwoStageInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "equity.dividend_discount"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "Gordon, two-stage and H-model values, PVGO and the Gordon implied return.",
"discriminator": {
"mapping": {
"gordon": "#/$defs/output.GordonOutputs",
"h_model": "#/$defs/output.HModelOutputs",
"implied_return": "#/$defs/output.ImpliedOutputs",
"pvgo": "#/$defs/output.PvgoOutputs",
"two_stage": "#/$defs/output.TwoStageOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.GordonOutputs"
},
{
"$ref": "#/$defs/output.TwoStageOutputs"
},
{
"$ref": "#/$defs/output.HModelOutputs"
},
{
"$ref": "#/$defs/output.PvgoOutputs"
},
{
"$ref": "#/$defs/output.ImpliedOutputs"
}
],
"title": "Dividend discount valuation: outputs"
},
"output.GordonOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "gordon",
"default": "gordon",
"description": "Constant growth",
"title": "Calculation",
"type": "string"
},
"value": {
"description": "Equity value per share",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Value",
"type": "number",
"x-unit": "money"
}
},
"required": [
"value"
],
"title": "GordonOutputs",
"type": "object"
},
"output.HModelOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "h_model",
"default": "h_model",
"description": "Linear-growth approximation",
"title": "Calculation",
"type": "string"
},
"value": {
"description": "Approximate equity value per share",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Value",
"type": "number",
"x-unit": "money"
}
},
"required": [
"value"
],
"title": "HModelOutputs",
"type": "object"
},
"output.ImpliedOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "implied_return",
"default": "implied_return",
"description": "Gordon implied return",
"title": "Calculation",
"type": "string"
},
"required_return": {
"description": "Dividend yield plus growth; decimal",
"maximum": 10,
"minimum": -0.5,
"title": "Required Return",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"required_return"
],
"title": "ImpliedOutputs",
"type": "object"
},
"output.PvgoOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "pvgo",
"default": "pvgo",
"description": "Value of growth opportunities",
"title": "Calculation",
"type": "string"
},
"no_growth_value": {
"description": "Earnings capitalized at required return",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "No Growth Value",
"type": "number",
"x-unit": "money"
},
"pvgo": {
"description": "Observed price less no-growth value",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Pvgo",
"type": "number",
"x-unit": "money"
}
},
"required": [
"no_growth_value",
"pvgo"
],
"title": "PvgoOutputs",
"type": "object"
},
"output.TwoStageOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "two_stage",
"default": "two_stage",
"description": "Two-stage DDM",
"title": "Calculation",
"type": "string"
},
"value": {
"description": "Equity value per share",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Value",
"type": "number",
"x-unit": "money"
}
},
"required": [
"value"
],
"title": "TwoStageOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "equity.dividend_discount"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Dividend discount valuation: result",
"type": "object"
}
},
{
"description": "FCFF from EBIT, FCFE from net income, and one- or two-stage firm or equity valuation. Runs Free cash flow and DCF valuation (equity.free_cash_flow, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: fcfe, fcff, valuation. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"FcfeInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "fcfe",
"default": "fcfe",
"description": "Free cash flow to equity",
"title": "Calculation",
"type": "string"
},
"capex": {
"description": "Capital expenditure, positive outlay",
"maximum": 1000000000000,
"minimum": 0,
"title": "Capex",
"type": "number",
"x-unit": "money"
},
"depreciation": {
"description": "Noncash depreciation and amortization",
"maximum": 1000000000000,
"minimum": 0,
"title": "Depreciation",
"type": "number",
"x-unit": "money"
},
"net_borrowing": {
"description": "New debt less principal repaid",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Net Borrowing",
"type": "number",
"x-unit": "money"
},
"net_income": {
"description": "After-interest after-tax net income",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Net Income",
"type": "number",
"x-unit": "money"
},
"working_capital_change": {
"description": "Increase in noncash working capital, positive outlay",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Working Capital Change",
"type": "number",
"x-unit": "money"
}
},
"required": [
"depreciation",
"capex",
"working_capital_change",
"net_income",
"net_borrowing"
],
"title": "FcfeInputs",
"type": "object"
},
"FcffInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "fcff",
"default": "fcff",
"description": "Free cash flow to the firm",
"title": "Calculation",
"type": "string"
},
"capex": {
"description": "Capital expenditure, positive outlay",
"maximum": 1000000000000,
"minimum": 0,
"title": "Capex",
"type": "number",
"x-unit": "money"
},
"depreciation": {
"description": "Noncash depreciation and amortization",
"maximum": 1000000000000,
"minimum": 0,
"title": "Depreciation",
"type": "number",
"x-unit": "money"
},
"ebit": {
"description": "Operating earnings before interest and tax",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Ebit",
"type": "number",
"x-unit": "money"
},
"tax_rate": {
"description": "Marginal tax rate; full loss tax benefit assumed",
"maximum": 1,
"minimum": 0,
"title": "Tax Rate",
"type": "number",
"x-unit": "probability"
},
"working_capital_change": {
"description": "Increase in noncash working capital, positive outlay",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Working Capital Change",
"type": "number",
"x-unit": "money"
}
},
"required": [
"depreciation",
"capex",
"working_capital_change",
"ebit",
"tax_rate"
],
"title": "FcffInputs",
"type": "object"
},
"ValuationInputs": {
"additionalProperties": false,
"properties": {
"basis": {
"default": "firm",
"description": "FCFF/WACC or FCFE/cost of equity",
"enum": [
"firm",
"equity"
],
"title": "Basis",
"type": "string"
},
"calculation": {
"const": "valuation",
"default": "valuation",
"description": "One- or two-stage DCF",
"title": "Calculation",
"type": "string"
},
"discount_rate": {
"description": "WACC for firm basis; cost of equity for equity basis",
"exclusiveMinimum": 0,
"maximum": 1,
"title": "Discount Rate",
"type": "number",
"x-unit": "rate"
},
"growth": {
"default": 0,
"description": "Growth within the first stage",
"maximum": 1,
"minimum": -0.5,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"net_debt": {
"default": 0,
"description": "Debt less cash; excludes nonoperating assets other than cash",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Net Debt",
"type": "number",
"x-unit": "money"
},
"next_cash_flow": {
"description": "FCFF or FCFE at t=1",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Next Cash Flow",
"type": "number",
"x-unit": "money"
},
"terminal_growth": {
"default": 0,
"description": "Stable growth after the first stage, or after t=1 if years=0",
"maximum": 1,
"minimum": -0.5,
"title": "Terminal Growth",
"type": "number",
"x-unit": "rate"
},
"years": {
"default": 0,
"description": "First-stage years; zero selects a single-stage perpetuity",
"maximum": 100,
"minimum": 0,
"title": "Years",
"type": "integer",
"x-unit": "count"
}
},
"required": [
"next_cash_flow",
"discount_rate"
],
"title": "ValuationInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:equity.free_cash_flow:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "FCFF from EBIT, FCFE from net income, and one- or two-stage firm or equity valuation.",
"discriminator": {
"mapping": {
"fcfe": "#/$defs/FcfeInputs",
"fcff": "#/$defs/FcffInputs",
"valuation": "#/$defs/ValuationInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "fcff",
"capex": 70,
"depreciation": 50,
"ebit": 200,
"tax_rate": 0.25,
"working_capital_change": 10
},
{
"calculation": "fcfe",
"capex": 70,
"depreciation": 50,
"net_borrowing": 20,
"net_income": 120,
"working_capital_change": 10
},
{
"basis": "firm",
"calculation": "valuation",
"discount_rate": 0.1,
"growth": 0,
"net_debt": 200,
"next_cash_flow": 100,
"terminal_growth": 0,
"years": 0
},
{
"basis": "firm",
"calculation": "valuation",
"discount_rate": 0.1,
"growth": 0,
"net_debt": 200,
"next_cash_flow": 100,
"terminal_growth": 0.02,
"years": 0
}
],
"oneOf": [
{
"$ref": "#/$defs/FcffInputs"
},
{
"$ref": "#/$defs/FcfeInputs"
},
{
"$ref": "#/$defs/ValuationInputs"
}
],
"title": "Free cash flow and DCF valuation: inputs",
"type": "object"
},
"name": "equity_free_cash_flow",
"outputSchema": {
"$defs": {
"input": {
"description": "FCFF from EBIT, FCFE from net income, and one- or two-stage firm or equity valuation.",
"discriminator": {
"mapping": {
"fcfe": "#/$defs/input.FcfeInputs",
"fcff": "#/$defs/input.FcffInputs",
"valuation": "#/$defs/input.ValuationInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "fcff",
"capex": 70,
"depreciation": 50,
"ebit": 200,
"tax_rate": 0.25,
"working_capital_change": 10
},
{
"calculation": "fcfe",
"capex": 70,
"depreciation": 50,
"net_borrowing": 20,
"net_income": 120,
"working_capital_change": 10
},
{
"basis": "firm",
"calculation": "valuation",
"discount_rate": 0.1,
"growth": 0,
"net_debt": 200,
"next_cash_flow": 100,
"terminal_growth": 0,
"years": 0
},
{
"basis": "firm",
"calculation": "valuation",
"discount_rate": 0.1,
"growth": 0,
"net_debt": 200,
"next_cash_flow": 100,
"terminal_growth": 0.02,
"years": 0
}
],
"oneOf": [
{
"$ref": "#/$defs/input.FcffInputs"
},
{
"$ref": "#/$defs/input.FcfeInputs"
},
{
"$ref": "#/$defs/input.ValuationInputs"
}
],
"title": "Free cash flow and DCF valuation: inputs"
},
"input.FcfeInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "fcfe",
"default": "fcfe",
"description": "Free cash flow to equity",
"title": "Calculation",
"type": "string"
},
"capex": {
"description": "Capital expenditure, positive outlay",
"maximum": 1000000000000,
"minimum": 0,
"title": "Capex",
"type": "number",
"x-unit": "money"
},
"depreciation": {
"description": "Noncash depreciation and amortization",
"maximum": 1000000000000,
"minimum": 0,
"title": "Depreciation",
"type": "number",
"x-unit": "money"
},
"net_borrowing": {
"description": "New debt less principal repaid",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Net Borrowing",
"type": "number",
"x-unit": "money"
},
"net_income": {
"description": "After-interest after-tax net income",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Net Income",
"type": "number",
"x-unit": "money"
},
"working_capital_change": {
"description": "Increase in noncash working capital, positive outlay",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Working Capital Change",
"type": "number",
"x-unit": "money"
}
},
"required": [
"depreciation",
"capex",
"working_capital_change",
"net_income",
"net_borrowing"
],
"title": "FcfeInputs",
"type": "object"
},
"input.FcffInputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "fcff",
"default": "fcff",
"description": "Free cash flow to the firm",
"title": "Calculation",
"type": "string"
},
"capex": {
"description": "Capital expenditure, positive outlay",
"maximum": 1000000000000,
"minimum": 0,
"title": "Capex",
"type": "number",
"x-unit": "money"
},
"depreciation": {
"description": "Noncash depreciation and amortization",
"maximum": 1000000000000,
"minimum": 0,
"title": "Depreciation",
"type": "number",
"x-unit": "money"
},
"ebit": {
"description": "Operating earnings before interest and tax",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Ebit",
"type": "number",
"x-unit": "money"
},
"tax_rate": {
"description": "Marginal tax rate; full loss tax benefit assumed",
"maximum": 1,
"minimum": 0,
"title": "Tax Rate",
"type": "number",
"x-unit": "probability"
},
"working_capital_change": {
"description": "Increase in noncash working capital, positive outlay",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Working Capital Change",
"type": "number",
"x-unit": "money"
}
},
"required": [
"depreciation",
"capex",
"working_capital_change",
"ebit",
"tax_rate"
],
"title": "FcffInputs",
"type": "object"
},
"input.ValuationInputs": {
"additionalProperties": false,
"properties": {
"basis": {
"default": "firm",
"description": "FCFF/WACC or FCFE/cost of equity",
"enum": [
"firm",
"equity"
],
"title": "Basis",
"type": "string"
},
"calculation": {
"const": "valuation",
"default": "valuation",
"description": "One- or two-stage DCF",
"title": "Calculation",
"type": "string"
},
"discount_rate": {
"description": "WACC for firm basis; cost of equity for equity basis",
"exclusiveMinimum": 0,
"maximum": 1,
"title": "Discount Rate",
"type": "number",
"x-unit": "rate"
},
"growth": {
"default": 0,
"description": "Growth within the first stage",
"maximum": 1,
"minimum": -0.5,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"net_debt": {
"default": 0,
"description": "Debt less cash; excludes nonoperating assets other than cash",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Net Debt",
"type": "number",
"x-unit": "money"
},
"next_cash_flow": {
"description": "FCFF or FCFE at t=1",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Next Cash Flow",
"type": "number",
"x-unit": "money"
},
"terminal_growth": {
"default": 0,
"description": "Stable growth after the first stage, or after t=1 if years=0",
"maximum": 1,
"minimum": -0.5,
"title": "Terminal Growth",
"type": "number",
"x-unit": "rate"
},
"years": {
"default": 0,
"description": "First-stage years; zero selects a single-stage perpetuity",
"maximum": 100,
"minimum": 0,
"title": "Years",
"type": "integer",
"x-unit": "count"
}
},
"required": [
"next_cash_flow",
"discount_rate"
],
"title": "ValuationInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "equity.free_cash_flow"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "FCFF from EBIT, FCFE from net income, and one- or two-stage firm or equity valuation.",
"discriminator": {
"mapping": {
"fcfe": "#/$defs/output.FcfeOutputs",
"fcff": "#/$defs/output.FcffOutputs",
"valuation": "#/$defs/output.ValuationOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.FcffOutputs"
},
{
"$ref": "#/$defs/output.FcfeOutputs"
},
{
"$ref": "#/$defs/output.ValuationOutputs"
}
],
"title": "Free cash flow and DCF valuation: outputs"
},
"output.FcfeOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "fcfe",
"default": "fcfe",
"description": "Free cash flow to equity",
"title": "Calculation",
"type": "string"
},
"fcfe": {
"description": "Cash flow after debt financing",
"maximum": 5000000000000,
"minimum": -5000000000000,
"title": "Fcfe",
"type": "number",
"x-unit": "money"
}
},
"required": [
"fcfe"
],
"title": "FcfeOutputs",
"type": "object"
},
"output.FcffOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "fcff",
"default": "fcff",
"description": "Free cash flow to the firm",
"title": "Calculation",
"type": "string"
},
"fcff": {
"description": "Cash flow before debt financing",
"maximum": 4000000000000,
"minimum": -4000000000000,
"title": "Fcff",
"type": "number",
"x-unit": "money"
}
},
"required": [
"fcff"
],
"title": "FcffOutputs",
"type": "object"
},
"output.ValuationOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "valuation",
"default": "valuation",
"description": "One- or two-stage DCF",
"title": "Calculation",
"type": "string"
},
"equity_value": {
"description": "Firm value less net debt",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Equity Value",
"type": "number",
"x-unit": "money"
},
"firm_value": {
"description": "Operating firm value",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Firm Value",
"type": "number",
"x-unit": "money"
}
},
"required": [
"firm_value",
"equity_value"
],
"title": "ValuationOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "equity.free_cash_flow"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Free cash flow and DCF valuation: result",
"type": "object"
}
},
{
"description": "Full and flat price and accrued interest of a fixed-coupon bond from its yield, and its yield to maturity, to a call and to worst from its price. Runs Bond price and yield (fixed_income.bond_pricing, version 2) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: price_from_yield, yield_from_price, yield_to_call, yield_to_worst. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"Convention": {
"enum": [
"street",
"treasury"
],
"type": "string"
},
"DayCountName": {
"enum": [
"act_act_icma",
"thirty_360_us",
"thirty_e_360"
],
"type": "string"
},
"FrequencyName": {
"enum": [
"annual",
"semiannual",
"quarterly",
"monthly"
],
"type": "string"
},
"PriceFromYieldInputs": {
"additionalProperties": false,
"description": "A bond and its yield to maturity.",
"properties": {
"calculation": {
"const": "price_from_yield",
"default": "price_from_yield",
"description": "Full and flat price from a yield",
"title": "Calculation",
"type": "string"
},
"convention": {
"$ref": "#/$defs/Convention",
"default": "street",
"description": "Discounting over the first fraction of a period: compound (street) or simple interest (treasury, 31 CFR Part 356 Appendix B)"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
},
"yield_to_maturity": {
"description": "Yield to maturity per year, compounded at the coupon frequency",
"maximum": 1,
"minimum": -0.1,
"title": "Yield To Maturity",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"yield_to_maturity"
],
"title": "PriceFromYieldInputs",
"type": "object"
},
"YieldFromPriceInputs": {
"additionalProperties": false,
"description": "A bond and its price.",
"properties": {
"calculation": {
"const": "yield_from_price",
"default": "yield_from_price",
"description": "Yield to maturity from a price",
"title": "Calculation",
"type": "string"
},
"convention": {
"$ref": "#/$defs/Convention",
"default": "street",
"description": "Discounting over the first fraction of a period: compound (street) or simple interest (treasury, 31 CFR Part 356 Appendix B)"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"price": {
"description": "Price of the face value held (per 100 by default)",
"exclusiveMinimum": 0,
"maximum": 1000000000000000,
"title": "Price",
"type": "number",
"x-unit": "money"
},
"price_type": {
"default": "flat",
"description": "Whether the price excludes (flat) or includes (full) accrued interest",
"enum": [
"flat",
"full"
],
"title": "Price Type",
"type": "string"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"price"
],
"title": "YieldFromPriceInputs",
"type": "object"
},
"YieldToCallInputs": {
"additionalProperties": false,
"description": "A bond, its price, and a call on one coupon date.",
"properties": {
"calculation": {
"const": "yield_to_call",
"default": "yield_to_call",
"description": "Yield to a call date",
"title": "Calculation",
"type": "string"
},
"call_date": {
"description": "Coupon date on which the bond is called",
"format": "date",
"title": "Call Date",
"type": "string",
"x-unit": "date"
},
"call_price": {
"description": "Amount paid on the call, per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Call Price",
"type": "number",
"x-unit": "money"
},
"convention": {
"$ref": "#/$defs/Convention",
"default": "street",
"description": "Discounting over the first fraction of a period: compound (street) or simple interest (treasury, 31 CFR Part 356 Appendix B)"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"price": {
"description": "Price of the face value held (per 100 by default)",
"exclusiveMinimum": 0,
"maximum": 1000000000000000,
"title": "Price",
"type": "number",
"x-unit": "money"
},
"price_type": {
"default": "flat",
"description": "Whether the price excludes (flat) or includes (full) accrued interest",
"enum": [
"flat",
"full"
],
"title": "Price Type",
"type": "string"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"price",
"call_date",
"call_price"
],
"title": "YieldToCallInputs",
"type": "object"
},
"YieldToWorstInputs": {
"additionalProperties": false,
"description": "A bond, its price, and a schedule of calls.",
"properties": {
"calculation": {
"const": "yield_to_worst",
"default": "yield_to_worst",
"description": "Lowest yield over the calls and maturity",
"title": "Calculation",
"type": "string"
},
"call_dates": {
"description": "Coupon dates on which the bond may be called",
"items": {
"format": "date",
"type": "string",
"x-unit": "date"
},
"maxItems": 50,
"minItems": 1,
"title": "Call Dates",
"type": "array"
},
"call_prices": {
"description": "Amount paid on each call, per 100 of face value",
"items": {
"maximum": 200,
"minimum": 1,
"type": "number",
"x-unit": "money"
},
"maxItems": 50,
"minItems": 1,
"title": "Call Prices",
"type": "array"
},
"convention": {
"$ref": "#/$defs/Convention",
"default": "street",
"description": "Discounting over the first fraction of a period: compound (street) or simple interest (treasury, 31 CFR Part 356 Appendix B)"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"price": {
"description": "Price of the face value held (per 100 by default)",
"exclusiveMinimum": 0,
"maximum": 1000000000000000,
"title": "Price",
"type": "number",
"x-unit": "money"
},
"price_type": {
"default": "flat",
"description": "Whether the price excludes (flat) or includes (full) accrued interest",
"enum": [
"flat",
"full"
],
"title": "Price Type",
"type": "string"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"price",
"call_dates",
"call_prices"
],
"title": "YieldToWorstInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:fixed_income.bond_pricing:2:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Full and flat price and accrued interest of a fixed-coupon bond from its yield, and its yield to maturity, to a call and to worst from its price.",
"discriminator": {
"mapping": {
"price_from_yield": "#/$defs/PriceFromYieldInputs",
"yield_from_price": "#/$defs/YieldFromPriceInputs",
"yield_to_call": "#/$defs/YieldToCallInputs",
"yield_to_worst": "#/$defs/YieldToWorstInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "price_from_yield",
"convention": "street",
"coupon_rate": 0.04,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "annual",
"issue_date": null,
"maturity": "2031-01-15",
"redemption": 100,
"settlement": "2026-01-15",
"yield_to_maturity": 0.05
},
{
"calculation": "price_from_yield",
"convention": "treasury",
"coupon_rate": 0.0875,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2020-05-15",
"redemption": 100,
"settlement": "1990-05-15",
"yield_to_maturity": 0.0884
},
{
"calculation": "price_from_yield",
"convention": "street",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"redemption": 100,
"settlement": "2026-03-02",
"yield_to_maturity": 0.05
},
{
"calculation": "yield_from_price",
"convention": "street",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"price": 96.5,
"price_type": "flat",
"redemption": 100,
"settlement": "2026-01-15"
},
{
"calculation": "yield_to_call",
"call_date": "2031-01-15",
"call_price": 101,
"convention": "street",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"price": 103,
"price_type": "flat",
"redemption": 100,
"settlement": "2026-01-15"
},
{
"calculation": "yield_to_worst",
"call_dates": [
"2029-01-15",
"2031-01-15",
"2033-01-15"
],
"call_prices": [
102,
101,
100
],
"convention": "street",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"price": 104,
"price_type": "flat",
"redemption": 100,
"settlement": "2026-01-15"
}
],
"oneOf": [
{
"$ref": "#/$defs/PriceFromYieldInputs"
},
{
"$ref": "#/$defs/YieldFromPriceInputs"
},
{
"$ref": "#/$defs/YieldToCallInputs"
},
{
"$ref": "#/$defs/YieldToWorstInputs"
}
],
"title": "Bond price and yield: inputs",
"type": "object"
},
"name": "fixed_income_bond_pricing",
"outputSchema": {
"$defs": {
"input": {
"description": "Full and flat price and accrued interest of a fixed-coupon bond from its yield, and its yield to maturity, to a call and to worst from its price.",
"discriminator": {
"mapping": {
"price_from_yield": "#/$defs/input.PriceFromYieldInputs",
"yield_from_price": "#/$defs/input.YieldFromPriceInputs",
"yield_to_call": "#/$defs/input.YieldToCallInputs",
"yield_to_worst": "#/$defs/input.YieldToWorstInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "price_from_yield",
"convention": "street",
"coupon_rate": 0.04,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "annual",
"issue_date": null,
"maturity": "2031-01-15",
"redemption": 100,
"settlement": "2026-01-15",
"yield_to_maturity": 0.05
},
{
"calculation": "price_from_yield",
"convention": "treasury",
"coupon_rate": 0.0875,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2020-05-15",
"redemption": 100,
"settlement": "1990-05-15",
"yield_to_maturity": 0.0884
},
{
"calculation": "price_from_yield",
"convention": "street",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"redemption": 100,
"settlement": "2026-03-02",
"yield_to_maturity": 0.05
},
{
"calculation": "yield_from_price",
"convention": "street",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"price": 96.5,
"price_type": "flat",
"redemption": 100,
"settlement": "2026-01-15"
},
{
"calculation": "yield_to_call",
"call_date": "2031-01-15",
"call_price": 101,
"convention": "street",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"price": 103,
"price_type": "flat",
"redemption": 100,
"settlement": "2026-01-15"
},
{
"calculation": "yield_to_worst",
"call_dates": [
"2029-01-15",
"2031-01-15",
"2033-01-15"
],
"call_prices": [
102,
101,
100
],
"convention": "street",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"price": 104,
"price_type": "flat",
"redemption": 100,
"settlement": "2026-01-15"
}
],
"oneOf": [
{
"$ref": "#/$defs/input.PriceFromYieldInputs"
},
{
"$ref": "#/$defs/input.YieldFromPriceInputs"
},
{
"$ref": "#/$defs/input.YieldToCallInputs"
},
{
"$ref": "#/$defs/input.YieldToWorstInputs"
}
],
"title": "Bond price and yield: inputs"
},
"input.Convention": {
"enum": [
"street",
"treasury"
],
"type": "string"
},
"input.DayCountName": {
"enum": [
"act_act_icma",
"thirty_360_us",
"thirty_e_360"
],
"type": "string"
},
"input.FrequencyName": {
"enum": [
"annual",
"semiannual",
"quarterly",
"monthly"
],
"type": "string"
},
"input.PriceFromYieldInputs": {
"additionalProperties": false,
"description": "A bond and its yield to maturity.",
"properties": {
"calculation": {
"const": "price_from_yield",
"default": "price_from_yield",
"description": "Full and flat price from a yield",
"title": "Calculation",
"type": "string"
},
"convention": {
"$ref": "#/$defs/input.Convention",
"default": "street",
"description": "Discounting over the first fraction of a period: compound (street) or simple interest (treasury, 31 CFR Part 356 Appendix B)"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/input.DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
},
"yield_to_maturity": {
"description": "Yield to maturity per year, compounded at the coupon frequency",
"maximum": 1,
"minimum": -0.1,
"title": "Yield To Maturity",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"yield_to_maturity"
],
"title": "PriceFromYieldInputs",
"type": "object"
},
"input.YieldFromPriceInputs": {
"additionalProperties": false,
"description": "A bond and its price.",
"properties": {
"calculation": {
"const": "yield_from_price",
"default": "yield_from_price",
"description": "Yield to maturity from a price",
"title": "Calculation",
"type": "string"
},
"convention": {
"$ref": "#/$defs/input.Convention",
"default": "street",
"description": "Discounting over the first fraction of a period: compound (street) or simple interest (treasury, 31 CFR Part 356 Appendix B)"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/input.DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"price": {
"description": "Price of the face value held (per 100 by default)",
"exclusiveMinimum": 0,
"maximum": 1000000000000000,
"title": "Price",
"type": "number",
"x-unit": "money"
},
"price_type": {
"default": "flat",
"description": "Whether the price excludes (flat) or includes (full) accrued interest",
"enum": [
"flat",
"full"
],
"title": "Price Type",
"type": "string"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"price"
],
"title": "YieldFromPriceInputs",
"type": "object"
},
"input.YieldToCallInputs": {
"additionalProperties": false,
"description": "A bond, its price, and a call on one coupon date.",
"properties": {
"calculation": {
"const": "yield_to_call",
"default": "yield_to_call",
"description": "Yield to a call date",
"title": "Calculation",
"type": "string"
},
"call_date": {
"description": "Coupon date on which the bond is called",
"format": "date",
"title": "Call Date",
"type": "string",
"x-unit": "date"
},
"call_price": {
"description": "Amount paid on the call, per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Call Price",
"type": "number",
"x-unit": "money"
},
"convention": {
"$ref": "#/$defs/input.Convention",
"default": "street",
"description": "Discounting over the first fraction of a period: compound (street) or simple interest (treasury, 31 CFR Part 356 Appendix B)"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/input.DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"price": {
"description": "Price of the face value held (per 100 by default)",
"exclusiveMinimum": 0,
"maximum": 1000000000000000,
"title": "Price",
"type": "number",
"x-unit": "money"
},
"price_type": {
"default": "flat",
"description": "Whether the price excludes (flat) or includes (full) accrued interest",
"enum": [
"flat",
"full"
],
"title": "Price Type",
"type": "string"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"price",
"call_date",
"call_price"
],
"title": "YieldToCallInputs",
"type": "object"
},
"input.YieldToWorstInputs": {
"additionalProperties": false,
"description": "A bond, its price, and a schedule of calls.",
"properties": {
"calculation": {
"const": "yield_to_worst",
"default": "yield_to_worst",
"description": "Lowest yield over the calls and maturity",
"title": "Calculation",
"type": "string"
},
"call_dates": {
"description": "Coupon dates on which the bond may be called",
"items": {
"format": "date",
"type": "string",
"x-unit": "date"
},
"maxItems": 50,
"minItems": 1,
"title": "Call Dates",
"type": "array"
},
"call_prices": {
"description": "Amount paid on each call, per 100 of face value",
"items": {
"maximum": 200,
"minimum": 1,
"type": "number",
"x-unit": "money"
},
"maxItems": 50,
"minItems": 1,
"title": "Call Prices",
"type": "array"
},
"convention": {
"$ref": "#/$defs/input.Convention",
"default": "street",
"description": "Discounting over the first fraction of a period: compound (street) or simple interest (treasury, 31 CFR Part 356 Appendix B)"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/input.DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"price": {
"description": "Price of the face value held (per 100 by default)",
"exclusiveMinimum": 0,
"maximum": 1000000000000000,
"title": "Price",
"type": "number",
"x-unit": "money"
},
"price_type": {
"default": "flat",
"description": "Whether the price excludes (flat) or includes (full) accrued interest",
"enum": [
"flat",
"full"
],
"title": "Price Type",
"type": "string"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"price",
"call_dates",
"call_prices"
],
"title": "YieldToWorstInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "fixed_income.bond_pricing"
},
"model_version": {
"const": 2
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "Full and flat price and accrued interest of a fixed-coupon bond from its yield, and its yield to maturity, to a call and to worst from its price.",
"discriminator": {
"mapping": {
"price_from_yield": "#/$defs/output.PriceFromYieldOutputs",
"yield_from_price": "#/$defs/output.YieldFromPriceOutputs",
"yield_to_call": "#/$defs/output.YieldToCallOutputs",
"yield_to_worst": "#/$defs/output.YieldToWorstOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.PriceFromYieldOutputs"
},
{
"$ref": "#/$defs/output.YieldFromPriceOutputs"
},
{
"$ref": "#/$defs/output.YieldToCallOutputs"
},
{
"$ref": "#/$defs/output.YieldToWorstOutputs"
}
],
"title": "Bond price and yield: outputs"
},
"output.PriceFromYieldOutputs": {
"additionalProperties": false,
"properties": {
"accrued_interest": {
"description": "Interest accrued up to settlement",
"maximum": 2000000000,
"minimum": 0,
"title": "Accrued Interest",
"type": "number",
"x-unit": "money"
},
"calculation": {
"const": "price_from_yield",
"default": "price_from_yield",
"description": "Full and flat price from a yield",
"title": "Calculation",
"type": "string"
},
"flat_price": {
"description": "Flat (clean) price, of the face value held (per 100 by default): the full price less accrued interest",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Flat Price",
"type": "number",
"x-unit": "money"
},
"full_price": {
"description": "Full (dirty) price at settlement, of the face value held (per 100 by default)",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Full Price",
"type": "number",
"x-unit": "money"
},
"next_coupon_date": {
"description": "First payment after settlement",
"format": "date",
"title": "Next Coupon Date",
"type": "string",
"x-unit": "date"
},
"payments": {
"description": "Payments remaining after settlement",
"maximum": 1201,
"minimum": 1,
"title": "Payments",
"type": "integer",
"x-unit": "count"
}
},
"required": [
"full_price",
"flat_price",
"accrued_interest",
"next_coupon_date",
"payments"
],
"title": "PriceFromYieldOutputs",
"type": "object"
},
"output.YieldFromPriceOutputs": {
"additionalProperties": false,
"properties": {
"accrued_interest": {
"description": "Interest accrued up to settlement",
"maximum": 2000000000,
"minimum": 0,
"title": "Accrued Interest",
"type": "number",
"x-unit": "money"
},
"calculation": {
"const": "yield_from_price",
"default": "yield_from_price",
"description": "Yield to maturity from a price",
"title": "Calculation",
"type": "string"
},
"flat_price": {
"description": "Flat (clean) price, of the face value held (per 100 by default): the full price less accrued interest",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Flat Price",
"type": "number",
"x-unit": "money"
},
"full_price": {
"description": "Full (dirty) price at settlement, of the face value held (per 100 by default)",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Full Price",
"type": "number",
"x-unit": "money"
},
"yield_to_maturity": {
"description": "Yield to maturity that gives the price",
"maximum": 1,
"minimum": -0.1,
"title": "Yield To Maturity",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"yield_to_maturity",
"full_price",
"flat_price",
"accrued_interest"
],
"title": "YieldFromPriceOutputs",
"type": "object"
},
"output.YieldToCallOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "yield_to_call",
"default": "yield_to_call",
"description": "Yield to a call date",
"title": "Calculation",
"type": "string"
},
"full_price": {
"description": "Full (dirty) price at settlement, of the face value held (per 100 by default)",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Full Price",
"type": "number",
"x-unit": "money"
},
"yield_to_call": {
"description": "Yield if the bond is called on the call date",
"maximum": 1,
"minimum": -0.1,
"title": "Yield To Call",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"yield_to_call",
"full_price"
],
"title": "YieldToCallOutputs",
"type": "object"
},
"output.YieldToWorstOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "yield_to_worst",
"default": "yield_to_worst",
"description": "Lowest yield over the calls and maturity",
"title": "Calculation",
"type": "string"
},
"full_price": {
"description": "Full (dirty) price at settlement, of the face value held (per 100 by default)",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Full Price",
"type": "number",
"x-unit": "money"
},
"worst_date": {
"description": "Call or maturity date that gives it",
"format": "date",
"title": "Worst Date",
"type": "string",
"x-unit": "date"
},
"yield_to_maturity": {
"description": "Yield to maturity",
"maximum": 1,
"minimum": -0.1,
"title": "Yield To Maturity",
"type": "number",
"x-unit": "rate"
},
"yield_to_worst": {
"description": "Lowest of the yield to maturity and to each call",
"maximum": 1,
"minimum": -0.1,
"title": "Yield To Worst",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"yield_to_worst",
"worst_date",
"yield_to_maturity",
"full_price"
],
"title": "YieldToWorstOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "fixed_income.bond_pricing"
},
"model_version": {
"const": 2
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Bond price and yield: result",
"type": "object"
}
},
{
"description": "Bootstrap spot rates and discount factors from par yields, par yields from spot rates, and forward rates between maturities. Runs Spot, par and forward curves (fixed_income.curve_bootstrap, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: forward_rate, from_par, from_spot. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"ForwardRateInputs": {
"additionalProperties": false,
"description": "Two spot rates and their maturities.",
"properties": {
"calculation": {
"const": "forward_rate",
"default": "forward_rate",
"description": "Forward rate between two maturities",
"title": "Calculation",
"type": "string"
},
"compounding": {
"$ref": "#/$defs/QuoteCompounding",
"default": "periodic",
"description": "How spot and forward rates compound: at the frequency (periodic) or continuously"
},
"far_rate": {
"description": "Spot rate to the far maturity",
"maximum": 1,
"minimum": -0.1,
"title": "Far Rate",
"type": "number",
"x-unit": "rate"
},
"far_years": {
"description": "Far maturity, in years",
"exclusiveMinimum": 0,
"maximum": 100,
"title": "Far Years",
"type": "number",
"x-unit": "years"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "annual",
"description": "Compounding frequency of periodic rates"
},
"near_rate": {
"description": "Spot rate to the near maturity",
"maximum": 1,
"minimum": -0.1,
"title": "Near Rate",
"type": "number",
"x-unit": "rate"
},
"near_years": {
"description": "Near maturity, in years (0 for now)",
"maximum": 100,
"minimum": 0,
"title": "Near Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"near_rate",
"near_years",
"far_rate",
"far_years"
],
"title": "ForwardRateInputs",
"type": "object"
},
"FrequencyName": {
"enum": [
"annual",
"semiannual",
"quarterly",
"monthly"
],
"type": "string"
},
"FromParInputs": {
"additionalProperties": false,
"description": "Par yields at regular tenors.",
"properties": {
"calculation": {
"const": "from_par",
"default": "from_par",
"description": "Bootstrap spot rates from par yields",
"title": "Calculation",
"type": "string"
},
"compounding": {
"$ref": "#/$defs/QuoteCompounding",
"default": "periodic",
"description": "How spot and forward rates compound: at the frequency (periodic) or continuously"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "semiannual",
"description": "Coupons per year of the par bonds, and the tenor spacing"
},
"par_yields": {
"description": "Par yield at each tenor 1/f, 2/f, ... years",
"items": {
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
"maxItems": 200,
"minItems": 1,
"title": "Par Yields",
"type": "array"
}
},
"required": [
"par_yields"
],
"title": "FromParInputs",
"type": "object"
},
"FromSpotInputs": {
"additionalProperties": false,
"description": "Spot rates at regular tenors.",
"properties": {
"calculation": {
"const": "from_spot",
"default": "from_spot",
"description": "Par yields and forwards from spot rates",
"title": "Calculation",
"type": "string"
},
"compounding": {
"$ref": "#/$defs/QuoteCompounding",
"default": "periodic",
"description": "How spot and forward rates compound: at the frequency (periodic) or continuously"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "semiannual",
"description": "Coupons per year of the par bonds, and the tenor spacing"
},
"spot_rates": {
"description": "Spot (zero) rate at each tenor 1/f, 2/f, ... years",
"items": {
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
"maxItems": 200,
"minItems": 1,
"title": "Spot Rates",
"type": "array"
}
},
"required": [
"spot_rates"
],
"title": "FromSpotInputs",
"type": "object"
},
"QuoteCompounding": {
"enum": [
"periodic",
"continuous"
],
"type": "string"
}
},
"$id": "urn:pyeconomics:model:fixed_income.curve_bootstrap:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Bootstrap spot rates and discount factors from par yields, par yields from spot rates, and forward rates between maturities.",
"discriminator": {
"mapping": {
"forward_rate": "#/$defs/ForwardRateInputs",
"from_par": "#/$defs/FromParInputs",
"from_spot": "#/$defs/FromSpotInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "from_par",
"compounding": "periodic",
"frequency": "semiannual",
"par_yields": [
0.04,
0.041,
0.042,
0.0425,
0.043,
0.0435
]
},
{
"calculation": "from_spot",
"compounding": "continuous",
"frequency": "semiannual",
"spot_rates": [
0.05,
0.058,
0.064,
0.068
]
},
{
"calculation": "forward_rate",
"compounding": "periodic",
"far_rate": 0.04,
"far_years": 2,
"frequency": "annual",
"near_rate": 0.03,
"near_years": 1
}
],
"oneOf": [
{
"$ref": "#/$defs/FromParInputs"
},
{
"$ref": "#/$defs/FromSpotInputs"
},
{
"$ref": "#/$defs/ForwardRateInputs"
}
],
"title": "Spot, par and forward curves: inputs",
"type": "object"
},
"name": "fixed_income_curve_bootstrap",
"outputSchema": {
"$defs": {
"input": {
"description": "Bootstrap spot rates and discount factors from par yields, par yields from spot rates, and forward rates between maturities.",
"discriminator": {
"mapping": {
"forward_rate": "#/$defs/input.ForwardRateInputs",
"from_par": "#/$defs/input.FromParInputs",
"from_spot": "#/$defs/input.FromSpotInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "from_par",
"compounding": "periodic",
"frequency": "semiannual",
"par_yields": [
0.04,
0.041,
0.042,
0.0425,
0.043,
0.0435
]
},
{
"calculation": "from_spot",
"compounding": "continuous",
"frequency": "semiannual",
"spot_rates": [
0.05,
0.058,
0.064,
0.068
]
},
{
"calculation": "forward_rate",
"compounding": "periodic",
"far_rate": 0.04,
"far_years": 2,
"frequency": "annual",
"near_rate": 0.03,
"near_years": 1
}
],
"oneOf": [
{
"$ref": "#/$defs/input.FromParInputs"
},
{
"$ref": "#/$defs/input.FromSpotInputs"
},
{
"$ref": "#/$defs/input.ForwardRateInputs"
}
],
"title": "Spot, par and forward curves: inputs"
},
"input.ForwardRateInputs": {
"additionalProperties": false,
"description": "Two spot rates and their maturities.",
"properties": {
"calculation": {
"const": "forward_rate",
"default": "forward_rate",
"description": "Forward rate between two maturities",
"title": "Calculation",
"type": "string"
},
"compounding": {
"$ref": "#/$defs/input.QuoteCompounding",
"default": "periodic",
"description": "How spot and forward rates compound: at the frequency (periodic) or continuously"
},
"far_rate": {
"description": "Spot rate to the far maturity",
"maximum": 1,
"minimum": -0.1,
"title": "Far Rate",
"type": "number",
"x-unit": "rate"
},
"far_years": {
"description": "Far maturity, in years",
"exclusiveMinimum": 0,
"maximum": 100,
"title": "Far Years",
"type": "number",
"x-unit": "years"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "annual",
"description": "Compounding frequency of periodic rates"
},
"near_rate": {
"description": "Spot rate to the near maturity",
"maximum": 1,
"minimum": -0.1,
"title": "Near Rate",
"type": "number",
"x-unit": "rate"
},
"near_years": {
"description": "Near maturity, in years (0 for now)",
"maximum": 100,
"minimum": 0,
"title": "Near Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"near_rate",
"near_years",
"far_rate",
"far_years"
],
"title": "ForwardRateInputs",
"type": "object"
},
"input.FrequencyName": {
"enum": [
"annual",
"semiannual",
"quarterly",
"monthly"
],
"type": "string"
},
"input.FromParInputs": {
"additionalProperties": false,
"description": "Par yields at regular tenors.",
"properties": {
"calculation": {
"const": "from_par",
"default": "from_par",
"description": "Bootstrap spot rates from par yields",
"title": "Calculation",
"type": "string"
},
"compounding": {
"$ref": "#/$defs/input.QuoteCompounding",
"default": "periodic",
"description": "How spot and forward rates compound: at the frequency (periodic) or continuously"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "semiannual",
"description": "Coupons per year of the par bonds, and the tenor spacing"
},
"par_yields": {
"description": "Par yield at each tenor 1/f, 2/f, ... years",
"items": {
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
"maxItems": 200,
"minItems": 1,
"title": "Par Yields",
"type": "array"
}
},
"required": [
"par_yields"
],
"title": "FromParInputs",
"type": "object"
},
"input.FromSpotInputs": {
"additionalProperties": false,
"description": "Spot rates at regular tenors.",
"properties": {
"calculation": {
"const": "from_spot",
"default": "from_spot",
"description": "Par yields and forwards from spot rates",
"title": "Calculation",
"type": "string"
},
"compounding": {
"$ref": "#/$defs/input.QuoteCompounding",
"default": "periodic",
"description": "How spot and forward rates compound: at the frequency (periodic) or continuously"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "semiannual",
"description": "Coupons per year of the par bonds, and the tenor spacing"
},
"spot_rates": {
"description": "Spot (zero) rate at each tenor 1/f, 2/f, ... years",
"items": {
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
"maxItems": 200,
"minItems": 1,
"title": "Spot Rates",
"type": "array"
}
},
"required": [
"spot_rates"
],
"title": "FromSpotInputs",
"type": "object"
},
"input.QuoteCompounding": {
"enum": [
"periodic",
"continuous"
],
"type": "string"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "fixed_income.curve_bootstrap"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "Bootstrap spot rates and discount factors from par yields, par yields from spot rates, and forward rates between maturities.",
"discriminator": {
"mapping": {
"forward_rate": "#/$defs/output.ForwardRateOutputs",
"from_par": "#/$defs/output.FromParOutputs",
"from_spot": "#/$defs/output.FromSpotOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.FromParOutputs"
},
{
"$ref": "#/$defs/output.FromSpotOutputs"
},
{
"$ref": "#/$defs/output.ForwardRateOutputs"
}
],
"title": "Spot, par and forward curves: outputs"
},
"output.ForwardRateOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "forward_rate",
"default": "forward_rate",
"description": "Forward rate between two maturities",
"title": "Calculation",
"type": "string"
},
"forward_rate": {
"description": "Rate from the near to the far maturity",
"maximum": 10,
"minimum": -0.99,
"title": "Forward Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"forward_rate"
],
"title": "ForwardRateOutputs",
"type": "object"
},
"output.FromParOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "from_par",
"default": "from_par",
"description": "Bootstrap spot rates from par yields",
"title": "Calculation",
"type": "string"
},
"discount_factors": {
"description": "Discount factor at each tenor",
"items": {
"exclusiveMinimum": 0,
"maximum": 1000000000000,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 200,
"title": "Discount Factors",
"type": "array"
},
"forward_rates": {
"description": "Forward rate over each period, ending at its tenor",
"items": {
"maximum": 10,
"minimum": -0.99,
"type": "number",
"x-unit": "rate"
},
"maxItems": 200,
"title": "Forward Rates",
"type": "array"
},
"spot_rates": {
"description": "Spot (zero) rate at each tenor",
"items": {
"maximum": 10,
"minimum": -0.99,
"type": "number",
"x-unit": "rate"
},
"maxItems": 200,
"title": "Spot Rates",
"type": "array"
},
"tenors": {
"description": "Tenor of each point, in years",
"items": {
"exclusiveMinimum": 0,
"maximum": 200,
"type": "number",
"x-unit": "years"
},
"maxItems": 200,
"title": "Tenors",
"type": "array"
}
},
"required": [
"tenors",
"discount_factors",
"spot_rates",
"forward_rates"
],
"title": "FromParOutputs",
"type": "object"
},
"output.FromSpotOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "from_spot",
"default": "from_spot",
"description": "Par yields and forwards from spot rates",
"title": "Calculation",
"type": "string"
},
"discount_factors": {
"description": "Discount factor at each tenor",
"items": {
"exclusiveMinimum": 0,
"maximum": 1000000000000,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 200,
"title": "Discount Factors",
"type": "array"
},
"forward_rates": {
"description": "Forward rate over each period, ending at its tenor",
"items": {
"maximum": 10,
"minimum": -0.99,
"type": "number",
"x-unit": "rate"
},
"maxItems": 200,
"title": "Forward Rates",
"type": "array"
},
"par_yields": {
"description": "Par yield at each tenor",
"items": {
"maximum": 10,
"minimum": -0.99,
"type": "number",
"x-unit": "rate"
},
"maxItems": 200,
"title": "Par Yields",
"type": "array"
},
"tenors": {
"description": "Tenor of each point, in years",
"items": {
"exclusiveMinimum": 0,
"maximum": 200,
"type": "number",
"x-unit": "years"
},
"maxItems": 200,
"title": "Tenors",
"type": "array"
}
},
"required": [
"tenors",
"discount_factors",
"par_yields",
"forward_rates"
],
"title": "FromSpotOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "fixed_income.curve_bootstrap"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Spot, par and forward curves: result",
"type": "object"
}
},
{
"description": "Macaulay and modified duration from a yield, effective and key-rate duration off a spot curve, and DV01 of a fixed-coupon bond. Runs Bond duration (fixed_income.duration, version 2) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: dv01, effective, key_rate, macaulay_modified. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"DayCountName": {
"enum": [
"act_act_icma",
"thirty_360_us",
"thirty_e_360"
],
"type": "string"
},
"Dv01Inputs": {
"additionalProperties": false,
"description": "A bond and its yield to maturity.",
"properties": {
"calculation": {
"const": "dv01",
"default": "dv01",
"description": "Price value of a basis point",
"title": "Calculation",
"type": "string"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
},
"yield_to_maturity": {
"description": "Yield to maturity per year, compounded at the coupon frequency",
"maximum": 1,
"minimum": -0.1,
"title": "Yield To Maturity",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"yield_to_maturity"
],
"title": "Dv01Inputs",
"type": "object"
},
"EffectiveInputs": {
"additionalProperties": false,
"description": "A bond and a spot curve.",
"properties": {
"bump": {
"default": 0.0001,
"description": "Shift of the curve up and down for the central difference",
"maximum": 0.01,
"minimum": 0.000001,
"title": "Bump",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "effective",
"default": "effective",
"description": "Effective duration off a spot curve",
"title": "Calculation",
"type": "string"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"curve_rates": {
"description": "Spot rate at each tenor, compounded at the coupon frequency; linear between nodes and flat beyond them",
"items": {
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
"maxItems": 100,
"minItems": 1,
"title": "Curve Rates",
"type": "array"
},
"curve_tenors": {
"description": "Tenors of the spot curve's nodes, in years, increasing",
"items": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number",
"x-unit": "years"
},
"maxItems": 100,
"minItems": 1,
"title": "Curve Tenors",
"type": "array"
},
"day_count": {
"$ref": "#/$defs/DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"curve_tenors",
"curve_rates"
],
"title": "EffectiveInputs",
"type": "object"
},
"FrequencyName": {
"enum": [
"annual",
"semiannual",
"quarterly",
"monthly"
],
"type": "string"
},
"KeyRateInputs": {
"additionalProperties": false,
"description": "A bond, a spot curve and the key tenors to shift it at.",
"properties": {
"bump": {
"default": 0.0001,
"description": "Shift of the curve up and down for the central difference",
"maximum": 0.01,
"minimum": 0.000001,
"title": "Bump",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "key_rate",
"default": "key_rate",
"description": "Key-rate durations off a spot curve",
"title": "Calculation",
"type": "string"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"curve_rates": {
"description": "Spot rate at each tenor, compounded at the coupon frequency; linear between nodes and flat beyond them",
"items": {
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
"maxItems": 100,
"minItems": 1,
"title": "Curve Rates",
"type": "array"
},
"curve_tenors": {
"description": "Tenors of the spot curve's nodes, in years, increasing",
"items": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number",
"x-unit": "years"
},
"maxItems": 100,
"minItems": 1,
"title": "Curve Tenors",
"type": "array"
},
"day_count": {
"$ref": "#/$defs/DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"key_tenors": {
"description": "Key tenors in years, increasing",
"items": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number",
"x-unit": "years"
},
"maxItems": 30,
"minItems": 1,
"title": "Key Tenors",
"type": "array"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"curve_tenors",
"curve_rates",
"key_tenors"
],
"title": "KeyRateInputs",
"type": "object"
},
"MacaulayModifiedInputs": {
"additionalProperties": false,
"description": "A bond and its yield to maturity.",
"properties": {
"calculation": {
"const": "macaulay_modified",
"default": "macaulay_modified",
"description": "Macaulay and modified duration",
"title": "Calculation",
"type": "string"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
},
"yield_to_maturity": {
"description": "Yield to maturity per year, compounded at the coupon frequency",
"maximum": 1,
"minimum": -0.1,
"title": "Yield To Maturity",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"yield_to_maturity"
],
"title": "MacaulayModifiedInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:fixed_income.duration:2:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Macaulay and modified duration from a yield, effective and key-rate duration off a spot curve, and DV01 of a fixed-coupon bond.",
"discriminator": {
"mapping": {
"dv01": "#/$defs/Dv01Inputs",
"effective": "#/$defs/EffectiveInputs",
"key_rate": "#/$defs/KeyRateInputs",
"macaulay_modified": "#/$defs/MacaulayModifiedInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "macaulay_modified",
"coupon_rate": 0.04,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "annual",
"issue_date": null,
"maturity": "2031-01-15",
"redemption": 100,
"settlement": "2026-01-15",
"yield_to_maturity": 0.05
},
{
"calculation": "macaulay_modified",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"redemption": 100,
"settlement": "2026-01-15",
"yield_to_maturity": 0.045
},
{
"bump": 0.0001,
"calculation": "effective",
"coupon_rate": 0.045,
"curve_rates": [
0.043,
0.042,
0.041,
0.042,
0.045,
0.048
],
"curve_tenors": [
0.5,
1,
2,
5,
10,
30
],
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"redemption": 100,
"settlement": "2026-01-15"
},
{
"bump": 0.0001,
"calculation": "key_rate",
"coupon_rate": 0.045,
"curve_rates": [
0.043,
0.042,
0.041,
0.042,
0.045,
0.048
],
"curve_tenors": [
0.5,
1,
2,
5,
10,
30
],
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"key_tenors": [
2,
5,
10,
30
],
"maturity": "2036-01-15",
"redemption": 100,
"settlement": "2026-01-15"
},
{
"calculation": "dv01",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 1000000,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"redemption": 100,
"settlement": "2026-01-15",
"yield_to_maturity": 0.045
}
],
"oneOf": [
{
"$ref": "#/$defs/MacaulayModifiedInputs"
},
{
"$ref": "#/$defs/EffectiveInputs"
},
{
"$ref": "#/$defs/KeyRateInputs"
},
{
"$ref": "#/$defs/Dv01Inputs"
}
],
"title": "Bond duration: inputs",
"type": "object"
},
"name": "fixed_income_duration",
"outputSchema": {
"$defs": {
"input": {
"description": "Macaulay and modified duration from a yield, effective and key-rate duration off a spot curve, and DV01 of a fixed-coupon bond.",
"discriminator": {
"mapping": {
"dv01": "#/$defs/input.Dv01Inputs",
"effective": "#/$defs/input.EffectiveInputs",
"key_rate": "#/$defs/input.KeyRateInputs",
"macaulay_modified": "#/$defs/input.MacaulayModifiedInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "macaulay_modified",
"coupon_rate": 0.04,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "annual",
"issue_date": null,
"maturity": "2031-01-15",
"redemption": 100,
"settlement": "2026-01-15",
"yield_to_maturity": 0.05
},
{
"calculation": "macaulay_modified",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"redemption": 100,
"settlement": "2026-01-15",
"yield_to_maturity": 0.045
},
{
"bump": 0.0001,
"calculation": "effective",
"coupon_rate": 0.045,
"curve_rates": [
0.043,
0.042,
0.041,
0.042,
0.045,
0.048
],
"curve_tenors": [
0.5,
1,
2,
5,
10,
30
],
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"redemption": 100,
"settlement": "2026-01-15"
},
{
"bump": 0.0001,
"calculation": "key_rate",
"coupon_rate": 0.045,
"curve_rates": [
0.043,
0.042,
0.041,
0.042,
0.045,
0.048
],
"curve_tenors": [
0.5,
1,
2,
5,
10,
30
],
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 100,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"key_tenors": [
2,
5,
10,
30
],
"maturity": "2036-01-15",
"redemption": 100,
"settlement": "2026-01-15"
},
{
"calculation": "dv01",
"coupon_rate": 0.045,
"day_count": "act_act_icma",
"end_of_month": true,
"face_value": 1000000,
"first_period": "short",
"frequency": "semiannual",
"issue_date": null,
"maturity": "2036-01-15",
"redemption": 100,
"settlement": "2026-01-15",
"yield_to_maturity": 0.045
}
],
"oneOf": [
{
"$ref": "#/$defs/input.MacaulayModifiedInputs"
},
{
"$ref": "#/$defs/input.EffectiveInputs"
},
{
"$ref": "#/$defs/input.KeyRateInputs"
},
{
"$ref": "#/$defs/input.Dv01Inputs"
}
],
"title": "Bond duration: inputs"
},
"input.DayCountName": {
"enum": [
"act_act_icma",
"thirty_360_us",
"thirty_e_360"
],
"type": "string"
},
"input.Dv01Inputs": {
"additionalProperties": false,
"description": "A bond and its yield to maturity.",
"properties": {
"calculation": {
"const": "dv01",
"default": "dv01",
"description": "Price value of a basis point",
"title": "Calculation",
"type": "string"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/input.DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
},
"yield_to_maturity": {
"description": "Yield to maturity per year, compounded at the coupon frequency",
"maximum": 1,
"minimum": -0.1,
"title": "Yield To Maturity",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"yield_to_maturity"
],
"title": "Dv01Inputs",
"type": "object"
},
"input.EffectiveInputs": {
"additionalProperties": false,
"description": "A bond and a spot curve.",
"properties": {
"bump": {
"default": 0.0001,
"description": "Shift of the curve up and down for the central difference",
"maximum": 0.01,
"minimum": 0.000001,
"title": "Bump",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "effective",
"default": "effective",
"description": "Effective duration off a spot curve",
"title": "Calculation",
"type": "string"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"curve_rates": {
"description": "Spot rate at each tenor, compounded at the coupon frequency; linear between nodes and flat beyond them",
"items": {
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
"maxItems": 100,
"minItems": 1,
"title": "Curve Rates",
"type": "array"
},
"curve_tenors": {
"description": "Tenors of the spot curve's nodes, in years, increasing",
"items": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number",
"x-unit": "years"
},
"maxItems": 100,
"minItems": 1,
"title": "Curve Tenors",
"type": "array"
},
"day_count": {
"$ref": "#/$defs/input.DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"curve_tenors",
"curve_rates"
],
"title": "EffectiveInputs",
"type": "object"
},
"input.FrequencyName": {
"enum": [
"annual",
"semiannual",
"quarterly",
"monthly"
],
"type": "string"
},
"input.KeyRateInputs": {
"additionalProperties": false,
"description": "A bond, a spot curve and the key tenors to shift it at.",
"properties": {
"bump": {
"default": 0.0001,
"description": "Shift of the curve up and down for the central difference",
"maximum": 0.01,
"minimum": 0.000001,
"title": "Bump",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "key_rate",
"default": "key_rate",
"description": "Key-rate durations off a spot curve",
"title": "Calculation",
"type": "string"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"curve_rates": {
"description": "Spot rate at each tenor, compounded at the coupon frequency; linear between nodes and flat beyond them",
"items": {
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
"maxItems": 100,
"minItems": 1,
"title": "Curve Rates",
"type": "array"
},
"curve_tenors": {
"description": "Tenors of the spot curve's nodes, in years, increasing",
"items": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number",
"x-unit": "years"
},
"maxItems": 100,
"minItems": 1,
"title": "Curve Tenors",
"type": "array"
},
"day_count": {
"$ref": "#/$defs/input.DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"key_tenors": {
"description": "Key tenors in years, increasing",
"items": {
"exclusiveMinimum": 0,
"maximum": 100,
"type": "number",
"x-unit": "years"
},
"maxItems": 30,
"minItems": 1,
"title": "Key Tenors",
"type": "array"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"curve_tenors",
"curve_rates",
"key_tenors"
],
"title": "KeyRateInputs",
"type": "object"
},
"input.MacaulayModifiedInputs": {
"additionalProperties": false,
"description": "A bond and its yield to maturity.",
"properties": {
"calculation": {
"const": "macaulay_modified",
"default": "macaulay_modified",
"description": "Macaulay and modified duration",
"title": "Calculation",
"type": "string"
},
"coupon_rate": {
"description": "Annual coupon rate, paid in equal parts",
"maximum": 1,
"minimum": 0,
"title": "Coupon Rate",
"type": "number",
"x-unit": "rate"
},
"day_count": {
"$ref": "#/$defs/input.DayCountName",
"default": "act_act_icma",
"description": "Day count for accrued interest and stubs"
},
"end_of_month": {
"default": true,
"description": "Keep coupon dates at month ends when the maturity is one",
"title": "End Of Month",
"type": "boolean"
},
"face_value": {
"default": 100,
"description": "Face (par) value held: at 100, a price is per 100 of face value",
"maximum": 1000000000,
"minimum": 0.01,
"title": "Face Value",
"type": "number",
"x-unit": "money"
},
"first_period": {
"default": "short",
"description": "Whether an irregular first period ends at the first coupon date after the issue date (short) or at the one after that (long)",
"enum": [
"short",
"long"
],
"title": "First Period",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "semiannual",
"description": "Coupons per year (also the yield's compounding)"
},
"issue_date": {
"anyOf": [
{
"format": "date",
"type": "string",
"x-unit": "date"
},
{
"type": "null"
}
],
"default": null,
"description": "Date interest starts to accrue, when the first coupon period is irregular; omitted (null) for a regular schedule",
"title": "Issue Date"
},
"maturity": {
"description": "Maturity date: the last coupon and redemption (for a bond with n years left, n years after settlement)",
"format": "date",
"title": "Maturity",
"type": "string",
"x-unit": "date"
},
"redemption": {
"default": 100,
"description": "Amount repaid at maturity per 100 of face value",
"maximum": 200,
"minimum": 1,
"title": "Redemption",
"type": "number",
"x-unit": "money"
},
"settlement": {
"description": "Settlement date: the price is for this date",
"format": "date",
"title": "Settlement",
"type": "string",
"x-unit": "date"
},
"yield_to_maturity": {
"description": "Yield to maturity per year, compounded at the coupon frequency",
"maximum": 1,
"minimum": -0.1,
"title": "Yield To Maturity",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"settlement",
"maturity",
"coupon_rate",
"yield_to_maturity"
],
"title": "MacaulayModifiedInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "fixed_income.duration"
},
"model_version": {
"const": 2
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "Macaulay and modified duration from a yield, effective and key-rate duration off a spot curve, and DV01 of a fixed-coupon bond.",
"discriminator": {
"mapping": {
"dv01": "#/$defs/output.Dv01Outputs",
"effective": "#/$defs/output.EffectiveOutputs",
"key_rate": "#/$defs/output.KeyRateOutputs",
"macaulay_modified": "#/$defs/output.MacaulayModifiedOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.MacaulayModifiedOutputs"
},
{
"$ref": "#/$defs/output.EffectiveOutputs"
},
{
"$ref": "#/$defs/output.KeyRateOutputs"
},
{
"$ref": "#/$defs/output.Dv01Outputs"
}
],
"title": "Bond duration: outputs"
},
"output.Dv01Outputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "dv01",
"default": "dv01",
"description": "Price value of a basis point",
"title": "Calculation",
"type": "string"
},
"dv01": {
"description": "Modified duration x full price x 0.0001: the price change per basis point",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Dv01",
"type": "number",
"x-unit": "money"
},
"full_price": {
"description": "Full (dirty) price at settlement, of the face value held (per 100 by default)",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Full Price",
"type": "number",
"x-unit": "money"
},
"modified_duration": {
"description": "Modified duration",
"maximum": 200,
"minimum": 0,
"title": "Modified Duration",
"type": "number",
"x-unit": "years"
}
},
"required": [
"dv01",
"modified_duration",
"full_price"
],
"title": "Dv01Outputs",
"type": "object"
},
"output.EffectiveOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "effective",
"default": "effective",
"description": "Effective duration off a spot curve",
"title": "Calculation",
"type": "string"
},
"effective_duration": {
"description": "(P_down - P_up) / (2 P bump): relative price change per unit shift",
"maximum": 200,
"minimum": 0,
"title": "Effective Duration",
"type": "number",
"x-unit": "years"
},
"full_price": {
"description": "Full (dirty) price at settlement, of the face value held (per 100 by default)",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Full Price",
"type": "number",
"x-unit": "money"
},
"price_down": {
"description": "Full price with the curve shifted down",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Price Down",
"type": "number",
"x-unit": "money"
},
"price_up": {
"description": "Full price with the curve shifted up",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Price Up",
"type": "number",
"x-unit": "money"
}
},
"required": [
"effective_duration",
"full_price",
"price_down",
"price_up"
],
"title": "EffectiveOutputs",
"type": "object"
},
"output.KeyRateOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "key_rate",
"default": "key_rate",
"description": "Key-rate durations off a spot curve",
"title": "Calculation",
"type": "string"
},
"effective_duration": {
"description": "Duration to a parallel shift",
"maximum": 200,
"minimum": 0,
"title": "Effective Duration",
"type": "number",
"x-unit": "years"
},
"full_price": {
"description": "Full (dirty) price at settlement, of the face value held (per 100 by default)",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Full Price",
"type": "number",
"x-unit": "money"
},
"key_rate_durations": {
"description": "Duration to each key tenor's shift",
"items": {
"maximum": 200,
"minimum": 0,
"type": "number",
"x-unit": "years"
},
"maxItems": 30,
"title": "Key Rate Durations",
"type": "array"
}
},
"required": [
"key_rate_durations",
"effective_duration",
"full_price"
],
"title": "KeyRateOutputs",
"type": "object"
},
"output.MacaulayModifiedOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "macaulay_modified",
"default": "macaulay_modified",
"description": "Macaulay and modified duration",
"title": "Calculation",
"type": "string"
},
"full_price": {
"description": "Full (dirty) price at settlement, of the face value held (per 100 by default)",
"maximum": 1000000000000000,
"minimum": 0,
"title": "Full Price",
"type": "number",
"x-unit": "money"
},
"macaulay_duration": {
"description": "Present-value-weighted mean time to the payments",
"maximum": 200,
"minimum": 0,
"title": "Macaulay Duration",
"type": "number",
"x-unit": "years"
},
"modified_duration": {
"description": "Macaulay duration over 1 + y/f: the relative price change per unit of yield",
"maximum": 200,
"minimum": 0,
"title": "Modified Duration",
"type": "number",
"x-unit": "years"
}
},
"required": [
"macaulay_duration",
"modified_duration",
"full_price"
],
"title": "MacaulayModifiedOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "fixed_income.duration"
},
"model_version": {
"const": 2
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Bond duration: result",
"type": "object"
}
},
{
"description": "Holding-period, arithmetic, geometric, harmonic, annualized, log and real returns. Runs Return toolkit (foundations.returns, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: annualized, holding_period, log, means, real. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"AnnualizedInputs": {
"additionalProperties": false,
"description": "A return over some periods, and how many periods make a year.",
"properties": {
"calculation": {
"const": "annualized",
"default": "annualized",
"description": "Annualized (compounded) return",
"title": "Calculation",
"type": "string"
},
"period_return": {
"description": "Return over the whole span",
"maximum": 100,
"minimum": -1,
"title": "Period Return",
"type": "number",
"x-unit": "return"
},
"periods": {
"default": 1,
"description": "Number of periods the return spans",
"exclusiveMinimum": 0,
"maximum": 100000,
"title": "Periods",
"type": "number",
"x-unit": "periods"
},
"periods_per_year": {
"description": "Periods in a year, such as 12 or 252",
"exclusiveMinimum": 0,
"maximum": 100000,
"title": "Periods Per Year",
"type": "number",
"x-unit": "periods"
}
},
"required": [
"period_return",
"periods_per_year"
],
"title": "AnnualizedInputs",
"type": "object"
},
"HoldingPeriodInputs": {
"additionalProperties": false,
"description": "Values at the start and end of a holding period, and the income between.",
"properties": {
"beginning_value": {
"description": "Value at the start of the period",
"exclusiveMinimum": 0,
"maximum": 1000000000000,
"title": "Beginning Value",
"type": "number",
"x-unit": "money"
},
"calculation": {
"const": "holding_period",
"default": "holding_period",
"description": "Holding-period return",
"title": "Calculation",
"type": "string"
},
"ending_value": {
"description": "Value at the end of the period",
"maximum": 1000000000000,
"minimum": 0,
"title": "Ending Value",
"type": "number",
"x-unit": "money"
},
"income": {
"default": 0,
"description": "Income received during the period",
"maximum": 1000000000000,
"minimum": 0,
"title": "Income",
"type": "number",
"x-unit": "money"
}
},
"required": [
"beginning_value",
"ending_value"
],
"title": "HoldingPeriodInputs",
"type": "object"
},
"LogInputs": {
"additionalProperties": false,
"description": "A series to convert between simple and log returns.",
"properties": {
"calculation": {
"const": "log",
"default": "log",
"description": "Convert between simple and log returns",
"title": "Calculation",
"type": "string"
},
"direction": {
"default": "simple_to_log",
"description": "Which way to convert",
"enum": [
"simple_to_log",
"log_to_simple"
],
"title": "Direction",
"type": "string"
},
"returns": {
"description": "Simple returns, or log returns when direction is log_to_simple",
"items": {
"maximum": 100,
"minimum": -40,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 1,
"title": "Returns",
"type": "array"
}
},
"required": [
"returns"
],
"title": "LogInputs",
"type": "object"
},
"MeansInputs": {
"additionalProperties": false,
"description": "A series of periodic returns.",
"properties": {
"calculation": {
"const": "means",
"default": "means",
"description": "Arithmetic, geometric and harmonic means",
"title": "Calculation",
"type": "string"
},
"returns": {
"description": "Periodic returns",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 1,
"title": "Returns",
"type": "array"
}
},
"required": [
"returns"
],
"title": "MeansInputs",
"type": "object"
},
"RealInputs": {
"additionalProperties": false,
"description": "A nominal rate and the inflation over the same period.",
"properties": {
"calculation": {
"const": "real",
"default": "real",
"description": "Real rate by the exact Fisher relation",
"title": "Calculation",
"type": "string"
},
"inflation": {
"description": "Inflation rate",
"maximum": 10,
"minimum": -0.5,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"nominal": {
"description": "Nominal rate or return",
"maximum": 10,
"minimum": -0.99,
"title": "Nominal",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"nominal",
"inflation"
],
"title": "RealInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:foundations.returns:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Holding-period, arithmetic, geometric, harmonic, annualized, log and real returns.",
"discriminator": {
"mapping": {
"annualized": "#/$defs/AnnualizedInputs",
"holding_period": "#/$defs/HoldingPeriodInputs",
"log": "#/$defs/LogInputs",
"means": "#/$defs/MeansInputs",
"real": "#/$defs/RealInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"beginning_value": 100,
"calculation": "holding_period",
"ending_value": 108,
"income": 2
},
{
"calculation": "means",
"returns": [
0.1,
-0.05,
0.2
]
},
{
"calculation": "annualized",
"period_return": 0.01,
"periods": 1,
"periods_per_year": 12
},
{
"calculation": "log",
"direction": "simple_to_log",
"returns": [
0.1,
-0.05,
0.2
]
},
{
"calculation": "real",
"inflation": 0.03,
"nominal": 0.05
}
],
"oneOf": [
{
"$ref": "#/$defs/HoldingPeriodInputs"
},
{
"$ref": "#/$defs/MeansInputs"
},
{
"$ref": "#/$defs/AnnualizedInputs"
},
{
"$ref": "#/$defs/LogInputs"
},
{
"$ref": "#/$defs/RealInputs"
}
],
"title": "Return toolkit: inputs",
"type": "object"
},
"name": "foundations_returns",
"outputSchema": {
"$defs": {
"input": {
"description": "Holding-period, arithmetic, geometric, harmonic, annualized, log and real returns.",
"discriminator": {
"mapping": {
"annualized": "#/$defs/input.AnnualizedInputs",
"holding_period": "#/$defs/input.HoldingPeriodInputs",
"log": "#/$defs/input.LogInputs",
"means": "#/$defs/input.MeansInputs",
"real": "#/$defs/input.RealInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"beginning_value": 100,
"calculation": "holding_period",
"ending_value": 108,
"income": 2
},
{
"calculation": "means",
"returns": [
0.1,
-0.05,
0.2
]
},
{
"calculation": "annualized",
"period_return": 0.01,
"periods": 1,
"periods_per_year": 12
},
{
"calculation": "log",
"direction": "simple_to_log",
"returns": [
0.1,
-0.05,
0.2
]
},
{
"calculation": "real",
"inflation": 0.03,
"nominal": 0.05
}
],
"oneOf": [
{
"$ref": "#/$defs/input.HoldingPeriodInputs"
},
{
"$ref": "#/$defs/input.MeansInputs"
},
{
"$ref": "#/$defs/input.AnnualizedInputs"
},
{
"$ref": "#/$defs/input.LogInputs"
},
{
"$ref": "#/$defs/input.RealInputs"
}
],
"title": "Return toolkit: inputs"
},
"input.AnnualizedInputs": {
"additionalProperties": false,
"description": "A return over some periods, and how many periods make a year.",
"properties": {
"calculation": {
"const": "annualized",
"default": "annualized",
"description": "Annualized (compounded) return",
"title": "Calculation",
"type": "string"
},
"period_return": {
"description": "Return over the whole span",
"maximum": 100,
"minimum": -1,
"title": "Period Return",
"type": "number",
"x-unit": "return"
},
"periods": {
"default": 1,
"description": "Number of periods the return spans",
"exclusiveMinimum": 0,
"maximum": 100000,
"title": "Periods",
"type": "number",
"x-unit": "periods"
},
"periods_per_year": {
"description": "Periods in a year, such as 12 or 252",
"exclusiveMinimum": 0,
"maximum": 100000,
"title": "Periods Per Year",
"type": "number",
"x-unit": "periods"
}
},
"required": [
"period_return",
"periods_per_year"
],
"title": "AnnualizedInputs",
"type": "object"
},
"input.HoldingPeriodInputs": {
"additionalProperties": false,
"description": "Values at the start and end of a holding period, and the income between.",
"properties": {
"beginning_value": {
"description": "Value at the start of the period",
"exclusiveMinimum": 0,
"maximum": 1000000000000,
"title": "Beginning Value",
"type": "number",
"x-unit": "money"
},
"calculation": {
"const": "holding_period",
"default": "holding_period",
"description": "Holding-period return",
"title": "Calculation",
"type": "string"
},
"ending_value": {
"description": "Value at the end of the period",
"maximum": 1000000000000,
"minimum": 0,
"title": "Ending Value",
"type": "number",
"x-unit": "money"
},
"income": {
"default": 0,
"description": "Income received during the period",
"maximum": 1000000000000,
"minimum": 0,
"title": "Income",
"type": "number",
"x-unit": "money"
}
},
"required": [
"beginning_value",
"ending_value"
],
"title": "HoldingPeriodInputs",
"type": "object"
},
"input.LogInputs": {
"additionalProperties": false,
"description": "A series to convert between simple and log returns.",
"properties": {
"calculation": {
"const": "log",
"default": "log",
"description": "Convert between simple and log returns",
"title": "Calculation",
"type": "string"
},
"direction": {
"default": "simple_to_log",
"description": "Which way to convert",
"enum": [
"simple_to_log",
"log_to_simple"
],
"title": "Direction",
"type": "string"
},
"returns": {
"description": "Simple returns, or log returns when direction is log_to_simple",
"items": {
"maximum": 100,
"minimum": -40,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 1,
"title": "Returns",
"type": "array"
}
},
"required": [
"returns"
],
"title": "LogInputs",
"type": "object"
},
"input.MeansInputs": {
"additionalProperties": false,
"description": "A series of periodic returns.",
"properties": {
"calculation": {
"const": "means",
"default": "means",
"description": "Arithmetic, geometric and harmonic means",
"title": "Calculation",
"type": "string"
},
"returns": {
"description": "Periodic returns",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 1,
"title": "Returns",
"type": "array"
}
},
"required": [
"returns"
],
"title": "MeansInputs",
"type": "object"
},
"input.RealInputs": {
"additionalProperties": false,
"description": "A nominal rate and the inflation over the same period.",
"properties": {
"calculation": {
"const": "real",
"default": "real",
"description": "Real rate by the exact Fisher relation",
"title": "Calculation",
"type": "string"
},
"inflation": {
"description": "Inflation rate",
"maximum": 10,
"minimum": -0.5,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"nominal": {
"description": "Nominal rate or return",
"maximum": 10,
"minimum": -0.99,
"title": "Nominal",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"nominal",
"inflation"
],
"title": "RealInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "foundations.returns"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "Holding-period, arithmetic, geometric, harmonic, annualized, log and real returns.",
"discriminator": {
"mapping": {
"annualized": "#/$defs/output.AnnualizedOutputs",
"holding_period": "#/$defs/output.HoldingPeriodOutputs",
"log": "#/$defs/output.LogOutputs",
"means": "#/$defs/output.MeansOutputs",
"real": "#/$defs/output.RealOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.HoldingPeriodOutputs"
},
{
"$ref": "#/$defs/output.MeansOutputs"
},
{
"$ref": "#/$defs/output.AnnualizedOutputs"
},
{
"$ref": "#/$defs/output.LogOutputs"
},
{
"$ref": "#/$defs/output.RealOutputs"
}
],
"title": "Return toolkit: outputs"
},
"output.AnnualizedOutputs": {
"additionalProperties": false,
"properties": {
"annualized_return": {
"description": "Return compounded to one year",
"maximum": 100,
"minimum": -1,
"title": "Annualized Return",
"type": "number",
"x-unit": "return"
},
"calculation": {
"const": "annualized",
"default": "annualized",
"description": "Annualized (compounded) return",
"title": "Calculation",
"type": "string"
}
},
"required": [
"annualized_return"
],
"title": "AnnualizedOutputs",
"type": "object"
},
"output.HoldingPeriodOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "holding_period",
"default": "holding_period",
"description": "Holding-period return",
"title": "Calculation",
"type": "string"
},
"holding_period_return": {
"description": "Return over the holding period",
"maximum": 100,
"minimum": -1,
"title": "Holding Period Return",
"type": "number",
"x-unit": "return"
},
"income_return": {
"description": "Part of the return from income",
"maximum": 100,
"minimum": -1,
"title": "Income Return",
"type": "number",
"x-unit": "return"
},
"price_return": {
"description": "Part of the return from the change in value",
"maximum": 100,
"minimum": -1,
"title": "Price Return",
"type": "number",
"x-unit": "return"
}
},
"required": [
"holding_period_return",
"income_return",
"price_return"
],
"title": "HoldingPeriodOutputs",
"type": "object"
},
"output.LogOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "log",
"default": "log",
"description": "Convert between simple and log returns",
"title": "Calculation",
"type": "string"
},
"converted": {
"description": "The converted returns, in order",
"items": {
"maximum": 100,
"minimum": -40,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"title": "Converted",
"type": "array"
}
},
"required": [
"converted"
],
"title": "LogOutputs",
"type": "object"
},
"output.MeansOutputs": {
"additionalProperties": false,
"properties": {
"arithmetic": {
"description": "Arithmetic mean return",
"maximum": 100,
"minimum": -1,
"title": "Arithmetic",
"type": "number",
"x-unit": "return"
},
"calculation": {
"const": "means",
"default": "means",
"description": "Arithmetic, geometric and harmonic means",
"title": "Calculation",
"type": "string"
},
"geometric": {
"description": "Geometric mean return, of the gross returns",
"maximum": 100,
"minimum": -1,
"title": "Geometric",
"type": "number",
"x-unit": "return"
},
"harmonic": {
"description": "Harmonic mean return, of the gross returns",
"maximum": 100,
"minimum": -1,
"title": "Harmonic",
"type": "number",
"x-unit": "return"
},
"observations": {
"description": "Number of returns",
"maximum": 10080,
"minimum": 1,
"title": "Observations",
"type": "integer",
"x-unit": "count"
}
},
"required": [
"arithmetic",
"geometric",
"harmonic",
"observations"
],
"title": "MeansOutputs",
"type": "object"
},
"output.RealOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "real",
"default": "real",
"description": "Real rate by the exact Fisher relation",
"title": "Calculation",
"type": "string"
},
"real": {
"description": "Real rate: (1 + nominal) / (1 + inflation) - 1",
"maximum": 100,
"minimum": -1,
"title": "Real",
"type": "number",
"x-unit": "return"
}
},
"required": [
"real"
],
"title": "RealOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "foundations.returns"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Return toolkit: result",
"type": "object"
}
},
{
"description": "Present and future values of sums, annuities and perpetuities, the five-key solve, NPV, IRR, XNPV, XIRR and amortization schedules. Runs Time value of money (foundations.time_value, version 2) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: amortization, future_value, irr, npv, present_value, solve, xirr, xnpv. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"AmortizationInputs": {
"additionalProperties": false,
"description": "A loan repaid in level payments at the end of each period.",
"properties": {
"calculation": {
"const": "amortization",
"default": "amortization",
"description": "Level-payment amortization schedule",
"title": "Calculation",
"type": "string"
},
"periods": {
"description": "Number of payments",
"maximum": 1200,
"minimum": 1,
"title": "Periods",
"type": "integer",
"x-unit": "count"
},
"principal": {
"description": "Amount borrowed",
"exclusiveMinimum": 0,
"maximum": 1000000000000,
"title": "Principal",
"type": "number",
"x-unit": "money"
},
"rate": {
"description": "Interest rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"principal",
"rate",
"periods"
],
"title": "AmortizationInputs",
"type": "object"
},
"FutureValueInputs": {
"additionalProperties": false,
"description": "The future value of a sum, an annuity and a growing annuity together.",
"properties": {
"calculation": {
"const": "future_value",
"default": "future_value",
"description": "Compound a sum and a stream of payments",
"title": "Calculation",
"type": "string"
},
"due": {
"default": false,
"description": "Payments at the start of each period (an annuity due)",
"title": "Due",
"type": "boolean"
},
"growth": {
"default": 0,
"description": "Growth of each payment over the last, per period",
"maximum": 1,
"minimum": -0.99,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"payment": {
"default": 0,
"description": "First payment of the stream (0 for none)",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Payment",
"type": "number",
"x-unit": "money"
},
"periods": {
"description": "Number of periods",
"maximum": 1200,
"minimum": 0,
"title": "Periods",
"type": "number",
"x-unit": "periods"
},
"present_value": {
"default": 0,
"description": "Single sum invested now (0 for none)",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Present Value",
"type": "number",
"x-unit": "money"
},
"rate": {
"description": "Interest rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"rate",
"periods"
],
"title": "FutureValueInputs",
"type": "object"
},
"IrrInputs": {
"additionalProperties": false,
"description": "Periodic cash flows.",
"properties": {
"calculation": {
"const": "irr",
"default": "irr",
"description": "Internal rate of return",
"title": "Calculation",
"type": "string"
},
"cash_flows": {
"description": "Cash flows at times 0, 1, 2, ... periods",
"items": {
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1201,
"minItems": 1,
"title": "Cash Flows",
"type": "array"
}
},
"required": [
"cash_flows"
],
"title": "IrrInputs",
"type": "object"
},
"NpvInputs": {
"additionalProperties": false,
"description": "Periodic cash flows and a discount rate.",
"properties": {
"calculation": {
"const": "npv",
"default": "npv",
"description": "Net present value",
"title": "Calculation",
"type": "string"
},
"cash_flows": {
"description": "Cash flows at times 0, 1, 2, ... periods; the first is not discounted",
"items": {
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1201,
"minItems": 1,
"title": "Cash Flows",
"type": "array"
},
"rate": {
"description": "Discount rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"rate",
"cash_flows"
],
"title": "NpvInputs",
"type": "object"
},
"PresentValueInputs": {
"additionalProperties": false,
"description": "The present value of a sum, an annuity and a growing annuity together.",
"properties": {
"calculation": {
"const": "present_value",
"default": "present_value",
"description": "Discount a sum and a stream of payments",
"title": "Calculation",
"type": "string"
},
"due": {
"default": false,
"description": "Payments at the start of each period (an annuity due)",
"title": "Due",
"type": "boolean"
},
"future_value": {
"default": 0,
"description": "Single sum at the end of the last period (0 for none)",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Future Value",
"type": "number",
"x-unit": "money"
},
"growth": {
"default": 0,
"description": "Growth of each payment over the last, per period",
"maximum": 1,
"minimum": -0.99,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"payment": {
"default": 0,
"description": "First payment of the stream (0 for none)",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Payment",
"type": "number",
"x-unit": "money"
},
"periods": {
"anyOf": [
{
"maximum": 1200,
"minimum": 0,
"type": "number",
"x-unit": "periods"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of periods; omitted (null) for a perpetuity",
"title": "Periods"
},
"rate": {
"description": "Discount rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"rate"
],
"title": "PresentValueInputs",
"type": "object"
},
"SolveInputs": {
"additionalProperties": false,
"description": "The five-key equation, with exactly one of its five terms omitted.",
"properties": {
"calculation": {
"const": "solve",
"default": "solve",
"description": "Solve the time-value equation for the omitted term",
"title": "Calculation",
"type": "string"
},
"due": {
"default": false,
"description": "Payments at the start of each period",
"title": "Due",
"type": "boolean"
},
"future_value": {
"anyOf": [
{
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
{
"type": "null"
}
],
"default": null,
"description": "Cash flow at the end (FV); negative when paid out",
"title": "Future Value"
},
"payment": {
"anyOf": [
{
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
{
"type": "null"
}
],
"default": null,
"description": "Level cash flow each period (PMT); negative when paid out",
"title": "Payment"
},
"periods": {
"anyOf": [
{
"maximum": 1200,
"minimum": 0,
"type": "number",
"x-unit": "periods"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of periods (N)",
"title": "Periods"
},
"present_value": {
"anyOf": [
{
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
{
"type": "null"
}
],
"default": null,
"description": "Cash flow now (PV); negative when paid out",
"title": "Present Value"
},
"rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.99,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Interest rate per period (I/Y)",
"title": "Rate"
}
},
"title": "SolveInputs",
"type": "object"
},
"XirrInputs": {
"additionalProperties": false,
"description": "Dated cash flows.",
"properties": {
"calculation": {
"const": "xirr",
"default": "xirr",
"description": "Internal rate of return of dated cash flows",
"title": "Calculation",
"type": "string"
},
"cash_flows": {
"description": "Cash flows, one per date",
"items": {
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1000,
"minItems": 1,
"title": "Cash Flows",
"type": "array"
},
"dates": {
"description": "The date of each cash flow; the first is the base date",
"items": {
"format": "date",
"type": "string",
"x-unit": "date"
},
"maxItems": 1000,
"minItems": 1,
"title": "Dates",
"type": "array"
}
},
"required": [
"cash_flows",
"dates"
],
"title": "XirrInputs",
"type": "object"
},
"XnpvInputs": {
"additionalProperties": false,
"description": "Dated cash flows and an annual discount rate.",
"properties": {
"calculation": {
"const": "xnpv",
"default": "xnpv",
"description": "Net present value of dated cash flows",
"title": "Calculation",
"type": "string"
},
"cash_flows": {
"description": "Cash flows, one per date",
"items": {
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1000,
"minItems": 1,
"title": "Cash Flows",
"type": "array"
},
"dates": {
"description": "The date of each cash flow; the first is the base date",
"items": {
"format": "date",
"type": "string",
"x-unit": "date"
},
"maxItems": 1000,
"minItems": 1,
"title": "Dates",
"type": "array"
},
"rate": {
"description": "Annual discount rate",
"maximum": 10,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"cash_flows",
"dates",
"rate"
],
"title": "XnpvInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:foundations.time_value:2:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Present and future values of sums, annuities and perpetuities, the five-key solve, NPV, IRR, XNPV, XIRR and amortization schedules.",
"discriminator": {
"mapping": {
"amortization": "#/$defs/AmortizationInputs",
"future_value": "#/$defs/FutureValueInputs",
"irr": "#/$defs/IrrInputs",
"npv": "#/$defs/NpvInputs",
"present_value": "#/$defs/PresentValueInputs",
"solve": "#/$defs/SolveInputs",
"xirr": "#/$defs/XirrInputs",
"xnpv": "#/$defs/XnpvInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "present_value",
"due": false,
"future_value": 0,
"growth": 0,
"payment": 500,
"periods": 240,
"rate": 0.006666666666666667
},
{
"calculation": "future_value",
"due": true,
"growth": 0,
"payment": 200,
"periods": 10,
"present_value": 500,
"rate": 0.005
},
{
"calculation": "solve",
"due": false,
"future_value": 0,
"payment": -200,
"periods": 48,
"present_value": 8000,
"rate": null
},
{
"calculation": "npv",
"cash_flows": [
-70000,
12000,
15000,
18000,
21000,
26000
],
"rate": 0.1
},
{
"calculation": "irr",
"cash_flows": [
-70000,
12000,
15000,
18000,
21000,
26000
]
},
{
"calculation": "xnpv",
"cash_flows": [
-10000,
2750,
4250,
3250,
2750
],
"dates": [
"2008-01-01",
"2008-03-01",
"2008-10-30",
"2009-02-15",
"2009-04-01"
],
"rate": 0.09
},
{
"calculation": "xirr",
"cash_flows": [
-10000,
2750,
4250,
3250,
2750
],
"dates": [
"2008-01-01",
"2008-03-01",
"2008-10-30",
"2009-02-15",
"2009-04-01"
]
},
{
"calculation": "amortization",
"periods": 10,
"principal": 10000,
"rate": 0.006666666666666667
}
],
"oneOf": [
{
"$ref": "#/$defs/PresentValueInputs"
},
{
"$ref": "#/$defs/FutureValueInputs"
},
{
"$ref": "#/$defs/SolveInputs"
},
{
"$ref": "#/$defs/NpvInputs"
},
{
"$ref": "#/$defs/IrrInputs"
},
{
"$ref": "#/$defs/XnpvInputs"
},
{
"$ref": "#/$defs/XirrInputs"
},
{
"$ref": "#/$defs/AmortizationInputs"
}
],
"title": "Time value of money: inputs",
"type": "object"
},
"name": "foundations_time_value",
"outputSchema": {
"$defs": {
"input": {
"description": "Present and future values of sums, annuities and perpetuities, the five-key solve, NPV, IRR, XNPV, XIRR and amortization schedules.",
"discriminator": {
"mapping": {
"amortization": "#/$defs/input.AmortizationInputs",
"future_value": "#/$defs/input.FutureValueInputs",
"irr": "#/$defs/input.IrrInputs",
"npv": "#/$defs/input.NpvInputs",
"present_value": "#/$defs/input.PresentValueInputs",
"solve": "#/$defs/input.SolveInputs",
"xirr": "#/$defs/input.XirrInputs",
"xnpv": "#/$defs/input.XnpvInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "present_value",
"due": false,
"future_value": 0,
"growth": 0,
"payment": 500,
"periods": 240,
"rate": 0.006666666666666667
},
{
"calculation": "future_value",
"due": true,
"growth": 0,
"payment": 200,
"periods": 10,
"present_value": 500,
"rate": 0.005
},
{
"calculation": "solve",
"due": false,
"future_value": 0,
"payment": -200,
"periods": 48,
"present_value": 8000,
"rate": null
},
{
"calculation": "npv",
"cash_flows": [
-70000,
12000,
15000,
18000,
21000,
26000
],
"rate": 0.1
},
{
"calculation": "irr",
"cash_flows": [
-70000,
12000,
15000,
18000,
21000,
26000
]
},
{
"calculation": "xnpv",
"cash_flows": [
-10000,
2750,
4250,
3250,
2750
],
"dates": [
"2008-01-01",
"2008-03-01",
"2008-10-30",
"2009-02-15",
"2009-04-01"
],
"rate": 0.09
},
{
"calculation": "xirr",
"cash_flows": [
-10000,
2750,
4250,
3250,
2750
],
"dates": [
"2008-01-01",
"2008-03-01",
"2008-10-30",
"2009-02-15",
"2009-04-01"
]
},
{
"calculation": "amortization",
"periods": 10,
"principal": 10000,
"rate": 0.006666666666666667
}
],
"oneOf": [
{
"$ref": "#/$defs/input.PresentValueInputs"
},
{
"$ref": "#/$defs/input.FutureValueInputs"
},
{
"$ref": "#/$defs/input.SolveInputs"
},
{
"$ref": "#/$defs/input.NpvInputs"
},
{
"$ref": "#/$defs/input.IrrInputs"
},
{
"$ref": "#/$defs/input.XnpvInputs"
},
{
"$ref": "#/$defs/input.XirrInputs"
},
{
"$ref": "#/$defs/input.AmortizationInputs"
}
],
"title": "Time value of money: inputs"
},
"input.AmortizationInputs": {
"additionalProperties": false,
"description": "A loan repaid in level payments at the end of each period.",
"properties": {
"calculation": {
"const": "amortization",
"default": "amortization",
"description": "Level-payment amortization schedule",
"title": "Calculation",
"type": "string"
},
"periods": {
"description": "Number of payments",
"maximum": 1200,
"minimum": 1,
"title": "Periods",
"type": "integer",
"x-unit": "count"
},
"principal": {
"description": "Amount borrowed",
"exclusiveMinimum": 0,
"maximum": 1000000000000,
"title": "Principal",
"type": "number",
"x-unit": "money"
},
"rate": {
"description": "Interest rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"principal",
"rate",
"periods"
],
"title": "AmortizationInputs",
"type": "object"
},
"input.FutureValueInputs": {
"additionalProperties": false,
"description": "The future value of a sum, an annuity and a growing annuity together.",
"properties": {
"calculation": {
"const": "future_value",
"default": "future_value",
"description": "Compound a sum and a stream of payments",
"title": "Calculation",
"type": "string"
},
"due": {
"default": false,
"description": "Payments at the start of each period (an annuity due)",
"title": "Due",
"type": "boolean"
},
"growth": {
"default": 0,
"description": "Growth of each payment over the last, per period",
"maximum": 1,
"minimum": -0.99,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"payment": {
"default": 0,
"description": "First payment of the stream (0 for none)",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Payment",
"type": "number",
"x-unit": "money"
},
"periods": {
"description": "Number of periods",
"maximum": 1200,
"minimum": 0,
"title": "Periods",
"type": "number",
"x-unit": "periods"
},
"present_value": {
"default": 0,
"description": "Single sum invested now (0 for none)",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Present Value",
"type": "number",
"x-unit": "money"
},
"rate": {
"description": "Interest rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"rate",
"periods"
],
"title": "FutureValueInputs",
"type": "object"
},
"input.IrrInputs": {
"additionalProperties": false,
"description": "Periodic cash flows.",
"properties": {
"calculation": {
"const": "irr",
"default": "irr",
"description": "Internal rate of return",
"title": "Calculation",
"type": "string"
},
"cash_flows": {
"description": "Cash flows at times 0, 1, 2, ... periods",
"items": {
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1201,
"minItems": 1,
"title": "Cash Flows",
"type": "array"
}
},
"required": [
"cash_flows"
],
"title": "IrrInputs",
"type": "object"
},
"input.NpvInputs": {
"additionalProperties": false,
"description": "Periodic cash flows and a discount rate.",
"properties": {
"calculation": {
"const": "npv",
"default": "npv",
"description": "Net present value",
"title": "Calculation",
"type": "string"
},
"cash_flows": {
"description": "Cash flows at times 0, 1, 2, ... periods; the first is not discounted",
"items": {
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1201,
"minItems": 1,
"title": "Cash Flows",
"type": "array"
},
"rate": {
"description": "Discount rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"rate",
"cash_flows"
],
"title": "NpvInputs",
"type": "object"
},
"input.PresentValueInputs": {
"additionalProperties": false,
"description": "The present value of a sum, an annuity and a growing annuity together.",
"properties": {
"calculation": {
"const": "present_value",
"default": "present_value",
"description": "Discount a sum and a stream of payments",
"title": "Calculation",
"type": "string"
},
"due": {
"default": false,
"description": "Payments at the start of each period (an annuity due)",
"title": "Due",
"type": "boolean"
},
"future_value": {
"default": 0,
"description": "Single sum at the end of the last period (0 for none)",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Future Value",
"type": "number",
"x-unit": "money"
},
"growth": {
"default": 0,
"description": "Growth of each payment over the last, per period",
"maximum": 1,
"minimum": -0.99,
"title": "Growth",
"type": "number",
"x-unit": "rate"
},
"payment": {
"default": 0,
"description": "First payment of the stream (0 for none)",
"maximum": 1000000000000,
"minimum": -1000000000000,
"title": "Payment",
"type": "number",
"x-unit": "money"
},
"periods": {
"anyOf": [
{
"maximum": 1200,
"minimum": 0,
"type": "number",
"x-unit": "periods"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of periods; omitted (null) for a perpetuity",
"title": "Periods"
},
"rate": {
"description": "Discount rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"rate"
],
"title": "PresentValueInputs",
"type": "object"
},
"input.SolveInputs": {
"additionalProperties": false,
"description": "The five-key equation, with exactly one of its five terms omitted.",
"properties": {
"calculation": {
"const": "solve",
"default": "solve",
"description": "Solve the time-value equation for the omitted term",
"title": "Calculation",
"type": "string"
},
"due": {
"default": false,
"description": "Payments at the start of each period",
"title": "Due",
"type": "boolean"
},
"future_value": {
"anyOf": [
{
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
{
"type": "null"
}
],
"default": null,
"description": "Cash flow at the end (FV); negative when paid out",
"title": "Future Value"
},
"payment": {
"anyOf": [
{
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
{
"type": "null"
}
],
"default": null,
"description": "Level cash flow each period (PMT); negative when paid out",
"title": "Payment"
},
"periods": {
"anyOf": [
{
"maximum": 1200,
"minimum": 0,
"type": "number",
"x-unit": "periods"
},
{
"type": "null"
}
],
"default": null,
"description": "Number of periods (N)",
"title": "Periods"
},
"present_value": {
"anyOf": [
{
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
{
"type": "null"
}
],
"default": null,
"description": "Cash flow now (PV); negative when paid out",
"title": "Present Value"
},
"rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.99,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Interest rate per period (I/Y)",
"title": "Rate"
}
},
"title": "SolveInputs",
"type": "object"
},
"input.XirrInputs": {
"additionalProperties": false,
"description": "Dated cash flows.",
"properties": {
"calculation": {
"const": "xirr",
"default": "xirr",
"description": "Internal rate of return of dated cash flows",
"title": "Calculation",
"type": "string"
},
"cash_flows": {
"description": "Cash flows, one per date",
"items": {
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1000,
"minItems": 1,
"title": "Cash Flows",
"type": "array"
},
"dates": {
"description": "The date of each cash flow; the first is the base date",
"items": {
"format": "date",
"type": "string",
"x-unit": "date"
},
"maxItems": 1000,
"minItems": 1,
"title": "Dates",
"type": "array"
}
},
"required": [
"cash_flows",
"dates"
],
"title": "XirrInputs",
"type": "object"
},
"input.XnpvInputs": {
"additionalProperties": false,
"description": "Dated cash flows and an annual discount rate.",
"properties": {
"calculation": {
"const": "xnpv",
"default": "xnpv",
"description": "Net present value of dated cash flows",
"title": "Calculation",
"type": "string"
},
"cash_flows": {
"description": "Cash flows, one per date",
"items": {
"maximum": 1000000000000,
"minimum": -1000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1000,
"minItems": 1,
"title": "Cash Flows",
"type": "array"
},
"dates": {
"description": "The date of each cash flow; the first is the base date",
"items": {
"format": "date",
"type": "string",
"x-unit": "date"
},
"maxItems": 1000,
"minItems": 1,
"title": "Dates",
"type": "array"
},
"rate": {
"description": "Annual discount rate",
"maximum": 10,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"cash_flows",
"dates",
"rate"
],
"title": "XnpvInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "foundations.time_value"
},
"model_version": {
"const": 2
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "Present and future values of sums, annuities and perpetuities, the five-key solve, NPV, IRR, XNPV, XIRR and amortization schedules.",
"discriminator": {
"mapping": {
"amortization": "#/$defs/output.AmortizationOutputs",
"future_value": "#/$defs/output.FutureValueOutputs",
"irr": "#/$defs/output.IrrOutputs",
"npv": "#/$defs/output.NpvOutputs",
"present_value": "#/$defs/output.PresentValueOutputs",
"solve": "#/$defs/output.SolveOutputs",
"xirr": "#/$defs/output.XirrOutputs",
"xnpv": "#/$defs/output.XnpvOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.PresentValueOutputs"
},
{
"$ref": "#/$defs/output.FutureValueOutputs"
},
{
"$ref": "#/$defs/output.SolveOutputs"
},
{
"$ref": "#/$defs/output.NpvOutputs"
},
{
"$ref": "#/$defs/output.IrrOutputs"
},
{
"$ref": "#/$defs/output.XnpvOutputs"
},
{
"$ref": "#/$defs/output.XirrOutputs"
},
{
"$ref": "#/$defs/output.AmortizationOutputs"
}
],
"title": "Time value of money: outputs"
},
"output.AmortizationOutputs": {
"additionalProperties": false,
"properties": {
"balance": {
"description": "Balance after each payment",
"items": {
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1200,
"title": "Balance",
"type": "array"
},
"calculation": {
"const": "amortization",
"default": "amortization",
"description": "Level-payment amortization schedule",
"title": "Calculation",
"type": "string"
},
"interest": {
"description": "Interest part of each payment",
"items": {
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1200,
"title": "Interest",
"type": "array"
},
"level_payment": {
"description": "The level payment each period",
"maximum": 2000000000000,
"minimum": 0,
"title": "Level Payment",
"type": "number",
"x-unit": "money"
},
"payment": {
"description": "Payment in each period",
"items": {
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1200,
"title": "Payment",
"type": "array"
},
"period": {
"description": "Payment numbers, 1 to n",
"items": {
"maximum": 1200,
"minimum": 1,
"type": "integer",
"x-unit": "count"
},
"maxItems": 1200,
"title": "Period",
"type": "array"
},
"principal": {
"description": "Principal part of each payment",
"items": {
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"type": "number",
"x-unit": "money"
},
"maxItems": 1200,
"title": "Principal",
"type": "array"
},
"total_interest": {
"description": "Interest paid over the loan",
"maximum": 2400000000000000,
"minimum": -2000000000000,
"title": "Total Interest",
"type": "number",
"x-unit": "money"
}
},
"required": [
"level_payment",
"total_interest",
"period",
"payment",
"interest",
"principal",
"balance"
],
"title": "AmortizationOutputs",
"type": "object"
},
"output.FutureValueOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "future_value",
"default": "future_value",
"description": "Compound a sum and a stream of payments",
"title": "Calculation",
"type": "string"
},
"future_value": {
"description": "Future value of the sum and the payments",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Future Value",
"type": "number",
"x-unit": "money"
}
},
"required": [
"future_value"
],
"title": "FutureValueOutputs",
"type": "object"
},
"output.IrrOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "irr",
"default": "irr",
"description": "Internal rate of return",
"title": "Calculation",
"type": "string"
},
"irr": {
"anyOf": [
{
"maximum": 10,
"minimum": -0.99,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"description": "Rate per period at which the NPV is zero; null when undefined",
"title": "Irr"
},
"sign_changes": {
"description": "Sign changes in the cash flows",
"maximum": 1201,
"minimum": 0,
"title": "Sign Changes",
"type": "integer",
"x-unit": "count"
}
},
"required": [
"irr",
"sign_changes"
],
"title": "IrrOutputs",
"type": "object"
},
"output.NpvOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "npv",
"default": "npv",
"description": "Net present value",
"title": "Calculation",
"type": "string"
},
"npv": {
"description": "Net present value at time 0",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Npv",
"type": "number",
"x-unit": "money"
}
},
"required": [
"npv"
],
"title": "NpvOutputs",
"type": "object"
},
"output.PresentValueOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "present_value",
"default": "present_value",
"description": "Discount a sum and a stream of payments",
"title": "Calculation",
"type": "string"
},
"present_value": {
"description": "Present value of the sum and the payments",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Present Value",
"type": "number",
"x-unit": "money"
}
},
"required": [
"present_value"
],
"title": "PresentValueOutputs",
"type": "object"
},
"output.Solvable": {
"enum": [
"periods",
"rate",
"present_value",
"payment",
"future_value"
],
"type": "string"
},
"output.SolveOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "solve",
"default": "solve",
"description": "Solve the time-value equation for the omitted term",
"title": "Calculation",
"type": "string"
},
"future_value": {
"description": "Cash flow at the end (FV)",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Future Value",
"type": "number",
"x-unit": "money"
},
"payment": {
"description": "Level cash flow each period (PMT)",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Payment",
"type": "number",
"x-unit": "money"
},
"periods": {
"description": "Number of periods (N)",
"maximum": 1200,
"minimum": 0,
"title": "Periods",
"type": "number",
"x-unit": "periods"
},
"present_value": {
"description": "Cash flow now (PV)",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Present Value",
"type": "number",
"x-unit": "money"
},
"rate": {
"description": "Interest rate per period",
"maximum": 1,
"minimum": -0.99,
"title": "Rate",
"type": "number",
"x-unit": "rate"
},
"solved_for": {
"$ref": "#/$defs/output.Solvable",
"description": "The term that was omitted and solved"
}
},
"required": [
"solved_for",
"periods",
"rate",
"present_value",
"payment",
"future_value"
],
"title": "SolveOutputs",
"type": "object"
},
"output.XirrOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "xirr",
"default": "xirr",
"description": "Internal rate of return of dated cash flows",
"title": "Calculation",
"type": "string"
},
"sign_changes": {
"description": "Sign changes in the cash flows",
"maximum": 1000,
"minimum": 0,
"title": "Sign Changes",
"type": "integer",
"x-unit": "count"
},
"xirr": {
"anyOf": [
{
"maximum": 10,
"minimum": -0.99,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"description": "Annual rate at which the XNPV is zero; null when undefined",
"title": "Xirr"
}
},
"required": [
"xirr",
"sign_changes"
],
"title": "XirrOutputs",
"type": "object"
},
"output.XnpvOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "xnpv",
"default": "xnpv",
"description": "Net present value of dated cash flows",
"title": "Calculation",
"type": "string"
},
"xnpv": {
"description": "Net present value at the first date",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Xnpv",
"type": "number",
"x-unit": "money"
}
},
"required": [
"xnpv"
],
"title": "XnpvOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "foundations.time_value"
},
"model_version": {
"const": 2
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Time value of money: result",
"type": "object"
}
},
{
"description": "Reads a series from the data catalog (a concept id) or from one provider (provider:series), with its source records and the attributions it must be shown with: at most the server's limit of observations, the most recent ones, optionally transformed (a change, a year-over-year change, a difference, a lag, a logarithm or a frequency conversion). Data whose terms do not let it reach an AI assistant is never returned.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "The series to read.",
"properties": {
"as_of": {
"description": "Read the data as published on this date.",
"format": "date",
"type": "string"
},
"end": {
"description": "The last observation date wanted.",
"format": "date",
"type": "string"
},
"provider": {
"description": "For a concept, only this provider's candidates.",
"type": "string"
},
"start": {
"description": "The first observation date wanted.",
"format": "date",
"type": "string"
},
"target": {
"description": "A catalog concept id (such as us.unemployment.rate) or provider:series (such as bls:LNS14000000).",
"maxLength": 256,
"minLength": 1,
"type": "string"
},
"transform": {
"description": "Apply one transform to the series: pct_change, yoy, diff, lag, log, convert, with its arguments, such as pct_change(periods=12) or convert(to=annual,method=mean). Each source record lists it.",
"maxLength": 256,
"minLength": 1,
"type": "string"
},
"vintage": {
"description": "A vintage label: latest, first_release, all or as_of:YYYY-MM-DD.",
"type": "string"
}
},
"required": [
"target"
],
"title": "get_series: inputs",
"type": "object"
},
"name": "get_series",
"outputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "The frame the target resolved to, with its source records, the candidates passed over, and the attributions it must be shown with.",
"properties": {
"attributions": {
"items": {
"type": "string"
},
"type": "array"
},
"concept": {
"type": [
"string",
"null"
]
},
"frame": {
"type": "object"
},
"skipped": {
"items": {
"type": "object"
},
"type": "array"
},
"sources": {
"items": {
"type": "object"
},
"type": "array"
}
},
"required": [
"attributions",
"concept",
"frame",
"skipped",
"sources"
],
"title": "get_series: result",
"type": "object"
}
},
{
"description": "Covered and uncovered interest parity, relative and absolute purchasing power parity, the international Fisher effect and real exchange rates. Runs International parity conditions (international.parity_conditions, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: absolute_ppp, covered_interest_parity, international_fisher, real_exchange_rate, relative_ppp, uncovered_interest_parity. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"AbsolutePppInputs": {
"additionalProperties": false,
"description": "A basket's price in each currency, and the spot rate.",
"properties": {
"base_price": {
"description": "Basket's price in the base currency",
"maximum": 10000000,
"minimum": 0.01,
"title": "Base Price",
"type": "number",
"x-unit": "money"
},
"calculation": {
"const": "absolute_ppp",
"default": "absolute_ppp",
"description": "Exchange rate by absolute purchasing power",
"title": "Calculation",
"type": "string"
},
"quote_price": {
"description": "Basket's price in the quote currency",
"maximum": 10000000,
"minimum": 0.01,
"title": "Quote Price",
"type": "number",
"x-unit": "money"
},
"spot": {
"description": "Spot exchange rate, in units of the quote currency per unit of the base currency",
"maximum": 1000000,
"minimum": 0.000001,
"title": "Spot",
"type": "number",
"x-unit": "ratio"
}
},
"required": [
"quote_price",
"base_price",
"spot"
],
"title": "AbsolutePppInputs",
"type": "object"
},
"CoveredInputs": {
"additionalProperties": false,
"description": "A spot rate and each currency's interest rate.",
"properties": {
"base_rate": {
"description": "Nominal interest rate of the base currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Base Rate",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "covered_interest_parity",
"default": "covered_interest_parity",
"description": "Forward rate by covered parity",
"title": "Calculation",
"type": "string"
},
"compounding": {
"default": "periodic",
"description": "How both rates compound over the horizon",
"enum": [
"simple",
"periodic",
"continuous"
],
"title": "Compounding",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "annual",
"description": "Compounding frequency of periodic rates"
},
"quote_rate": {
"description": "Nominal interest rate of the quote currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Quote Rate",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Spot exchange rate, in units of the quote currency per unit of the base currency",
"maximum": 1000000,
"minimum": 0.000001,
"title": "Spot",
"type": "number",
"x-unit": "ratio"
},
"years": {
"description": "Horizon in years",
"exclusiveMinimum": 0,
"maximum": 10,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"quote_rate",
"base_rate",
"years"
],
"title": "CoveredInputs",
"type": "object"
},
"FrequencyName": {
"enum": [
"annual",
"semiannual",
"quarterly",
"monthly"
],
"type": "string"
},
"InternationalFisherInputs": {
"additionalProperties": false,
"description": "Each currency's nominal rate and expected inflation.",
"properties": {
"base_inflation": {
"description": "Inflation per year in the base currency's economy",
"maximum": 1,
"minimum": -0.2,
"title": "Base Inflation",
"type": "number",
"x-unit": "rate"
},
"base_rate": {
"description": "Nominal interest rate of the base currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Base Rate",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "international_fisher",
"default": "international_fisher",
"description": "Real rates and the expected change",
"title": "Calculation",
"type": "string"
},
"quote_inflation": {
"description": "Inflation per year in the quote currency's economy",
"maximum": 1,
"minimum": -0.2,
"title": "Quote Inflation",
"type": "number",
"x-unit": "rate"
},
"quote_rate": {
"description": "Nominal interest rate of the quote currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Quote Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"quote_rate",
"base_rate",
"quote_inflation",
"base_inflation"
],
"title": "InternationalFisherInputs",
"type": "object"
},
"RealExchangeRateInputs": {
"additionalProperties": false,
"description": "A spot rate, each economy's price level, and a period's changes.",
"properties": {
"base_inflation": {
"default": 0,
"description": "Inflation in the base economy over it",
"maximum": 10,
"minimum": -0.5,
"title": "Base Inflation",
"type": "number",
"x-unit": "return"
},
"base_price_level": {
"description": "Price index of the base economy",
"maximum": 10000000,
"minimum": 0.01,
"title": "Base Price Level",
"type": "number",
"x-unit": "index_level"
},
"calculation": {
"const": "real_exchange_rate",
"default": "real_exchange_rate",
"description": "Real exchange rate and its change",
"title": "Calculation",
"type": "string"
},
"quote_inflation": {
"default": 0,
"description": "Inflation in the quote economy over it",
"maximum": 10,
"minimum": -0.5,
"title": "Quote Inflation",
"type": "number",
"x-unit": "return"
},
"quote_price_level": {
"description": "Price index of the quote economy",
"maximum": 10000000,
"minimum": 0.01,
"title": "Quote Price Level",
"type": "number",
"x-unit": "index_level"
},
"spot": {
"description": "Spot exchange rate, in units of the quote currency per unit of the base currency",
"maximum": 1000000,
"minimum": 0.000001,
"title": "Spot",
"type": "number",
"x-unit": "ratio"
},
"spot_change": {
"default": 0,
"description": "Change in the spot rate over the period",
"maximum": 10,
"minimum": -0.9,
"title": "Spot Change",
"type": "number",
"x-unit": "return"
}
},
"required": [
"spot",
"quote_price_level",
"base_price_level"
],
"title": "RealExchangeRateInputs",
"type": "object"
},
"RelativePppInputs": {
"additionalProperties": false,
"description": "A spot rate and each economy's expected inflation.",
"properties": {
"base_inflation": {
"description": "Inflation per year in the base currency's economy",
"maximum": 1,
"minimum": -0.2,
"title": "Base Inflation",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "relative_ppp",
"default": "relative_ppp",
"description": "Expected spot by relative purchasing power",
"title": "Calculation",
"type": "string"
},
"quote_inflation": {
"description": "Inflation per year in the quote currency's economy",
"maximum": 1,
"minimum": -0.2,
"title": "Quote Inflation",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Spot exchange rate, in units of the quote currency per unit of the base currency",
"maximum": 1000000,
"minimum": 0.000001,
"title": "Spot",
"type": "number",
"x-unit": "ratio"
},
"years": {
"description": "Horizon in years",
"exclusiveMinimum": 0,
"maximum": 10,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"quote_inflation",
"base_inflation",
"years"
],
"title": "RelativePppInputs",
"type": "object"
},
"UncoveredInputs": {
"additionalProperties": false,
"description": "A spot rate and each currency's interest rate.",
"properties": {
"base_rate": {
"description": "Nominal interest rate of the base currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Base Rate",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "uncovered_interest_parity",
"default": "uncovered_interest_parity",
"description": "Expected spot by uncovered parity",
"title": "Calculation",
"type": "string"
},
"compounding": {
"default": "periodic",
"description": "How both rates compound over the horizon",
"enum": [
"simple",
"periodic",
"continuous"
],
"title": "Compounding",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/FrequencyName",
"default": "annual",
"description": "Compounding frequency of periodic rates"
},
"quote_rate": {
"description": "Nominal interest rate of the quote currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Quote Rate",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Spot exchange rate, in units of the quote currency per unit of the base currency",
"maximum": 1000000,
"minimum": 0.000001,
"title": "Spot",
"type": "number",
"x-unit": "ratio"
},
"years": {
"description": "Horizon in years",
"exclusiveMinimum": 0,
"maximum": 10,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"quote_rate",
"base_rate",
"years"
],
"title": "UncoveredInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:international.parity_conditions:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Covered and uncovered interest parity, relative and absolute purchasing power parity, the international Fisher effect and real exchange rates.",
"discriminator": {
"mapping": {
"absolute_ppp": "#/$defs/AbsolutePppInputs",
"covered_interest_parity": "#/$defs/CoveredInputs",
"international_fisher": "#/$defs/InternationalFisherInputs",
"real_exchange_rate": "#/$defs/RealExchangeRateInputs",
"relative_ppp": "#/$defs/RelativePppInputs",
"uncovered_interest_parity": "#/$defs/UncoveredInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"base_rate": 0.03,
"calculation": "covered_interest_parity",
"compounding": "continuous",
"frequency": "annual",
"quote_rate": 0.01,
"spot": 0.75,
"years": 2
},
{
"base_rate": 0.045,
"calculation": "uncovered_interest_parity",
"compounding": "periodic",
"frequency": "annual",
"quote_rate": 0.005,
"spot": 150,
"years": 1
},
{
"base_inflation": 0.035,
"calculation": "relative_ppp",
"quote_inflation": 0.02,
"spot": 1.25,
"years": 5
},
{
"base_price": 4.95,
"calculation": "absolute_ppp",
"quote_price": 5.69,
"spot": 1.1
},
{
"base_inflation": 0.01,
"base_rate": 0.02,
"calculation": "international_fisher",
"quote_inflation": 0.03,
"quote_rate": 0.05
},
{
"base_inflation": 0.02,
"base_price_level": 115,
"calculation": "real_exchange_rate",
"quote_inflation": 0.03,
"quote_price_level": 120,
"spot": 1.1,
"spot_change": 0.05
}
],
"oneOf": [
{
"$ref": "#/$defs/CoveredInputs"
},
{
"$ref": "#/$defs/UncoveredInputs"
},
{
"$ref": "#/$defs/RelativePppInputs"
},
{
"$ref": "#/$defs/AbsolutePppInputs"
},
{
"$ref": "#/$defs/InternationalFisherInputs"
},
{
"$ref": "#/$defs/RealExchangeRateInputs"
}
],
"title": "International parity conditions: inputs",
"type": "object"
},
"name": "international_parity_conditions",
"outputSchema": {
"$defs": {
"input": {
"description": "Covered and uncovered interest parity, relative and absolute purchasing power parity, the international Fisher effect and real exchange rates.",
"discriminator": {
"mapping": {
"absolute_ppp": "#/$defs/input.AbsolutePppInputs",
"covered_interest_parity": "#/$defs/input.CoveredInputs",
"international_fisher": "#/$defs/input.InternationalFisherInputs",
"real_exchange_rate": "#/$defs/input.RealExchangeRateInputs",
"relative_ppp": "#/$defs/input.RelativePppInputs",
"uncovered_interest_parity": "#/$defs/input.UncoveredInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"base_rate": 0.03,
"calculation": "covered_interest_parity",
"compounding": "continuous",
"frequency": "annual",
"quote_rate": 0.01,
"spot": 0.75,
"years": 2
},
{
"base_rate": 0.045,
"calculation": "uncovered_interest_parity",
"compounding": "periodic",
"frequency": "annual",
"quote_rate": 0.005,
"spot": 150,
"years": 1
},
{
"base_inflation": 0.035,
"calculation": "relative_ppp",
"quote_inflation": 0.02,
"spot": 1.25,
"years": 5
},
{
"base_price": 4.95,
"calculation": "absolute_ppp",
"quote_price": 5.69,
"spot": 1.1
},
{
"base_inflation": 0.01,
"base_rate": 0.02,
"calculation": "international_fisher",
"quote_inflation": 0.03,
"quote_rate": 0.05
},
{
"base_inflation": 0.02,
"base_price_level": 115,
"calculation": "real_exchange_rate",
"quote_inflation": 0.03,
"quote_price_level": 120,
"spot": 1.1,
"spot_change": 0.05
}
],
"oneOf": [
{
"$ref": "#/$defs/input.CoveredInputs"
},
{
"$ref": "#/$defs/input.UncoveredInputs"
},
{
"$ref": "#/$defs/input.RelativePppInputs"
},
{
"$ref": "#/$defs/input.AbsolutePppInputs"
},
{
"$ref": "#/$defs/input.InternationalFisherInputs"
},
{
"$ref": "#/$defs/input.RealExchangeRateInputs"
}
],
"title": "International parity conditions: inputs"
},
"input.AbsolutePppInputs": {
"additionalProperties": false,
"description": "A basket's price in each currency, and the spot rate.",
"properties": {
"base_price": {
"description": "Basket's price in the base currency",
"maximum": 10000000,
"minimum": 0.01,
"title": "Base Price",
"type": "number",
"x-unit": "money"
},
"calculation": {
"const": "absolute_ppp",
"default": "absolute_ppp",
"description": "Exchange rate by absolute purchasing power",
"title": "Calculation",
"type": "string"
},
"quote_price": {
"description": "Basket's price in the quote currency",
"maximum": 10000000,
"minimum": 0.01,
"title": "Quote Price",
"type": "number",
"x-unit": "money"
},
"spot": {
"description": "Spot exchange rate, in units of the quote currency per unit of the base currency",
"maximum": 1000000,
"minimum": 0.000001,
"title": "Spot",
"type": "number",
"x-unit": "ratio"
}
},
"required": [
"quote_price",
"base_price",
"spot"
],
"title": "AbsolutePppInputs",
"type": "object"
},
"input.CoveredInputs": {
"additionalProperties": false,
"description": "A spot rate and each currency's interest rate.",
"properties": {
"base_rate": {
"description": "Nominal interest rate of the base currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Base Rate",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "covered_interest_parity",
"default": "covered_interest_parity",
"description": "Forward rate by covered parity",
"title": "Calculation",
"type": "string"
},
"compounding": {
"default": "periodic",
"description": "How both rates compound over the horizon",
"enum": [
"simple",
"periodic",
"continuous"
],
"title": "Compounding",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "annual",
"description": "Compounding frequency of periodic rates"
},
"quote_rate": {
"description": "Nominal interest rate of the quote currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Quote Rate",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Spot exchange rate, in units of the quote currency per unit of the base currency",
"maximum": 1000000,
"minimum": 0.000001,
"title": "Spot",
"type": "number",
"x-unit": "ratio"
},
"years": {
"description": "Horizon in years",
"exclusiveMinimum": 0,
"maximum": 10,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"quote_rate",
"base_rate",
"years"
],
"title": "CoveredInputs",
"type": "object"
},
"input.FrequencyName": {
"enum": [
"annual",
"semiannual",
"quarterly",
"monthly"
],
"type": "string"
},
"input.InternationalFisherInputs": {
"additionalProperties": false,
"description": "Each currency's nominal rate and expected inflation.",
"properties": {
"base_inflation": {
"description": "Inflation per year in the base currency's economy",
"maximum": 1,
"minimum": -0.2,
"title": "Base Inflation",
"type": "number",
"x-unit": "rate"
},
"base_rate": {
"description": "Nominal interest rate of the base currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Base Rate",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "international_fisher",
"default": "international_fisher",
"description": "Real rates and the expected change",
"title": "Calculation",
"type": "string"
},
"quote_inflation": {
"description": "Inflation per year in the quote currency's economy",
"maximum": 1,
"minimum": -0.2,
"title": "Quote Inflation",
"type": "number",
"x-unit": "rate"
},
"quote_rate": {
"description": "Nominal interest rate of the quote currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Quote Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"quote_rate",
"base_rate",
"quote_inflation",
"base_inflation"
],
"title": "InternationalFisherInputs",
"type": "object"
},
"input.RealExchangeRateInputs": {
"additionalProperties": false,
"description": "A spot rate, each economy's price level, and a period's changes.",
"properties": {
"base_inflation": {
"default": 0,
"description": "Inflation in the base economy over it",
"maximum": 10,
"minimum": -0.5,
"title": "Base Inflation",
"type": "number",
"x-unit": "return"
},
"base_price_level": {
"description": "Price index of the base economy",
"maximum": 10000000,
"minimum": 0.01,
"title": "Base Price Level",
"type": "number",
"x-unit": "index_level"
},
"calculation": {
"const": "real_exchange_rate",
"default": "real_exchange_rate",
"description": "Real exchange rate and its change",
"title": "Calculation",
"type": "string"
},
"quote_inflation": {
"default": 0,
"description": "Inflation in the quote economy over it",
"maximum": 10,
"minimum": -0.5,
"title": "Quote Inflation",
"type": "number",
"x-unit": "return"
},
"quote_price_level": {
"description": "Price index of the quote economy",
"maximum": 10000000,
"minimum": 0.01,
"title": "Quote Price Level",
"type": "number",
"x-unit": "index_level"
},
"spot": {
"description": "Spot exchange rate, in units of the quote currency per unit of the base currency",
"maximum": 1000000,
"minimum": 0.000001,
"title": "Spot",
"type": "number",
"x-unit": "ratio"
},
"spot_change": {
"default": 0,
"description": "Change in the spot rate over the period",
"maximum": 10,
"minimum": -0.9,
"title": "Spot Change",
"type": "number",
"x-unit": "return"
}
},
"required": [
"spot",
"quote_price_level",
"base_price_level"
],
"title": "RealExchangeRateInputs",
"type": "object"
},
"input.RelativePppInputs": {
"additionalProperties": false,
"description": "A spot rate and each economy's expected inflation.",
"properties": {
"base_inflation": {
"description": "Inflation per year in the base currency's economy",
"maximum": 1,
"minimum": -0.2,
"title": "Base Inflation",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "relative_ppp",
"default": "relative_ppp",
"description": "Expected spot by relative purchasing power",
"title": "Calculation",
"type": "string"
},
"quote_inflation": {
"description": "Inflation per year in the quote currency's economy",
"maximum": 1,
"minimum": -0.2,
"title": "Quote Inflation",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Spot exchange rate, in units of the quote currency per unit of the base currency",
"maximum": 1000000,
"minimum": 0.000001,
"title": "Spot",
"type": "number",
"x-unit": "ratio"
},
"years": {
"description": "Horizon in years",
"exclusiveMinimum": 0,
"maximum": 10,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"quote_inflation",
"base_inflation",
"years"
],
"title": "RelativePppInputs",
"type": "object"
},
"input.UncoveredInputs": {
"additionalProperties": false,
"description": "A spot rate and each currency's interest rate.",
"properties": {
"base_rate": {
"description": "Nominal interest rate of the base currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Base Rate",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "uncovered_interest_parity",
"default": "uncovered_interest_parity",
"description": "Expected spot by uncovered parity",
"title": "Calculation",
"type": "string"
},
"compounding": {
"default": "periodic",
"description": "How both rates compound over the horizon",
"enum": [
"simple",
"periodic",
"continuous"
],
"title": "Compounding",
"type": "string"
},
"frequency": {
"$ref": "#/$defs/input.FrequencyName",
"default": "annual",
"description": "Compounding frequency of periodic rates"
},
"quote_rate": {
"description": "Nominal interest rate of the quote currency per year",
"maximum": 1,
"minimum": -0.05,
"title": "Quote Rate",
"type": "number",
"x-unit": "rate"
},
"spot": {
"description": "Spot exchange rate, in units of the quote currency per unit of the base currency",
"maximum": 1000000,
"minimum": 0.000001,
"title": "Spot",
"type": "number",
"x-unit": "ratio"
},
"years": {
"description": "Horizon in years",
"exclusiveMinimum": 0,
"maximum": 10,
"title": "Years",
"type": "number",
"x-unit": "years"
}
},
"required": [
"spot",
"quote_rate",
"base_rate",
"years"
],
"title": "UncoveredInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "international.parity_conditions"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "Covered and uncovered interest parity, relative and absolute purchasing power parity, the international Fisher effect and real exchange rates.",
"discriminator": {
"mapping": {
"absolute_ppp": "#/$defs/output.AbsolutePppOutputs",
"covered_interest_parity": "#/$defs/output.CoveredOutputs",
"international_fisher": "#/$defs/output.InternationalFisherOutputs",
"real_exchange_rate": "#/$defs/output.RealExchangeRateOutputs",
"relative_ppp": "#/$defs/output.RelativePppOutputs",
"uncovered_interest_parity": "#/$defs/output.UncoveredOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.CoveredOutputs"
},
{
"$ref": "#/$defs/output.UncoveredOutputs"
},
{
"$ref": "#/$defs/output.RelativePppOutputs"
},
{
"$ref": "#/$defs/output.AbsolutePppOutputs"
},
{
"$ref": "#/$defs/output.InternationalFisherOutputs"
},
{
"$ref": "#/$defs/output.RealExchangeRateOutputs"
}
],
"title": "International parity conditions: outputs"
},
"output.AbsolutePppOutputs": {
"additionalProperties": false,
"properties": {
"base_currency_valuation": {
"description": "Spot over the PPP rate, less one: above zero, the base is dear",
"maximum": 100,
"minimum": -1,
"title": "Base Currency Valuation",
"type": "number",
"x-unit": "return"
},
"calculation": {
"const": "absolute_ppp",
"default": "absolute_ppp",
"description": "Exchange rate by absolute purchasing power",
"title": "Calculation",
"type": "string"
},
"ppp_rate": {
"description": "Exchange rate equating the basket's prices, in units of the quote currency per unit of the base currency",
"exclusiveMinimum": 0,
"maximum": 1000000000,
"title": "Ppp Rate",
"type": "number",
"x-unit": "ratio"
}
},
"required": [
"ppp_rate",
"base_currency_valuation"
],
"title": "AbsolutePppOutputs",
"type": "object"
},
"output.CoveredOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "covered_interest_parity",
"default": "covered_interest_parity",
"description": "Forward rate by covered parity",
"title": "Calculation",
"type": "string"
},
"forward_points": {
"description": "Forward less spot, in units of the quote currency",
"maximum": 100000000000,
"minimum": -100000000000,
"title": "Forward Points",
"type": "number",
"x-unit": "ratio"
},
"forward_premium": {
"description": "Forward over spot, less one: the base currency's forward premium",
"maximum": 100000,
"minimum": -1,
"title": "Forward Premium",
"type": "number",
"x-unit": "return"
},
"forward_rate": {
"description": "Forward exchange rate for the horizon, in units of the quote currency per unit of the base currency",
"exclusiveMinimum": 0,
"maximum": 100000000000,
"title": "Forward Rate",
"type": "number",
"x-unit": "ratio"
}
},
"required": [
"forward_rate",
"forward_points",
"forward_premium"
],
"title": "CoveredOutputs",
"type": "object"
},
"output.InternationalFisherOutputs": {
"additionalProperties": false,
"properties": {
"approximate_change": {
"description": "Quote rate less base rate: the change's linear approximation",
"maximum": 3,
"minimum": -3,
"title": "Approximate Change",
"type": "number",
"x-unit": "rate"
},
"base_real_rate": {
"description": "(1 + base rate) / (1 + base inflation) - 1",
"maximum": 10,
"minimum": -0.99,
"title": "Base Real Rate",
"type": "number",
"x-unit": "rate"
},
"calculation": {
"const": "international_fisher",
"default": "international_fisher",
"description": "Real rates and the expected change",
"title": "Calculation",
"type": "string"
},
"expected_change": {
"description": "Expected change in the spot rate over a year: (1 + i_q) / (1 + i_b) - 1",
"maximum": 100,
"minimum": -1,
"title": "Expected Change",
"type": "number",
"x-unit": "return"
},
"quote_real_rate": {
"description": "(1 + quote rate) / (1 + quote inflation) - 1",
"maximum": 10,
"minimum": -0.99,
"title": "Quote Real Rate",
"type": "number",
"x-unit": "rate"
},
"real_rate_differential": {
"description": "Quote real rate less base real rate",
"maximum": 3,
"minimum": -3,
"title": "Real Rate Differential",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"quote_real_rate",
"base_real_rate",
"real_rate_differential",
"expected_change",
"approximate_change"
],
"title": "InternationalFisherOutputs",
"type": "object"
},
"output.RealExchangeRateOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "real_exchange_rate",
"default": "real_exchange_rate",
"description": "Real exchange rate and its change",
"title": "Calculation",
"type": "string"
},
"real_change": {
"description": "(1 + spot change)(1 + base inflation)/(1 + quote inflation) - 1",
"maximum": 250,
"minimum": -1,
"title": "Real Change",
"type": "number",
"x-unit": "return"
},
"real_exchange_rate": {
"description": "Spot times the base price level over the quote price level",
"exclusiveMinimum": 0,
"maximum": 1000000000000000,
"title": "Real Exchange Rate",
"type": "number",
"x-unit": "ratio"
}
},
"required": [
"real_exchange_rate",
"real_change"
],
"title": "RealExchangeRateOutputs",
"type": "object"
},
"output.RelativePppOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "relative_ppp",
"default": "relative_ppp",
"description": "Expected spot by relative purchasing power",
"title": "Calculation",
"type": "string"
},
"expected_change": {
"description": "Expected change in the spot rate",
"maximum": 100000,
"minimum": -1,
"title": "Expected Change",
"type": "number",
"x-unit": "return"
},
"expected_spot": {
"description": "Spot rate expected at the horizon, in units of the quote currency per unit of the base currency",
"exclusiveMinimum": 0,
"maximum": 100000000000,
"title": "Expected Spot",
"type": "number",
"x-unit": "ratio"
},
"inflation_differential": {
"description": "Quote inflation less base inflation: the change per year, approx.",
"maximum": 3,
"minimum": -3,
"title": "Inflation Differential",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"expected_spot",
"expected_change",
"inflation_differential"
],
"title": "RelativePppOutputs",
"type": "object"
},
"output.UncoveredOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "uncovered_interest_parity",
"default": "uncovered_interest_parity",
"description": "Expected spot by uncovered parity",
"title": "Calculation",
"type": "string"
},
"expected_change": {
"description": "Expected change in the spot rate",
"maximum": 100000,
"minimum": -1,
"title": "Expected Change",
"type": "number",
"x-unit": "return"
},
"expected_spot": {
"description": "Spot rate expected at the horizon, in units of the quote currency per unit of the base currency",
"exclusiveMinimum": 0,
"maximum": 100000000000,
"title": "Expected Spot",
"type": "number",
"x-unit": "ratio"
}
},
"required": [
"expected_spot",
"expected_change"
],
"title": "UncoveredOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "international.parity_conditions"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "International parity conditions: result",
"type": "object"
}
},
{
"description": "Lists every data provider with its licence class, whether its terms let its data reach an AI assistant (llm_use) and whether this server's policy permits it, its attribution and its terms page.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "No arguments.",
"properties": {},
"title": "list_sources: inputs",
"type": "object"
},
"name": "list_sources",
"outputSchema": {
"$defs": {
"Source": {
"additionalProperties": false,
"properties": {
"attribution": {
"type": "string"
},
"hosted_allowed": {
"type": "boolean"
},
"id": {
"type": "string"
},
"licence": {
"enum": [
"hosted-safe",
"library-only",
"byok",
"premium-local",
"user-supplied"
]
},
"llm_permitted": {
"type": "boolean"
},
"llm_use": {
"enum": [
"allowed",
"forbidden",
"unclear"
]
},
"name": {
"type": "string"
},
"notice": {
"type": [
"string",
"null"
]
},
"terms_url": {
"format": "uri",
"type": "string"
}
},
"required": [
"attribution",
"hosted_allowed",
"id",
"licence",
"llm_permitted",
"llm_use",
"name",
"notice",
"terms_url"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "Every data provider with its licence class, its llm_use class, whether this server's policy lets its data reach the assistant, its attribution and its terms page.",
"properties": {
"sources": {
"items": {
"$ref": "#/$defs/Source"
},
"type": "array"
}
},
"required": [
"sources"
],
"title": "list_sources: result",
"type": "object"
}
},
{
"description": "Taylor (1993 and 1999), balanced-approach, shortfalls, adjusted and first-difference rules, smoothed and floored, on a gap measured in output or unemployment, and over forecast paths. Runs Monetary-policy rules (macro.policy_rule, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: adjusted_taylor_1993, balanced_approach, balanced_approach_shortfalls, first_difference, path, taylor_1993, taylor_1999. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"AdjustedTaylor1993Inputs": {
"additionalProperties": false,
"description": "Taylor (1993) less the shortfall left by the lower bound, floored at it.",
"properties": {
"calculation": {
"const": "adjusted_taylor_1993",
"default": "adjusted_taylor_1993",
"description": "The adjusted Taylor (1993) rule",
"title": "Calculation",
"type": "string"
},
"cumulative_shortfall": {
"default": 0,
"description": "Z: the sum of the rate's past excesses over Taylor (1993) prescriptions below the lower bound, still to be made up",
"maximum": 1,
"minimum": 0,
"title": "Cumulative Shortfall",
"type": "number",
"x-unit": "rate"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"default": 0.00125,
"description": "The effective lower bound the rule is floored at; the Board's is 12.5 basis points",
"maximum": 0.1,
"minimum": -0.1,
"title": "Lower Bound",
"type": "number",
"x-unit": "rate"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, r* plus the target (the SEP's longer-run rate)",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the rule's date, for smoothing",
"title": "Previous Rate"
},
"resource_weight": {
"default": 0.5,
"description": "Weight on the resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
}
},
"required": [
"inflation"
],
"title": "AdjustedTaylor1993Inputs",
"type": "object"
},
"BalancedApproachInputs": {
"additionalProperties": false,
"description": "The balanced approach: twice the Taylor (1993) weight on the gap.",
"properties": {
"calculation": {
"const": "balanced_approach",
"default": "balanced_approach",
"description": "The balanced-approach rule",
"title": "Calculation",
"type": "string"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound that floors the prescription",
"title": "Lower Bound"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, r* plus the target (the SEP's longer-run rate)",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the rule's date, for smoothing",
"title": "Previous Rate"
},
"resource_weight": {
"default": 1,
"description": "Weight on the resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
}
},
"required": [
"inflation"
],
"title": "BalancedApproachInputs",
"type": "object"
},
"FirstDifferenceInputs": {
"additionalProperties": false,
"description": "The first-difference rule: the previous rate plus the change it prescribes.",
"properties": {
"calculation": {
"const": "first_difference",
"default": "first_difference",
"description": "The first-difference rule",
"title": "Calculation",
"type": "string"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound that floors the prescription",
"title": "Lower Bound"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"natural_unemployment_lagged": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural rate four quarters earlier; the current one when left out",
"title": "Natural Unemployment Lagged"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"output_gap_lagged": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The output gap four quarters earlier",
"title": "Output Gap Lagged"
},
"previous_rate": {
"description": "The policy rate a quarter earlier",
"maximum": 1,
"minimum": -0.1,
"title": "Previous Rate",
"type": "number",
"x-unit": "rate"
},
"resource_weight": {
"default": 0.5,
"description": "Weight on the change in the resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
},
"unemployment_lagged": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate four quarters earlier",
"title": "Unemployment Lagged"
}
},
"required": [
"inflation",
"previous_rate"
],
"title": "FirstDifferenceInputs",
"type": "object"
},
"GapMeasure": {
"enum": [
"unemployment",
"output"
],
"type": "string"
},
"PathInputs": {
"additionalProperties": false,
"description": "One rule over forecast horizons: a path of inflation and of the gap.",
"properties": {
"calculation": {
"const": "path",
"default": "path",
"description": "A rule over a forecast",
"title": "Calculation",
"type": "string"
},
"cumulative_shortfall": {
"default": 0,
"description": "For the adjusted rule: the shortfall Z, held over the path",
"maximum": 1,
"minimum": 0,
"title": "Cumulative Shortfall",
"type": "number",
"x-unit": "rate"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the paths given"
},
"inflation_high_path": {
"anyOf": [
{
"items": {
"maximum": 0.5,
"minimum": -0.2,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A high inflation forecast (a 75th percentile) for the band's upper edge",
"title": "Inflation High Path"
},
"inflation_low_path": {
"anyOf": [
{
"items": {
"maximum": 0.5,
"minimum": -0.2,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A low inflation forecast (a 25th percentile) for the band's lower edge",
"title": "Inflation Low Path"
},
"inflation_path": {
"description": "Inflation at each horizon",
"items": {
"maximum": 0.5,
"minimum": -0.2,
"type": "number",
"x-unit": "rate"
},
"maxItems": 40,
"minItems": 1,
"title": "Inflation Path",
"type": "array"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound; for the adjusted rule, 12.5 basis points when left out",
"title": "Lower Bound"
},
"natural_unemployment_lagged_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "For the first-difference rule: the natural rate four quarters back; the horizon's own when left out",
"title": "Natural Unemployment Lagged Path"
},
"natural_unemployment_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural rate of unemployment at each horizon",
"title": "Natural Unemployment Path"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, for a level rule",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*, for a level rule",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap_high_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A high output-gap forecast, for the band",
"title": "Output Gap High Path"
},
"output_gap_lagged_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "For the first-difference rule: each horizon's output gap four quarters back",
"title": "Output Gap Lagged Path"
},
"output_gap_low_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A low output-gap forecast, for the band",
"title": "Output Gap Low Path"
},
"output_gap_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap at each horizon",
"title": "Output Gap Path"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the first horizon",
"title": "Previous Rate"
},
"resource_weight": {
"anyOf": [
{
"maximum": 4,
"minimum": 0,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"default": null,
"description": "Weight on the resource gap; the rule's own when left out",
"title": "Resource Weight"
},
"rule": {
"$ref": "#/$defs/RuleName",
"description": "The rule to apply at each horizon"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate at each horizon",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment_high_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A high unemployment forecast, for the band's lower edge",
"title": "Unemployment High Path"
},
"unemployment_lagged_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "For the first-difference rule: each horizon's unemployment four quarters back",
"title": "Unemployment Lagged Path"
},
"unemployment_low_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A low unemployment forecast, for the band's upper edge",
"title": "Unemployment Low Path"
},
"unemployment_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Unemployment at each horizon",
"title": "Unemployment Path"
}
},
"required": [
"rule",
"inflation_path"
],
"title": "PathInputs",
"type": "object"
},
"RuleName": {
"enum": [
"taylor_1993",
"taylor_1999",
"balanced_approach",
"balanced_approach_shortfalls",
"adjusted_taylor_1993",
"first_difference"
],
"type": "string"
},
"ShortfallsInputs": {
"additionalProperties": false,
"description": "The balanced approach answering only a shortfall of activity.",
"properties": {
"calculation": {
"const": "balanced_approach_shortfalls",
"default": "balanced_approach_shortfalls",
"description": "The balanced-approach (shortfalls) rule",
"title": "Calculation",
"type": "string"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound that floors the prescription",
"title": "Lower Bound"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, r* plus the target (the SEP's longer-run rate)",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the rule's date, for smoothing",
"title": "Previous Rate"
},
"resource_weight": {
"default": 1,
"description": "Weight on a negative resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
}
},
"required": [
"inflation"
],
"title": "ShortfallsInputs",
"type": "object"
},
"Taylor1993Inputs": {
"additionalProperties": false,
"description": "Taylor (1993): a weight of 0.5 on the inflation gap and on the output gap.",
"properties": {
"calculation": {
"const": "taylor_1993",
"default": "taylor_1993",
"description": "The Taylor (1993) rule",
"title": "Calculation",
"type": "string"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound that floors the prescription",
"title": "Lower Bound"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, r* plus the target (the SEP's longer-run rate)",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the rule's date, for smoothing",
"title": "Previous Rate"
},
"resource_weight": {
"default": 0.5,
"description": "Weight on the resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
}
},
"required": [
"inflation"
],
"title": "Taylor1993Inputs",
"type": "object"
},
"Taylor1999Inputs": {
"additionalProperties": false,
"description": "Taylor (1999): a weight of 1.0 on the output gap.",
"properties": {
"calculation": {
"const": "taylor_1999",
"default": "taylor_1999",
"description": "The Taylor (1999) rule",
"title": "Calculation",
"type": "string"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound that floors the prescription",
"title": "Lower Bound"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, r* plus the target (the SEP's longer-run rate)",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the rule's date, for smoothing",
"title": "Previous Rate"
},
"resource_weight": {
"default": 1,
"description": "Weight on the resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
}
},
"required": [
"inflation"
],
"title": "Taylor1999Inputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:macro.policy_rule:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Taylor (1993 and 1999), balanced-approach, shortfalls, adjusted and first-difference rules, smoothed and floored, on a gap measured in output or unemployment, and over forecast paths.",
"discriminator": {
"mapping": {
"adjusted_taylor_1993": "#/$defs/AdjustedTaylor1993Inputs",
"balanced_approach": "#/$defs/BalancedApproachInputs",
"balanced_approach_shortfalls": "#/$defs/ShortfallsInputs",
"first_difference": "#/$defs/FirstDifferenceInputs",
"path": "#/$defs/PathInputs",
"taylor_1993": "#/$defs/Taylor1993Inputs",
"taylor_1999": "#/$defs/Taylor1999Inputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "taylor_1993",
"gap_measure": null,
"inflation": 0.03,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment": 0.042,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.01,
"okun_coefficient": 2,
"output_gap": null,
"previous_rate": null,
"resource_weight": 0.5,
"smoothing": 0,
"unemployment": 0.043
},
{
"calculation": "taylor_1999",
"gap_measure": null,
"inflation": 0.025,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment": null,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.005,
"okun_coefficient": 2,
"output_gap": 0.01,
"previous_rate": null,
"resource_weight": 1,
"smoothing": 0,
"unemployment": null
},
{
"calculation": "balanced_approach",
"gap_measure": null,
"inflation": 0.026,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment": 0.042,
"neutral_nominal_rate": 0.03,
"neutral_real_rate": null,
"okun_coefficient": 2,
"output_gap": null,
"previous_rate": null,
"resource_weight": 1,
"smoothing": 0,
"unemployment": 0.044
},
{
"calculation": "balanced_approach_shortfalls",
"gap_measure": null,
"inflation": 0.02,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment": 0.042,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.005,
"okun_coefficient": 2,
"output_gap": null,
"previous_rate": null,
"resource_weight": 1,
"smoothing": 0,
"unemployment": 0.035
},
{
"calculation": "adjusted_taylor_1993",
"cumulative_shortfall": 0.01,
"gap_measure": null,
"inflation": 0.02,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": 0.00125,
"natural_unemployment": 0.042,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.005,
"okun_coefficient": 2,
"output_gap": null,
"previous_rate": null,
"resource_weight": 0.5,
"smoothing": 0,
"unemployment": 0.05
},
{
"calculation": "first_difference",
"gap_measure": null,
"inflation": 0.03,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment": 0.042,
"natural_unemployment_lagged": null,
"okun_coefficient": 2,
"output_gap": null,
"output_gap_lagged": null,
"previous_rate": 0.0425,
"resource_weight": 0.5,
"smoothing": 0,
"unemployment": 0.042,
"unemployment_lagged": 0.04
},
{
"calculation": "taylor_1999",
"gap_measure": null,
"inflation": 0.03,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": 0.00125,
"natural_unemployment": null,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.01,
"okun_coefficient": 2,
"output_gap": 0.005,
"previous_rate": 0.0375,
"resource_weight": 1,
"smoothing": 0.85,
"unemployment": null
},
{
"calculation": "path",
"cumulative_shortfall": 0,
"gap_measure": null,
"inflation_high_path": [
0.033,
0.032,
0.03,
0.028,
0.026
],
"inflation_low_path": [
0.027,
0.024,
0.022,
0.02,
0.019
],
"inflation_path": [
0.03,
0.028,
0.026,
0.024,
0.022
],
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment_lagged_path": null,
"natural_unemployment_path": null,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.01,
"okun_coefficient": 2,
"output_gap_high_path": [
0.015,
0.013,
0.011,
0.009,
0.007
],
"output_gap_lagged_path": null,
"output_gap_low_path": [
0.005,
0.002,
0,
-0.002,
-0.003
],
"output_gap_path": [
0.01,
0.008,
0.006,
0.004,
0.002
],
"previous_rate": null,
"resource_weight": null,
"rule": "taylor_1993",
"smoothing": 0,
"unemployment_high_path": null,
"unemployment_lagged_path": null,
"unemployment_low_path": null,
"unemployment_path": null
}
],
"oneOf": [
{
"$ref": "#/$defs/Taylor1993Inputs"
},
{
"$ref": "#/$defs/Taylor1999Inputs"
},
{
"$ref": "#/$defs/BalancedApproachInputs"
},
{
"$ref": "#/$defs/ShortfallsInputs"
},
{
"$ref": "#/$defs/AdjustedTaylor1993Inputs"
},
{
"$ref": "#/$defs/FirstDifferenceInputs"
},
{
"$ref": "#/$defs/PathInputs"
}
],
"title": "Monetary-policy rules: inputs",
"type": "object"
},
"name": "macro_policy_rule",
"outputSchema": {
"$defs": {
"input": {
"description": "Taylor (1993 and 1999), balanced-approach, shortfalls, adjusted and first-difference rules, smoothed and floored, on a gap measured in output or unemployment, and over forecast paths.",
"discriminator": {
"mapping": {
"adjusted_taylor_1993": "#/$defs/input.AdjustedTaylor1993Inputs",
"balanced_approach": "#/$defs/input.BalancedApproachInputs",
"balanced_approach_shortfalls": "#/$defs/input.ShortfallsInputs",
"first_difference": "#/$defs/input.FirstDifferenceInputs",
"path": "#/$defs/input.PathInputs",
"taylor_1993": "#/$defs/input.Taylor1993Inputs",
"taylor_1999": "#/$defs/input.Taylor1999Inputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "taylor_1993",
"gap_measure": null,
"inflation": 0.03,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment": 0.042,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.01,
"okun_coefficient": 2,
"output_gap": null,
"previous_rate": null,
"resource_weight": 0.5,
"smoothing": 0,
"unemployment": 0.043
},
{
"calculation": "taylor_1999",
"gap_measure": null,
"inflation": 0.025,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment": null,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.005,
"okun_coefficient": 2,
"output_gap": 0.01,
"previous_rate": null,
"resource_weight": 1,
"smoothing": 0,
"unemployment": null
},
{
"calculation": "balanced_approach",
"gap_measure": null,
"inflation": 0.026,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment": 0.042,
"neutral_nominal_rate": 0.03,
"neutral_real_rate": null,
"okun_coefficient": 2,
"output_gap": null,
"previous_rate": null,
"resource_weight": 1,
"smoothing": 0,
"unemployment": 0.044
},
{
"calculation": "balanced_approach_shortfalls",
"gap_measure": null,
"inflation": 0.02,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment": 0.042,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.005,
"okun_coefficient": 2,
"output_gap": null,
"previous_rate": null,
"resource_weight": 1,
"smoothing": 0,
"unemployment": 0.035
},
{
"calculation": "adjusted_taylor_1993",
"cumulative_shortfall": 0.01,
"gap_measure": null,
"inflation": 0.02,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": 0.00125,
"natural_unemployment": 0.042,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.005,
"okun_coefficient": 2,
"output_gap": null,
"previous_rate": null,
"resource_weight": 0.5,
"smoothing": 0,
"unemployment": 0.05
},
{
"calculation": "first_difference",
"gap_measure": null,
"inflation": 0.03,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment": 0.042,
"natural_unemployment_lagged": null,
"okun_coefficient": 2,
"output_gap": null,
"output_gap_lagged": null,
"previous_rate": 0.0425,
"resource_weight": 0.5,
"smoothing": 0,
"unemployment": 0.042,
"unemployment_lagged": 0.04
},
{
"calculation": "taylor_1999",
"gap_measure": null,
"inflation": 0.03,
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": 0.00125,
"natural_unemployment": null,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.01,
"okun_coefficient": 2,
"output_gap": 0.005,
"previous_rate": 0.0375,
"resource_weight": 1,
"smoothing": 0.85,
"unemployment": null
},
{
"calculation": "path",
"cumulative_shortfall": 0,
"gap_measure": null,
"inflation_high_path": [
0.033,
0.032,
0.03,
0.028,
0.026
],
"inflation_low_path": [
0.027,
0.024,
0.022,
0.02,
0.019
],
"inflation_path": [
0.03,
0.028,
0.026,
0.024,
0.022
],
"inflation_target": 0.02,
"inflation_weight": 0.5,
"lower_bound": null,
"natural_unemployment_lagged_path": null,
"natural_unemployment_path": null,
"neutral_nominal_rate": null,
"neutral_real_rate": 0.01,
"okun_coefficient": 2,
"output_gap_high_path": [
0.015,
0.013,
0.011,
0.009,
0.007
],
"output_gap_lagged_path": null,
"output_gap_low_path": [
0.005,
0.002,
0,
-0.002,
-0.003
],
"output_gap_path": [
0.01,
0.008,
0.006,
0.004,
0.002
],
"previous_rate": null,
"resource_weight": null,
"rule": "taylor_1993",
"smoothing": 0,
"unemployment_high_path": null,
"unemployment_lagged_path": null,
"unemployment_low_path": null,
"unemployment_path": null
}
],
"oneOf": [
{
"$ref": "#/$defs/input.Taylor1993Inputs"
},
{
"$ref": "#/$defs/input.Taylor1999Inputs"
},
{
"$ref": "#/$defs/input.BalancedApproachInputs"
},
{
"$ref": "#/$defs/input.ShortfallsInputs"
},
{
"$ref": "#/$defs/input.AdjustedTaylor1993Inputs"
},
{
"$ref": "#/$defs/input.FirstDifferenceInputs"
},
{
"$ref": "#/$defs/input.PathInputs"
}
],
"title": "Monetary-policy rules: inputs"
},
"input.AdjustedTaylor1993Inputs": {
"additionalProperties": false,
"description": "Taylor (1993) less the shortfall left by the lower bound, floored at it.",
"properties": {
"calculation": {
"const": "adjusted_taylor_1993",
"default": "adjusted_taylor_1993",
"description": "The adjusted Taylor (1993) rule",
"title": "Calculation",
"type": "string"
},
"cumulative_shortfall": {
"default": 0,
"description": "Z: the sum of the rate's past excesses over Taylor (1993) prescriptions below the lower bound, still to be made up",
"maximum": 1,
"minimum": 0,
"title": "Cumulative Shortfall",
"type": "number",
"x-unit": "rate"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/input.GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"default": 0.00125,
"description": "The effective lower bound the rule is floored at; the Board's is 12.5 basis points",
"maximum": 0.1,
"minimum": -0.1,
"title": "Lower Bound",
"type": "number",
"x-unit": "rate"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, r* plus the target (the SEP's longer-run rate)",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the rule's date, for smoothing",
"title": "Previous Rate"
},
"resource_weight": {
"default": 0.5,
"description": "Weight on the resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
}
},
"required": [
"inflation"
],
"title": "AdjustedTaylor1993Inputs",
"type": "object"
},
"input.BalancedApproachInputs": {
"additionalProperties": false,
"description": "The balanced approach: twice the Taylor (1993) weight on the gap.",
"properties": {
"calculation": {
"const": "balanced_approach",
"default": "balanced_approach",
"description": "The balanced-approach rule",
"title": "Calculation",
"type": "string"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/input.GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound that floors the prescription",
"title": "Lower Bound"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, r* plus the target (the SEP's longer-run rate)",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the rule's date, for smoothing",
"title": "Previous Rate"
},
"resource_weight": {
"default": 1,
"description": "Weight on the resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
}
},
"required": [
"inflation"
],
"title": "BalancedApproachInputs",
"type": "object"
},
"input.FirstDifferenceInputs": {
"additionalProperties": false,
"description": "The first-difference rule: the previous rate plus the change it prescribes.",
"properties": {
"calculation": {
"const": "first_difference",
"default": "first_difference",
"description": "The first-difference rule",
"title": "Calculation",
"type": "string"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/input.GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound that floors the prescription",
"title": "Lower Bound"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"natural_unemployment_lagged": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural rate four quarters earlier; the current one when left out",
"title": "Natural Unemployment Lagged"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"output_gap_lagged": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The output gap four quarters earlier",
"title": "Output Gap Lagged"
},
"previous_rate": {
"description": "The policy rate a quarter earlier",
"maximum": 1,
"minimum": -0.1,
"title": "Previous Rate",
"type": "number",
"x-unit": "rate"
},
"resource_weight": {
"default": 0.5,
"description": "Weight on the change in the resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
},
"unemployment_lagged": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate four quarters earlier",
"title": "Unemployment Lagged"
}
},
"required": [
"inflation",
"previous_rate"
],
"title": "FirstDifferenceInputs",
"type": "object"
},
"input.GapMeasure": {
"enum": [
"unemployment",
"output"
],
"type": "string"
},
"input.PathInputs": {
"additionalProperties": false,
"description": "One rule over forecast horizons: a path of inflation and of the gap.",
"properties": {
"calculation": {
"const": "path",
"default": "path",
"description": "A rule over a forecast",
"title": "Calculation",
"type": "string"
},
"cumulative_shortfall": {
"default": 0,
"description": "For the adjusted rule: the shortfall Z, held over the path",
"maximum": 1,
"minimum": 0,
"title": "Cumulative Shortfall",
"type": "number",
"x-unit": "rate"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/input.GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the paths given"
},
"inflation_high_path": {
"anyOf": [
{
"items": {
"maximum": 0.5,
"minimum": -0.2,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A high inflation forecast (a 75th percentile) for the band's upper edge",
"title": "Inflation High Path"
},
"inflation_low_path": {
"anyOf": [
{
"items": {
"maximum": 0.5,
"minimum": -0.2,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A low inflation forecast (a 25th percentile) for the band's lower edge",
"title": "Inflation Low Path"
},
"inflation_path": {
"description": "Inflation at each horizon",
"items": {
"maximum": 0.5,
"minimum": -0.2,
"type": "number",
"x-unit": "rate"
},
"maxItems": 40,
"minItems": 1,
"title": "Inflation Path",
"type": "array"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound; for the adjusted rule, 12.5 basis points when left out",
"title": "Lower Bound"
},
"natural_unemployment_lagged_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "For the first-difference rule: the natural rate four quarters back; the horizon's own when left out",
"title": "Natural Unemployment Lagged Path"
},
"natural_unemployment_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural rate of unemployment at each horizon",
"title": "Natural Unemployment Path"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, for a level rule",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*, for a level rule",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap_high_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A high output-gap forecast, for the band",
"title": "Output Gap High Path"
},
"output_gap_lagged_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "For the first-difference rule: each horizon's output gap four quarters back",
"title": "Output Gap Lagged Path"
},
"output_gap_low_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A low output-gap forecast, for the band",
"title": "Output Gap Low Path"
},
"output_gap_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap at each horizon",
"title": "Output Gap Path"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the first horizon",
"title": "Previous Rate"
},
"resource_weight": {
"anyOf": [
{
"maximum": 4,
"minimum": 0,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"default": null,
"description": "Weight on the resource gap; the rule's own when left out",
"title": "Resource Weight"
},
"rule": {
"$ref": "#/$defs/input.RuleName",
"description": "The rule to apply at each horizon"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate at each horizon",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment_high_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A high unemployment forecast, for the band's lower edge",
"title": "Unemployment High Path"
},
"unemployment_lagged_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "For the first-difference rule: each horizon's unemployment four quarters back",
"title": "Unemployment Lagged Path"
},
"unemployment_low_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "A low unemployment forecast, for the band's upper edge",
"title": "Unemployment Low Path"
},
"unemployment_path": {
"anyOf": [
{
"items": {
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
"maxLength": 40,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Unemployment at each horizon",
"title": "Unemployment Path"
}
},
"required": [
"rule",
"inflation_path"
],
"title": "PathInputs",
"type": "object"
},
"input.RuleName": {
"enum": [
"taylor_1993",
"taylor_1999",
"balanced_approach",
"balanced_approach_shortfalls",
"adjusted_taylor_1993",
"first_difference"
],
"type": "string"
},
"input.ShortfallsInputs": {
"additionalProperties": false,
"description": "The balanced approach answering only a shortfall of activity.",
"properties": {
"calculation": {
"const": "balanced_approach_shortfalls",
"default": "balanced_approach_shortfalls",
"description": "The balanced-approach (shortfalls) rule",
"title": "Calculation",
"type": "string"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/input.GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound that floors the prescription",
"title": "Lower Bound"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, r* plus the target (the SEP's longer-run rate)",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the rule's date, for smoothing",
"title": "Previous Rate"
},
"resource_weight": {
"default": 1,
"description": "Weight on a negative resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
}
},
"required": [
"inflation"
],
"title": "ShortfallsInputs",
"type": "object"
},
"input.Taylor1993Inputs": {
"additionalProperties": false,
"description": "Taylor (1993): a weight of 0.5 on the inflation gap and on the output gap.",
"properties": {
"calculation": {
"const": "taylor_1993",
"default": "taylor_1993",
"description": "The Taylor (1993) rule",
"title": "Calculation",
"type": "string"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/input.GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound that floors the prescription",
"title": "Lower Bound"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, r* plus the target (the SEP's longer-run rate)",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the rule's date, for smoothing",
"title": "Previous Rate"
},
"resource_weight": {
"default": 0.5,
"description": "Weight on the resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
}
},
"required": [
"inflation"
],
"title": "Taylor1993Inputs",
"type": "object"
},
"input.Taylor1999Inputs": {
"additionalProperties": false,
"description": "Taylor (1999): a weight of 1.0 on the output gap.",
"properties": {
"calculation": {
"const": "taylor_1999",
"default": "taylor_1999",
"description": "The Taylor (1999) rule",
"title": "Calculation",
"type": "string"
},
"gap_measure": {
"anyOf": [
{
"$ref": "#/$defs/input.GapMeasure"
},
{
"type": "null"
}
],
"default": null,
"description": "How the resource gap is measured; left out, it follows the fields given"
},
"inflation": {
"description": "Inflation the rule answers: over the past four quarters, or a forecast",
"maximum": 0.5,
"minimum": -0.2,
"title": "Inflation",
"type": "number",
"x-unit": "rate"
},
"inflation_target": {
"default": 0.02,
"description": "The inflation objective",
"maximum": 0.1,
"minimum": 0,
"title": "Inflation Target",
"type": "number",
"x-unit": "rate"
},
"inflation_weight": {
"default": 0.5,
"description": "Weight on the inflation gap",
"maximum": 4,
"minimum": 0,
"title": "Inflation Weight",
"type": "number",
"x-unit": "ratio"
},
"lower_bound": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "An effective lower bound that floors the prescription",
"title": "Lower Bound"
},
"natural_unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The natural (longer-run) rate of unemployment",
"title": "Natural Unemployment"
},
"neutral_nominal_rate": {
"anyOf": [
{
"maximum": 0.2,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The nominal neutral rate, r* plus the target (the SEP's longer-run rate)",
"title": "Neutral Nominal Rate"
},
"neutral_real_rate": {
"anyOf": [
{
"maximum": 0.1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The real neutral rate, r*",
"title": "Neutral Real Rate"
},
"okun_coefficient": {
"default": 2,
"description": "Output-gap points per point of unemployment gap (Okun's law)",
"maximum": 4,
"minimum": 0.1,
"title": "Okun Coefficient",
"type": "number",
"x-unit": "ratio"
},
"output_gap": {
"anyOf": [
{
"maximum": 0.3,
"minimum": -0.3,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "Output gap: real GDP over potential, less one",
"title": "Output Gap"
},
"previous_rate": {
"anyOf": [
{
"maximum": 1,
"minimum": -0.1,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The policy rate before the rule's date, for smoothing",
"title": "Previous Rate"
},
"resource_weight": {
"default": 1,
"description": "Weight on the resource gap",
"maximum": 4,
"minimum": 0,
"title": "Resource Weight",
"type": "number",
"x-unit": "ratio"
},
"smoothing": {
"default": 0,
"description": "Weight on the previous rate (the inertial form); 0 is none",
"maximum": 1,
"minimum": 0,
"title": "Smoothing",
"type": "number",
"x-unit": "ratio"
},
"unemployment": {
"anyOf": [
{
"maximum": 0.3,
"minimum": 0,
"type": "number",
"x-unit": "rate"
},
{
"type": "null"
}
],
"default": null,
"description": "The unemployment rate",
"title": "Unemployment"
}
},
"required": [
"inflation"
],
"title": "Taylor1999Inputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "macro.policy_rule"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "Taylor (1993 and 1999), balanced-approach, shortfalls, adjusted and first-difference rules, smoothed and floored, on a gap measured in output or unemployment, and over forecast paths.",
"discriminator": {
"mapping": {
"adjusted_taylor_1993": "#/$defs/output.AdjustedTaylor1993Outputs",
"balanced_approach": "#/$defs/output.BalancedApproachOutputs",
"balanced_approach_shortfalls": "#/$defs/output.ShortfallsOutputs",
"first_difference": "#/$defs/output.FirstDifferenceOutputs",
"path": "#/$defs/output.PathOutputs",
"taylor_1993": "#/$defs/output.Taylor1993Outputs",
"taylor_1999": "#/$defs/output.Taylor1999Outputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.Taylor1993Outputs"
},
{
"$ref": "#/$defs/output.Taylor1999Outputs"
},
{
"$ref": "#/$defs/output.BalancedApproachOutputs"
},
{
"$ref": "#/$defs/output.ShortfallsOutputs"
},
{
"$ref": "#/$defs/output.AdjustedTaylor1993Outputs"
},
{
"$ref": "#/$defs/output.FirstDifferenceOutputs"
},
{
"$ref": "#/$defs/output.PathOutputs"
}
],
"title": "Monetary-policy rules: outputs"
},
"output.AdjustedTaylor1993Outputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "adjusted_taylor_1993",
"default": "adjusted_taylor_1993",
"description": "The adjusted Taylor (1993) rule",
"title": "Calculation",
"type": "string"
},
"inflation_gap_term": {
"description": "The weight on inflation times its gap",
"maximum": 20,
"minimum": -20,
"title": "Inflation Gap Term",
"type": "number",
"x-unit": "rate"
},
"nominal_neutral_rate": {
"description": "The real neutral rate plus the target: the rate at no gaps",
"maximum": 0.2,
"minimum": -0.1,
"title": "Nominal Neutral Rate",
"type": "number",
"x-unit": "rate"
},
"prescribed_rate": {
"description": "The policy rate the rule prescribes",
"maximum": 20,
"minimum": -20,
"title": "Prescribed Rate",
"type": "number",
"x-unit": "rate"
},
"resource_gap_term": {
"description": "The weight on the resource gap times the gap",
"maximum": 20,
"minimum": -20,
"title": "Resource Gap Term",
"type": "number",
"x-unit": "rate"
},
"unconstrained_rate": {
"description": "The prescription before the lower bound: the rule, smoothed",
"maximum": 20,
"minimum": -20,
"title": "Unconstrained Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"prescribed_rate",
"unconstrained_rate",
"inflation_gap_term",
"resource_gap_term",
"nominal_neutral_rate"
],
"title": "AdjustedTaylor1993Outputs",
"type": "object"
},
"output.BalancedApproachOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "balanced_approach",
"default": "balanced_approach",
"description": "The balanced-approach rule",
"title": "Calculation",
"type": "string"
},
"inflation_gap_term": {
"description": "The weight on inflation times its gap",
"maximum": 20,
"minimum": -20,
"title": "Inflation Gap Term",
"type": "number",
"x-unit": "rate"
},
"nominal_neutral_rate": {
"description": "The real neutral rate plus the target: the rate at no gaps",
"maximum": 0.2,
"minimum": -0.1,
"title": "Nominal Neutral Rate",
"type": "number",
"x-unit": "rate"
},
"prescribed_rate": {
"description": "The policy rate the rule prescribes",
"maximum": 20,
"minimum": -20,
"title": "Prescribed Rate",
"type": "number",
"x-unit": "rate"
},
"resource_gap_term": {
"description": "The weight on the resource gap times the gap",
"maximum": 20,
"minimum": -20,
"title": "Resource Gap Term",
"type": "number",
"x-unit": "rate"
},
"unconstrained_rate": {
"description": "The prescription before the lower bound: the rule, smoothed",
"maximum": 20,
"minimum": -20,
"title": "Unconstrained Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"prescribed_rate",
"unconstrained_rate",
"inflation_gap_term",
"resource_gap_term",
"nominal_neutral_rate"
],
"title": "BalancedApproachOutputs",
"type": "object"
},
"output.FirstDifferenceOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "first_difference",
"default": "first_difference",
"description": "The first-difference rule",
"title": "Calculation",
"type": "string"
},
"inflation_gap_term": {
"description": "The weight on inflation times its gap",
"maximum": 20,
"minimum": -20,
"title": "Inflation Gap Term",
"type": "number",
"x-unit": "rate"
},
"prescribed_rate": {
"description": "The policy rate the rule prescribes",
"maximum": 20,
"minimum": -20,
"title": "Prescribed Rate",
"type": "number",
"x-unit": "rate"
},
"resource_gap_term": {
"description": "The weight on the resource gap times the gap",
"maximum": 20,
"minimum": -20,
"title": "Resource Gap Term",
"type": "number",
"x-unit": "rate"
},
"unconstrained_rate": {
"description": "The prescription before the lower bound: the rule, smoothed",
"maximum": 20,
"minimum": -20,
"title": "Unconstrained Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"prescribed_rate",
"unconstrained_rate",
"inflation_gap_term",
"resource_gap_term"
],
"title": "FirstDifferenceOutputs",
"type": "object"
},
"output.PathOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "path",
"default": "path",
"description": "A rule over a forecast",
"title": "Calculation",
"type": "string"
},
"horizon": {
"description": "Horizons after the first: 0, 1, 2, ...",
"items": {
"maximum": 40,
"minimum": 0,
"type": "integer",
"x-unit": "count"
},
"maxItems": 40,
"title": "Horizon",
"type": "array"
},
"lower_path": {
"description": "The band's lower edge (low inflation, weak activity); empty with no band",
"items": {
"maximum": 500,
"minimum": -500,
"type": "number",
"x-unit": "rate"
},
"maxItems": 40,
"title": "Lower Path",
"type": "array"
},
"prescribed_path": {
"description": "The prescribed rate at each horizon",
"items": {
"maximum": 500,
"minimum": -500,
"type": "number",
"x-unit": "rate"
},
"maxItems": 40,
"title": "Prescribed Path",
"type": "array"
},
"rule": {
"$ref": "#/$defs/output.RuleName",
"description": "The rule applied at each horizon"
},
"unconstrained_path": {
"description": "Each prescription before the lower bound",
"items": {
"maximum": 500,
"minimum": -500,
"type": "number",
"x-unit": "rate"
},
"maxItems": 40,
"title": "Unconstrained Path",
"type": "array"
},
"upper_path": {
"description": "The band's upper edge (high inflation, strong activity); empty with no band",
"items": {
"maximum": 500,
"minimum": -500,
"type": "number",
"x-unit": "rate"
},
"maxItems": 40,
"title": "Upper Path",
"type": "array"
}
},
"required": [
"rule",
"horizon",
"prescribed_path",
"unconstrained_path",
"lower_path",
"upper_path"
],
"title": "PathOutputs",
"type": "object"
},
"output.RuleName": {
"enum": [
"taylor_1993",
"taylor_1999",
"balanced_approach",
"balanced_approach_shortfalls",
"adjusted_taylor_1993",
"first_difference"
],
"type": "string"
},
"output.ShortfallsOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "balanced_approach_shortfalls",
"default": "balanced_approach_shortfalls",
"description": "The balanced-approach (shortfalls) rule",
"title": "Calculation",
"type": "string"
},
"inflation_gap_term": {
"description": "The weight on inflation times its gap",
"maximum": 20,
"minimum": -20,
"title": "Inflation Gap Term",
"type": "number",
"x-unit": "rate"
},
"nominal_neutral_rate": {
"description": "The real neutral rate plus the target: the rate at no gaps",
"maximum": 0.2,
"minimum": -0.1,
"title": "Nominal Neutral Rate",
"type": "number",
"x-unit": "rate"
},
"prescribed_rate": {
"description": "The policy rate the rule prescribes",
"maximum": 20,
"minimum": -20,
"title": "Prescribed Rate",
"type": "number",
"x-unit": "rate"
},
"resource_gap_term": {
"description": "The weight on the resource gap times the gap",
"maximum": 20,
"minimum": -20,
"title": "Resource Gap Term",
"type": "number",
"x-unit": "rate"
},
"unconstrained_rate": {
"description": "The prescription before the lower bound: the rule, smoothed",
"maximum": 20,
"minimum": -20,
"title": "Unconstrained Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"prescribed_rate",
"unconstrained_rate",
"inflation_gap_term",
"resource_gap_term",
"nominal_neutral_rate"
],
"title": "ShortfallsOutputs",
"type": "object"
},
"output.Taylor1993Outputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "taylor_1993",
"default": "taylor_1993",
"description": "The Taylor (1993) rule",
"title": "Calculation",
"type": "string"
},
"inflation_gap_term": {
"description": "The weight on inflation times its gap",
"maximum": 20,
"minimum": -20,
"title": "Inflation Gap Term",
"type": "number",
"x-unit": "rate"
},
"nominal_neutral_rate": {
"description": "The real neutral rate plus the target: the rate at no gaps",
"maximum": 0.2,
"minimum": -0.1,
"title": "Nominal Neutral Rate",
"type": "number",
"x-unit": "rate"
},
"prescribed_rate": {
"description": "The policy rate the rule prescribes",
"maximum": 20,
"minimum": -20,
"title": "Prescribed Rate",
"type": "number",
"x-unit": "rate"
},
"resource_gap_term": {
"description": "The weight on the resource gap times the gap",
"maximum": 20,
"minimum": -20,
"title": "Resource Gap Term",
"type": "number",
"x-unit": "rate"
},
"unconstrained_rate": {
"description": "The prescription before the lower bound: the rule, smoothed",
"maximum": 20,
"minimum": -20,
"title": "Unconstrained Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"prescribed_rate",
"unconstrained_rate",
"inflation_gap_term",
"resource_gap_term",
"nominal_neutral_rate"
],
"title": "Taylor1993Outputs",
"type": "object"
},
"output.Taylor1999Outputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "taylor_1999",
"default": "taylor_1999",
"description": "The Taylor (1999) rule",
"title": "Calculation",
"type": "string"
},
"inflation_gap_term": {
"description": "The weight on inflation times its gap",
"maximum": 20,
"minimum": -20,
"title": "Inflation Gap Term",
"type": "number",
"x-unit": "rate"
},
"nominal_neutral_rate": {
"description": "The real neutral rate plus the target: the rate at no gaps",
"maximum": 0.2,
"minimum": -0.1,
"title": "Nominal Neutral Rate",
"type": "number",
"x-unit": "rate"
},
"prescribed_rate": {
"description": "The policy rate the rule prescribes",
"maximum": 20,
"minimum": -20,
"title": "Prescribed Rate",
"type": "number",
"x-unit": "rate"
},
"resource_gap_term": {
"description": "The weight on the resource gap times the gap",
"maximum": 20,
"minimum": -20,
"title": "Resource Gap Term",
"type": "number",
"x-unit": "rate"
},
"unconstrained_rate": {
"description": "The prescription before the lower bound: the rule, smoothed",
"maximum": 20,
"minimum": -20,
"title": "Unconstrained Rate",
"type": "number",
"x-unit": "rate"
}
},
"required": [
"prescribed_rate",
"unconstrained_rate",
"inflation_gap_term",
"resource_gap_term",
"nominal_neutral_rate"
],
"title": "Taylor1999Outputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "macro.policy_rule"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Monetary-policy rules: result",
"type": "object"
}
},
{
"description": "Sharpe, Sortino, Treynor, Jensen's alpha, information ratio and tracking error, M², Calmar and up- and down-capture ratios from return series. Runs Risk-adjusted performance (performance.risk_adjusted, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$id": "urn:pyeconomics:model:performance.risk_adjusted:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "Sharpe, Sortino, Treynor, Jensen's alpha, information ratio and tracking error, M², Calmar and up- and down-capture ratios from return series.",
"examples": [
{
"benchmark_returns": [
0.018,
-0.01,
0.029,
0.011,
-0.025,
0.012,
0.022,
-0.002,
0.01,
0.016,
-0.028,
0.02
],
"minimum_acceptable_return": 0,
"periods_per_year": 12,
"returns": [
0.021,
-0.013,
0.034,
0.008,
-0.022,
0.015,
0.027,
-0.005,
0.012,
0.019,
-0.031,
0.024
],
"risk_free_returns": [
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002
]
}
],
"properties": {
"benchmark_returns": {
"description": "Benchmark return each period, aligned with the portfolio's",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 2,
"title": "Benchmark Returns",
"type": "array"
},
"minimum_acceptable_return": {
"default": 0,
"description": "Minimum acceptable return per period, for the Sortino ratio",
"maximum": 100,
"minimum": -1,
"title": "Minimum Acceptable Return",
"type": "number",
"x-unit": "return"
},
"periods_per_year": {
"description": "Periods in a year, such as 12 or 252",
"exclusiveMinimum": 0,
"maximum": 100000,
"title": "Periods Per Year",
"type": "number",
"x-unit": "periods"
},
"returns": {
"description": "Portfolio return each period",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 2,
"title": "Returns",
"type": "array"
},
"risk_free_returns": {
"default": [],
"description": "Risk-free return each period; omit for zero",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"title": "Risk Free Returns",
"type": "array"
}
},
"required": [
"returns",
"benchmark_returns",
"periods_per_year"
],
"title": "Risk-adjusted performance: inputs",
"type": "object"
},
"name": "performance_risk_adjusted",
"outputSchema": {
"$defs": {
"input": {
"additionalProperties": false,
"description": "Sharpe, Sortino, Treynor, Jensen's alpha, information ratio and tracking error, M², Calmar and up- and down-capture ratios from return series.",
"examples": [
{
"benchmark_returns": [
0.018,
-0.01,
0.029,
0.011,
-0.025,
0.012,
0.022,
-0.002,
0.01,
0.016,
-0.028,
0.02
],
"minimum_acceptable_return": 0,
"periods_per_year": 12,
"returns": [
0.021,
-0.013,
0.034,
0.008,
-0.022,
0.015,
0.027,
-0.005,
0.012,
0.019,
-0.031,
0.024
],
"risk_free_returns": [
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002,
0.002
]
}
],
"properties": {
"benchmark_returns": {
"description": "Benchmark return each period, aligned with the portfolio's",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 2,
"title": "Benchmark Returns",
"type": "array"
},
"minimum_acceptable_return": {
"default": 0,
"description": "Minimum acceptable return per period, for the Sortino ratio",
"maximum": 100,
"minimum": -1,
"title": "Minimum Acceptable Return",
"type": "number",
"x-unit": "return"
},
"periods_per_year": {
"description": "Periods in a year, such as 12 or 252",
"exclusiveMinimum": 0,
"maximum": 100000,
"title": "Periods Per Year",
"type": "number",
"x-unit": "periods"
},
"returns": {
"description": "Portfolio return each period",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 2,
"title": "Returns",
"type": "array"
},
"risk_free_returns": {
"default": [],
"description": "Risk-free return each period; omit for zero",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"title": "Risk Free Returns",
"type": "array"
}
},
"required": [
"returns",
"benchmark_returns",
"periods_per_year"
],
"title": "Risk-adjusted performance: inputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "performance.risk_adjusted"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"additionalProperties": false,
"description": "Sharpe, Sortino, Treynor, Jensen's alpha, information ratio and tracking error, M², Calmar and up- and down-capture ratios from return series.",
"properties": {
"annualized_return": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
{
"type": "null"
}
],
"description": "Compound annual growth rate of the portfolio",
"title": "Annualized Return"
},
"annualized_volatility": {
"description": "Standard deviation of the portfolio returns (n - 1) times sqrt(m)",
"maximum": 100000,
"minimum": 0,
"title": "Annualized Volatility",
"type": "number",
"x-unit": "volatility"
},
"beta": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"description": "Covariance of portfolio and benchmark excess returns over the benchmark's variance",
"title": "Beta"
},
"calmar_ratio": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"description": "Compound annual growth rate over the maximum drawdown",
"title": "Calmar Ratio"
},
"down_capture": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"description": "Geometric mean portfolio return over the benchmark's, in periods the benchmark fell",
"title": "Down Capture"
},
"downside_deviation": {
"description": "Root mean square shortfall below the minimum acceptable return (n), times sqrt(m)",
"maximum": 100000,
"minimum": 0,
"title": "Downside Deviation",
"type": "number",
"x-unit": "volatility"
},
"information_ratio": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"description": "Mean active return over its standard deviation, times sqrt(m)",
"title": "Information Ratio"
},
"jensen_alpha": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "return"
},
{
"type": "null"
}
],
"description": "Annualized intercept: m times (mean excess return - beta * benchmark's)",
"title": "Jensen Alpha"
},
"m_squared": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "return"
},
{
"type": "null"
}
],
"description": "Annualized risk-free return plus the Sharpe ratio times the benchmark's annualized excess volatility",
"title": "M Squared"
},
"max_drawdown": {
"description": "Largest decline of the wealth index from a peak",
"maximum": 1,
"minimum": 0,
"title": "Max Drawdown",
"type": "number",
"x-unit": "return"
},
"observations": {
"description": "Number of periods",
"maximum": 10080,
"minimum": 2,
"title": "Observations",
"type": "integer",
"x-unit": "count"
},
"sharpe_ratio": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"description": "Mean excess return over its standard deviation, times sqrt(m)",
"title": "Sharpe Ratio"
},
"sortino_ratio": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"description": "Mean return less the minimum acceptable return, over the downside deviation, times sqrt(m)",
"title": "Sortino Ratio"
},
"tracking_error": {
"description": "Standard deviation of the active returns (n - 1) times sqrt(m)",
"maximum": 100000,
"minimum": 0,
"title": "Tracking Error",
"type": "number",
"x-unit": "volatility"
},
"treynor_ratio": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"description": "Annualized mean excess return over beta",
"title": "Treynor Ratio"
},
"up_capture": {
"anyOf": [
{
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
{
"type": "null"
}
],
"description": "Geometric mean portfolio return over the benchmark's, in periods the benchmark rose",
"title": "Up Capture"
}
},
"required": [
"observations",
"annualized_return",
"annualized_volatility",
"sharpe_ratio",
"downside_deviation",
"sortino_ratio",
"beta",
"treynor_ratio",
"jensen_alpha",
"tracking_error",
"information_ratio",
"m_squared",
"max_drawdown",
"calmar_ratio",
"up_capture",
"down_capture"
],
"title": "Risk-adjusted performance: outputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "performance.risk_adjusted"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Risk-adjusted performance: result",
"type": "object"
}
},
{
"description": "Portfolio expected return and risk, the minimum-variance frontier with short sales, and the minimum-variance and tangency portfolios. Runs Mean-variance portfolios (portfolio.mean_variance, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: frontier, minimum_variance, portfolio, tangency. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"FrontierInputs": {
"additionalProperties": false,
"description": "How many points of the frontier to trace, and over which returns.",
"properties": {
"calculation": {
"const": "frontier",
"default": "frontier",
"description": "Minimum-variance frontier, short sales allowed",
"title": "Calculation",
"type": "string"
},
"correlations": {
"anyOf": [
{
"items": {
"items": {
"maximum": 1,
"minimum": -1,
"type": "number",
"x-unit": "correlation"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Correlation matrix of the asset returns, as rows, with volatilities",
"title": "Correlations"
},
"covariance": {
"anyOf": [
{
"items": {
"items": {
"maximum": 100,
"minimum": -100,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Covariance matrix of the asset returns per period, as rows; or give volatilities and correlations",
"title": "Covariance"
},
"expected_returns": {
"description": "Expected return of each asset per period",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 100,
"minItems": 1,
"title": "Expected Returns",
"type": "array"
},
"max_return": {
"anyOf": [
{
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
{
"type": "null"
}
],
"default": null,
"description": "Highest target return; by default the highest expected return of an asset",
"title": "Max Return"
},
"min_return": {
"anyOf": [
{
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
{
"type": "null"
}
],
"default": null,
"description": "Lowest target return; by default the minimum-variance return",
"title": "Min Return"
},
"points": {
"default": 21,
"description": "Number of target returns to trace",
"maximum": 200,
"minimum": 2,
"title": "Points",
"type": "integer",
"x-unit": "count"
},
"volatilities": {
"anyOf": [
{
"items": {
"exclusiveMinimum": 0,
"maximum": 10,
"type": "number",
"x-unit": "volatility"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Volatility of each asset per period, with correlations",
"title": "Volatilities"
}
},
"required": [
"expected_returns"
],
"title": "FrontierInputs",
"type": "object"
},
"MinimumVarianceInputs": {
"additionalProperties": false,
"description": "The assets alone.",
"properties": {
"calculation": {
"const": "minimum_variance",
"default": "minimum_variance",
"description": "Global minimum-variance portfolio",
"title": "Calculation",
"type": "string"
},
"correlations": {
"anyOf": [
{
"items": {
"items": {
"maximum": 1,
"minimum": -1,
"type": "number",
"x-unit": "correlation"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Correlation matrix of the asset returns, as rows, with volatilities",
"title": "Correlations"
},
"covariance": {
"anyOf": [
{
"items": {
"items": {
"maximum": 100,
"minimum": -100,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Covariance matrix of the asset returns per period, as rows; or give volatilities and correlations",
"title": "Covariance"
},
"expected_returns": {
"description": "Expected return of each asset per period",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 100,
"minItems": 1,
"title": "Expected Returns",
"type": "array"
},
"volatilities": {
"anyOf": [
{
"items": {
"exclusiveMinimum": 0,
"maximum": 10,
"type": "number",
"x-unit": "volatility"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Volatility of each asset per period, with correlations",
"title": "Volatilities"
}
},
"required": [
"expected_returns"
],
"title": "MinimumVarianceInputs",
"type": "object"
},
"PortfolioInputs": {
"additionalProperties": false,
"description": "Weights of a portfolio of the assets.",
"properties": {
"calculation": {
"const": "portfolio",
"default": "portfolio",
"description": "Expected return and risk of given weights",
"title": "Calculation",
"type": "string"
},
"correlations": {
"anyOf": [
{
"items": {
"items": {
"maximum": 1,
"minimum": -1,
"type": "number",
"x-unit": "correlation"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Correlation matrix of the asset returns, as rows, with volatilities",
"title": "Correlations"
},
"covariance": {
"anyOf": [
{
"items": {
"items": {
"maximum": 100,
"minimum": -100,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Covariance matrix of the asset returns per period, as rows; or give volatilities and correlations",
"title": "Covariance"
},
"expected_returns": {
"description": "Expected return of each asset per period",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 100,
"minItems": 1,
"title": "Expected Returns",
"type": "array"
},
"volatilities": {
"anyOf": [
{
"items": {
"exclusiveMinimum": 0,
"maximum": 10,
"type": "number",
"x-unit": "volatility"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Volatility of each asset per period, with correlations",
"title": "Volatilities"
},
"weights": {
"description": "Weight of each asset; negative is short. They need not sum to 1",
"items": {
"maximum": 100,
"minimum": -100,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"minItems": 1,
"title": "Weights",
"type": "array"
}
},
"required": [
"expected_returns",
"weights"
],
"title": "PortfolioInputs",
"type": "object"
},
"TangencyInputs": {
"additionalProperties": false,
"description": "The assets and a risk-free rate per period.",
"properties": {
"calculation": {
"const": "tangency",
"default": "tangency",
"description": "Tangency portfolio and the capital market line",
"title": "Calculation",
"type": "string"
},
"correlations": {
"anyOf": [
{
"items": {
"items": {
"maximum": 1,
"minimum": -1,
"type": "number",
"x-unit": "correlation"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Correlation matrix of the asset returns, as rows, with volatilities",
"title": "Correlations"
},
"covariance": {
"anyOf": [
{
"items": {
"items": {
"maximum": 100,
"minimum": -100,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Covariance matrix of the asset returns per period, as rows; or give volatilities and correlations",
"title": "Covariance"
},
"expected_returns": {
"description": "Expected return of each asset per period",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 100,
"minItems": 1,
"title": "Expected Returns",
"type": "array"
},
"risk_free_rate": {
"description": "Risk-free rate per period",
"maximum": 10,
"minimum": -0.99,
"title": "Risk Free Rate",
"type": "number",
"x-unit": "rate"
},
"volatilities": {
"anyOf": [
{
"items": {
"exclusiveMinimum": 0,
"maximum": 10,
"type": "number",
"x-unit": "volatility"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Volatility of each asset per period, with correlations",
"title": "Volatilities"
}
},
"required": [
"expected_returns",
"risk_free_rate"
],
"title": "TangencyInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:portfolio.mean_variance:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "Portfolio expected return and risk, the minimum-variance frontier with short sales, and the minimum-variance and tangency portfolios.",
"discriminator": {
"mapping": {
"frontier": "#/$defs/FrontierInputs",
"minimum_variance": "#/$defs/MinimumVarianceInputs",
"portfolio": "#/$defs/PortfolioInputs",
"tangency": "#/$defs/TangencyInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "portfolio",
"correlations": [
[
1,
0.3
],
[
0.3,
1
]
],
"covariance": null,
"expected_returns": [
0.1,
0.06
],
"volatilities": [
0.2,
0.1
],
"weights": [
0.6,
0.4
]
},
{
"calculation": "frontier",
"correlations": [
[
1,
0.3,
0.2
],
[
0.3,
1,
0.5
],
[
0.2,
0.5,
1
]
],
"covariance": null,
"expected_returns": [
0.08,
0.12,
0.15
],
"max_return": null,
"min_return": null,
"points": 5,
"volatilities": [
0.15,
0.2,
0.25
]
},
{
"calculation": "minimum_variance",
"correlations": [
[
1,
0.3,
0.2
],
[
0.3,
1,
0.5
],
[
0.2,
0.5,
1
]
],
"covariance": null,
"expected_returns": [
0.08,
0.12,
0.15
],
"volatilities": [
0.15,
0.2,
0.25
]
},
{
"calculation": "tangency",
"correlations": [
[
1,
0.3,
0.2
],
[
0.3,
1,
0.5
],
[
0.2,
0.5,
1
]
],
"covariance": null,
"expected_returns": [
0.08,
0.12,
0.15
],
"risk_free_rate": 0.03,
"volatilities": [
0.15,
0.2,
0.25
]
}
],
"oneOf": [
{
"$ref": "#/$defs/PortfolioInputs"
},
{
"$ref": "#/$defs/FrontierInputs"
},
{
"$ref": "#/$defs/MinimumVarianceInputs"
},
{
"$ref": "#/$defs/TangencyInputs"
}
],
"title": "Mean-variance portfolios: inputs",
"type": "object"
},
"name": "portfolio_mean_variance",
"outputSchema": {
"$defs": {
"input": {
"description": "Portfolio expected return and risk, the minimum-variance frontier with short sales, and the minimum-variance and tangency portfolios.",
"discriminator": {
"mapping": {
"frontier": "#/$defs/input.FrontierInputs",
"minimum_variance": "#/$defs/input.MinimumVarianceInputs",
"portfolio": "#/$defs/input.PortfolioInputs",
"tangency": "#/$defs/input.TangencyInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "portfolio",
"correlations": [
[
1,
0.3
],
[
0.3,
1
]
],
"covariance": null,
"expected_returns": [
0.1,
0.06
],
"volatilities": [
0.2,
0.1
],
"weights": [
0.6,
0.4
]
},
{
"calculation": "frontier",
"correlations": [
[
1,
0.3,
0.2
],
[
0.3,
1,
0.5
],
[
0.2,
0.5,
1
]
],
"covariance": null,
"expected_returns": [
0.08,
0.12,
0.15
],
"max_return": null,
"min_return": null,
"points": 5,
"volatilities": [
0.15,
0.2,
0.25
]
},
{
"calculation": "minimum_variance",
"correlations": [
[
1,
0.3,
0.2
],
[
0.3,
1,
0.5
],
[
0.2,
0.5,
1
]
],
"covariance": null,
"expected_returns": [
0.08,
0.12,
0.15
],
"volatilities": [
0.15,
0.2,
0.25
]
},
{
"calculation": "tangency",
"correlations": [
[
1,
0.3,
0.2
],
[
0.3,
1,
0.5
],
[
0.2,
0.5,
1
]
],
"covariance": null,
"expected_returns": [
0.08,
0.12,
0.15
],
"risk_free_rate": 0.03,
"volatilities": [
0.15,
0.2,
0.25
]
}
],
"oneOf": [
{
"$ref": "#/$defs/input.PortfolioInputs"
},
{
"$ref": "#/$defs/input.FrontierInputs"
},
{
"$ref": "#/$defs/input.MinimumVarianceInputs"
},
{
"$ref": "#/$defs/input.TangencyInputs"
}
],
"title": "Mean-variance portfolios: inputs"
},
"input.FrontierInputs": {
"additionalProperties": false,
"description": "How many points of the frontier to trace, and over which returns.",
"properties": {
"calculation": {
"const": "frontier",
"default": "frontier",
"description": "Minimum-variance frontier, short sales allowed",
"title": "Calculation",
"type": "string"
},
"correlations": {
"anyOf": [
{
"items": {
"items": {
"maximum": 1,
"minimum": -1,
"type": "number",
"x-unit": "correlation"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Correlation matrix of the asset returns, as rows, with volatilities",
"title": "Correlations"
},
"covariance": {
"anyOf": [
{
"items": {
"items": {
"maximum": 100,
"minimum": -100,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Covariance matrix of the asset returns per period, as rows; or give volatilities and correlations",
"title": "Covariance"
},
"expected_returns": {
"description": "Expected return of each asset per period",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 100,
"minItems": 1,
"title": "Expected Returns",
"type": "array"
},
"max_return": {
"anyOf": [
{
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
{
"type": "null"
}
],
"default": null,
"description": "Highest target return; by default the highest expected return of an asset",
"title": "Max Return"
},
"min_return": {
"anyOf": [
{
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
{
"type": "null"
}
],
"default": null,
"description": "Lowest target return; by default the minimum-variance return",
"title": "Min Return"
},
"points": {
"default": 21,
"description": "Number of target returns to trace",
"maximum": 200,
"minimum": 2,
"title": "Points",
"type": "integer",
"x-unit": "count"
},
"volatilities": {
"anyOf": [
{
"items": {
"exclusiveMinimum": 0,
"maximum": 10,
"type": "number",
"x-unit": "volatility"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Volatility of each asset per period, with correlations",
"title": "Volatilities"
}
},
"required": [
"expected_returns"
],
"title": "FrontierInputs",
"type": "object"
},
"input.MinimumVarianceInputs": {
"additionalProperties": false,
"description": "The assets alone.",
"properties": {
"calculation": {
"const": "minimum_variance",
"default": "minimum_variance",
"description": "Global minimum-variance portfolio",
"title": "Calculation",
"type": "string"
},
"correlations": {
"anyOf": [
{
"items": {
"items": {
"maximum": 1,
"minimum": -1,
"type": "number",
"x-unit": "correlation"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Correlation matrix of the asset returns, as rows, with volatilities",
"title": "Correlations"
},
"covariance": {
"anyOf": [
{
"items": {
"items": {
"maximum": 100,
"minimum": -100,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Covariance matrix of the asset returns per period, as rows; or give volatilities and correlations",
"title": "Covariance"
},
"expected_returns": {
"description": "Expected return of each asset per period",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 100,
"minItems": 1,
"title": "Expected Returns",
"type": "array"
},
"volatilities": {
"anyOf": [
{
"items": {
"exclusiveMinimum": 0,
"maximum": 10,
"type": "number",
"x-unit": "volatility"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Volatility of each asset per period, with correlations",
"title": "Volatilities"
}
},
"required": [
"expected_returns"
],
"title": "MinimumVarianceInputs",
"type": "object"
},
"input.PortfolioInputs": {
"additionalProperties": false,
"description": "Weights of a portfolio of the assets.",
"properties": {
"calculation": {
"const": "portfolio",
"default": "portfolio",
"description": "Expected return and risk of given weights",
"title": "Calculation",
"type": "string"
},
"correlations": {
"anyOf": [
{
"items": {
"items": {
"maximum": 1,
"minimum": -1,
"type": "number",
"x-unit": "correlation"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Correlation matrix of the asset returns, as rows, with volatilities",
"title": "Correlations"
},
"covariance": {
"anyOf": [
{
"items": {
"items": {
"maximum": 100,
"minimum": -100,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Covariance matrix of the asset returns per period, as rows; or give volatilities and correlations",
"title": "Covariance"
},
"expected_returns": {
"description": "Expected return of each asset per period",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 100,
"minItems": 1,
"title": "Expected Returns",
"type": "array"
},
"volatilities": {
"anyOf": [
{
"items": {
"exclusiveMinimum": 0,
"maximum": 10,
"type": "number",
"x-unit": "volatility"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Volatility of each asset per period, with correlations",
"title": "Volatilities"
},
"weights": {
"description": "Weight of each asset; negative is short. They need not sum to 1",
"items": {
"maximum": 100,
"minimum": -100,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"minItems": 1,
"title": "Weights",
"type": "array"
}
},
"required": [
"expected_returns",
"weights"
],
"title": "PortfolioInputs",
"type": "object"
},
"input.TangencyInputs": {
"additionalProperties": false,
"description": "The assets and a risk-free rate per period.",
"properties": {
"calculation": {
"const": "tangency",
"default": "tangency",
"description": "Tangency portfolio and the capital market line",
"title": "Calculation",
"type": "string"
},
"correlations": {
"anyOf": [
{
"items": {
"items": {
"maximum": 1,
"minimum": -1,
"type": "number",
"x-unit": "correlation"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Correlation matrix of the asset returns, as rows, with volatilities",
"title": "Correlations"
},
"covariance": {
"anyOf": [
{
"items": {
"items": {
"maximum": 100,
"minimum": -100,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"minItems": 1,
"type": "array"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Covariance matrix of the asset returns per period, as rows; or give volatilities and correlations",
"title": "Covariance"
},
"expected_returns": {
"description": "Expected return of each asset per period",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 100,
"minItems": 1,
"title": "Expected Returns",
"type": "array"
},
"risk_free_rate": {
"description": "Risk-free rate per period",
"maximum": 10,
"minimum": -0.99,
"title": "Risk Free Rate",
"type": "number",
"x-unit": "rate"
},
"volatilities": {
"anyOf": [
{
"items": {
"exclusiveMinimum": 0,
"maximum": 10,
"type": "number",
"x-unit": "volatility"
},
"maxLength": 100,
"minLength": 1,
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"description": "Volatility of each asset per period, with correlations",
"title": "Volatilities"
}
},
"required": [
"expected_returns",
"risk_free_rate"
],
"title": "TangencyInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "portfolio.mean_variance"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "Portfolio expected return and risk, the minimum-variance frontier with short sales, and the minimum-variance and tangency portfolios.",
"discriminator": {
"mapping": {
"frontier": "#/$defs/output.FrontierOutputs",
"minimum_variance": "#/$defs/output.MinimumVarianceOutputs",
"portfolio": "#/$defs/output.PortfolioOutputs",
"tangency": "#/$defs/output.TangencyOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.PortfolioOutputs"
},
{
"$ref": "#/$defs/output.FrontierOutputs"
},
{
"$ref": "#/$defs/output.MinimumVarianceOutputs"
},
{
"$ref": "#/$defs/output.TangencyOutputs"
}
],
"title": "Mean-variance portfolios: outputs"
},
"output.FrontierOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "frontier",
"default": "frontier",
"description": "Minimum-variance frontier, short sales allowed",
"title": "Calculation",
"type": "string"
},
"minimum_variance_return": {
"description": "Expected return of the minimum-variance portfolio",
"maximum": 1000000,
"minimum": -1000000,
"title": "Minimum Variance Return",
"type": "number",
"x-unit": "return"
},
"minimum_variance_volatility": {
"description": "Volatility of the minimum-variance portfolio",
"maximum": 10,
"minimum": 0,
"title": "Minimum Variance Volatility",
"type": "number",
"x-unit": "volatility"
},
"target_returns": {
"description": "Target expected returns, ascending",
"items": {
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "return"
},
"maxItems": 200,
"title": "Target Returns",
"type": "array"
},
"variances": {
"description": "Lowest variance at each target return",
"items": {
"maximum": 10000000000,
"minimum": 0,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 200,
"title": "Variances",
"type": "array"
},
"volatilities": {
"description": "Lowest volatility at each target return",
"items": {
"maximum": 100000,
"minimum": 0,
"type": "number",
"x-unit": "volatility"
},
"maxItems": 200,
"title": "Volatilities",
"type": "array"
},
"weights": {
"description": "Weights of the frontier portfolio at each target, as rows",
"items": {
"items": {
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"type": "array"
},
"maxItems": 200,
"title": "Weights",
"type": "array"
}
},
"required": [
"minimum_variance_return",
"minimum_variance_volatility",
"target_returns",
"variances",
"volatilities",
"weights"
],
"title": "FrontierOutputs",
"type": "object"
},
"output.MinimumVarianceOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "minimum_variance",
"default": "minimum_variance",
"description": "Global minimum-variance portfolio",
"title": "Calculation",
"type": "string"
},
"expected_return": {
"description": "Expected return per period",
"maximum": 1000000,
"minimum": -1000000,
"title": "Expected Return",
"type": "number",
"x-unit": "return"
},
"variance": {
"description": "Variance, 1 / A; never above the least risky asset's",
"maximum": 100,
"minimum": 0,
"title": "Variance",
"type": "number",
"x-unit": "ratio"
},
"volatility": {
"description": "Standard deviation of the return",
"maximum": 10,
"minimum": 0,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
},
"weights": {
"description": "Weight of each asset; they sum to 1",
"items": {
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"title": "Weights",
"type": "array"
}
},
"required": [
"weights",
"expected_return",
"variance",
"volatility"
],
"title": "MinimumVarianceOutputs",
"type": "object"
},
"output.PortfolioOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "portfolio",
"default": "portfolio",
"description": "Expected return and risk of given weights",
"title": "Calculation",
"type": "string"
},
"expected_return": {
"description": "Expected return per period, w'mu",
"maximum": 1000000,
"minimum": -1000000,
"title": "Expected Return",
"type": "number",
"x-unit": "return"
},
"variance": {
"description": "Variance of the return, w' Sigma w",
"maximum": 10000000000,
"minimum": 0,
"title": "Variance",
"type": "number",
"x-unit": "ratio"
},
"volatility": {
"description": "Standard deviation of the return",
"maximum": 100000,
"minimum": 0,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
},
"weight_sum": {
"description": "Sum of the weights",
"maximum": 10000,
"minimum": -10000,
"title": "Weight Sum",
"type": "number",
"x-unit": "ratio"
}
},
"required": [
"expected_return",
"variance",
"volatility",
"weight_sum"
],
"title": "PortfolioOutputs",
"type": "object"
},
"output.TangencyOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "tangency",
"default": "tangency",
"description": "Tangency portfolio and the capital market line",
"title": "Calculation",
"type": "string"
},
"capital_market_line_slope": {
"description": "Slope of the capital market line: the tangency portfolio's Sharpe ratio per period, the highest of any portfolio of the assets",
"maximum": 1000000,
"minimum": 0,
"title": "Capital Market Line Slope",
"type": "number",
"x-unit": "ratio"
},
"expected_return": {
"description": "Expected return per period",
"maximum": 1000000,
"minimum": -1000000,
"title": "Expected Return",
"type": "number",
"x-unit": "return"
},
"variance": {
"description": "Variance of the return",
"maximum": 10000000000,
"minimum": 0,
"title": "Variance",
"type": "number",
"x-unit": "ratio"
},
"volatility": {
"description": "Standard deviation of the return",
"maximum": 100000,
"minimum": 0,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
},
"weights": {
"description": "Weight of each asset; they sum to 1",
"items": {
"maximum": 1000000,
"minimum": -1000000,
"type": "number",
"x-unit": "ratio"
},
"maxItems": 100,
"title": "Weights",
"type": "array"
}
},
"required": [
"weights",
"expected_return",
"variance",
"volatility",
"capital_market_line_slope"
],
"title": "TangencyOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "portfolio.mean_variance"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Mean-variance portfolios: result",
"type": "object"
}
},
{
"description": "VaR and expected shortfall as positive losses by the parametric normal, Cornish-Fisher, historical, Monte Carlo and RiskMetrics EWMA methods. Runs Value-at-risk and expected shortfall (risk.value_at_risk, version 1) on the given inputs and returns its canonical result: the validated inputs, the outputs, the warnings and the manifest. The required calculation field selects one of: cornish_fisher, ewma, historical, monte_carlo, parametric. Every number carries its unit in the input schema; rates are decimals.",
"inputSchema": {
"$defs": {
"CornishFisherInputs": {
"additionalProperties": false,
"description": "The first four moments of returns per period.",
"properties": {
"calculation": {
"const": "cornish_fisher",
"default": "cornish_fisher",
"description": "Modified VaR and ES from skewness and kurtosis",
"title": "Calculation",
"type": "string"
},
"confidence": {
"default": 0.99,
"description": "One-tailed confidence level, such as 0.99",
"maximum": 0.9999,
"minimum": 0.5,
"title": "Confidence",
"type": "number",
"x-unit": "probability"
},
"excess_kurtosis": {
"default": 0,
"description": "Excess kurtosis of returns per period",
"maximum": 20,
"minimum": -2,
"title": "Excess Kurtosis",
"type": "number",
"x-unit": "ratio"
},
"horizon": {
"default": 1,
"description": "Horizon in periods of the returns, such as 10 days",
"maximum": 1000,
"minimum": 1,
"title": "Horizon",
"type": "number",
"x-unit": "periods"
},
"mean": {
"default": 0,
"description": "Mean return per period",
"maximum": 1,
"minimum": -1,
"title": "Mean",
"type": "number",
"x-unit": "return"
},
"position_value": {
"default": 1,
"description": "Position value; the default of 1 makes the amounts the decimals",
"exclusiveMinimum": 0,
"maximum": 10000000000,
"title": "Position Value",
"type": "number",
"x-unit": "money"
},
"skewness": {
"default": 0,
"description": "Skewness of returns per period",
"maximum": 3,
"minimum": -3,
"title": "Skewness",
"type": "number",
"x-unit": "ratio"
},
"volatility": {
"description": "Standard deviation of returns per period",
"exclusiveMinimum": 0,
"maximum": 2,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
}
},
"required": [
"volatility"
],
"title": "CornishFisherInputs",
"type": "object"
},
"EwmaInputs": {
"additionalProperties": false,
"description": "A return series and the RiskMetrics decay factor.",
"properties": {
"calculation": {
"const": "ewma",
"default": "ewma",
"description": "RiskMetrics EWMA volatility with normal VaR and ES",
"title": "Calculation",
"type": "string"
},
"confidence": {
"default": 0.99,
"description": "One-tailed confidence level, such as 0.99",
"maximum": 0.9999,
"minimum": 0.5,
"title": "Confidence",
"type": "number",
"x-unit": "probability"
},
"decay": {
"default": 0.94,
"description": "Decay factor lambda (RiskMetrics uses 0.94 for daily data)",
"maximum": 0.999,
"minimum": 0.5,
"title": "Decay",
"type": "number",
"x-unit": "ratio"
},
"horizon": {
"default": 1,
"description": "Horizon in periods of the returns, such as 10 days",
"maximum": 1000,
"minimum": 1,
"title": "Horizon",
"type": "number",
"x-unit": "periods"
},
"position_value": {
"default": 1,
"description": "Position value; the default of 1 makes the amounts the decimals",
"exclusiveMinimum": 0,
"maximum": 10000000000,
"title": "Position Value",
"type": "number",
"x-unit": "money"
},
"returns": {
"description": "Returns per period, oldest first",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 1,
"title": "Returns",
"type": "array"
}
},
"required": [
"returns"
],
"title": "EwmaInputs",
"type": "object"
},
"HistoricalInputs": {
"additionalProperties": false,
"description": "A return series and the rule that picks its quantile.",
"properties": {
"calculation": {
"const": "historical",
"default": "historical",
"description": "Historical-simulation VaR and ES",
"title": "Calculation",
"type": "string"
},
"confidence": {
"default": 0.99,
"description": "One-tailed confidence level, such as 0.99",
"maximum": 0.9999,
"minimum": 0.5,
"title": "Confidence",
"type": "number",
"x-unit": "probability"
},
"horizon": {
"default": 1,
"description": "Horizon in periods of the returns, such as 10 days",
"maximum": 1000,
"minimum": 1,
"title": "Horizon",
"type": "number",
"x-unit": "periods"
},
"interpolation": {
"default": "linear",
"description": "How the quantile falls between two returns (NumPy's methods; linear is Hyndman and Fan's definition 7)",
"enum": [
"linear",
"lower",
"higher",
"midpoint",
"nearest"
],
"title": "Interpolation",
"type": "string"
},
"position_value": {
"default": 1,
"description": "Position value; the default of 1 makes the amounts the decimals",
"exclusiveMinimum": 0,
"maximum": 10000000000,
"title": "Position Value",
"type": "number",
"x-unit": "money"
},
"returns": {
"description": "Returns per period, in time order",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 2,
"title": "Returns",
"type": "array"
}
},
"required": [
"returns"
],
"title": "HistoricalInputs",
"type": "object"
},
"MonteCarloInputs": {
"additionalProperties": false,
"description": "A return distribution and the size of the simulation.",
"properties": {
"calculation": {
"const": "monte_carlo",
"default": "monte_carlo",
"description": "Monte Carlo VaR and ES with standard errors",
"title": "Calculation",
"type": "string"
},
"confidence": {
"default": 0.99,
"description": "One-tailed confidence level, such as 0.99",
"maximum": 0.9999,
"minimum": 0.5,
"title": "Confidence",
"type": "number",
"x-unit": "probability"
},
"degrees_of_freedom": {
"default": 5,
"description": "Student-t degrees of freedom; ignored for the normal",
"exclusiveMinimum": 2,
"maximum": 1000,
"title": "Degrees Of Freedom",
"type": "number",
"x-unit": "ratio"
},
"distribution": {
"default": "normal",
"description": "Distribution of the standardized horizon return",
"enum": [
"normal",
"student_t"
],
"title": "Distribution",
"type": "string"
},
"horizon": {
"default": 1,
"description": "Horizon in periods of the returns, such as 10 days",
"maximum": 1000,
"minimum": 1,
"title": "Horizon",
"type": "number",
"x-unit": "periods"
},
"mean": {
"default": 0,
"description": "Mean return per period",
"maximum": 1,
"minimum": -1,
"title": "Mean",
"type": "number",
"x-unit": "return"
},
"position_value": {
"default": 1,
"description": "Position value; the default of 1 makes the amounts the decimals",
"exclusiveMinimum": 0,
"maximum": 10000000000,
"title": "Position Value",
"type": "number",
"x-unit": "money"
},
"seed": {
"default": 0,
"description": "Random seed (ADR-0008 decision 7): the same seed, the same draws",
"maximum": 9007199254740991,
"minimum": 0,
"title": "Seed",
"type": "integer",
"x-unit": "count"
},
"simulations": {
"default": 100000,
"description": "Number of simulated horizon returns",
"maximum": 1000000,
"minimum": 10000,
"title": "Simulations",
"type": "integer",
"x-unit": "count"
},
"volatility": {
"description": "Standard deviation of returns per period",
"exclusiveMinimum": 0,
"maximum": 2,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
}
},
"required": [
"volatility"
],
"title": "MonteCarloInputs",
"type": "object"
},
"ParametricInputs": {
"additionalProperties": false,
"description": "Normal returns with a mean and a volatility per period.",
"properties": {
"calculation": {
"const": "parametric",
"default": "parametric",
"description": "Normal VaR and ES",
"title": "Calculation",
"type": "string"
},
"confidence": {
"default": 0.99,
"description": "One-tailed confidence level, such as 0.99",
"maximum": 0.9999,
"minimum": 0.5,
"title": "Confidence",
"type": "number",
"x-unit": "probability"
},
"horizon": {
"default": 1,
"description": "Horizon in periods of the returns, such as 10 days",
"maximum": 1000,
"minimum": 1,
"title": "Horizon",
"type": "number",
"x-unit": "periods"
},
"mean": {
"default": 0,
"description": "Mean return per period",
"maximum": 1,
"minimum": -1,
"title": "Mean",
"type": "number",
"x-unit": "return"
},
"position_value": {
"default": 1,
"description": "Position value; the default of 1 makes the amounts the decimals",
"exclusiveMinimum": 0,
"maximum": 10000000000,
"title": "Position Value",
"type": "number",
"x-unit": "money"
},
"volatility": {
"description": "Standard deviation of returns per period",
"exclusiveMinimum": 0,
"maximum": 2,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
}
},
"required": [
"volatility"
],
"title": "ParametricInputs",
"type": "object"
}
},
"$id": "urn:pyeconomics:model:risk.value_at_risk:1:input",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"description": "VaR and expected shortfall as positive losses by the parametric normal, Cornish-Fisher, historical, Monte Carlo and RiskMetrics EWMA methods.",
"discriminator": {
"mapping": {
"cornish_fisher": "#/$defs/CornishFisherInputs",
"ewma": "#/$defs/EwmaInputs",
"historical": "#/$defs/HistoricalInputs",
"monte_carlo": "#/$defs/MonteCarloInputs",
"parametric": "#/$defs/ParametricInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "parametric",
"confidence": 0.99,
"horizon": 10,
"mean": 0,
"position_value": 1000000,
"volatility": 0.012
},
{
"calculation": "cornish_fisher",
"confidence": 0.99,
"excess_kurtosis": 2,
"horizon": 1,
"mean": 0.0005,
"position_value": 1,
"skewness": -0.5,
"volatility": 0.012
},
{
"calculation": "historical",
"confidence": 0.9,
"horizon": 1,
"interpolation": "linear",
"position_value": 1,
"returns": [
-0.031,
0.012,
-0.008,
0.004,
-0.019,
0.022,
0.001,
-0.012,
0.009,
-0.002
]
},
{
"calculation": "monte_carlo",
"confidence": 0.99,
"degrees_of_freedom": 4,
"distribution": "student_t",
"horizon": 1,
"mean": 0,
"position_value": 1,
"seed": 7,
"simulations": 20000,
"volatility": 0.012
},
{
"calculation": "ewma",
"confidence": 0.95,
"decay": 0.94,
"horizon": 1,
"position_value": 1,
"returns": [
0.004,
-0.011,
0.007,
-0.002,
0.013,
-0.009
]
}
],
"oneOf": [
{
"$ref": "#/$defs/ParametricInputs"
},
{
"$ref": "#/$defs/CornishFisherInputs"
},
{
"$ref": "#/$defs/HistoricalInputs"
},
{
"$ref": "#/$defs/MonteCarloInputs"
},
{
"$ref": "#/$defs/EwmaInputs"
}
],
"title": "Value-at-risk and expected shortfall: inputs",
"type": "object"
},
"name": "risk_value_at_risk",
"outputSchema": {
"$defs": {
"input": {
"description": "VaR and expected shortfall as positive losses by the parametric normal, Cornish-Fisher, historical, Monte Carlo and RiskMetrics EWMA methods.",
"discriminator": {
"mapping": {
"cornish_fisher": "#/$defs/input.CornishFisherInputs",
"ewma": "#/$defs/input.EwmaInputs",
"historical": "#/$defs/input.HistoricalInputs",
"monte_carlo": "#/$defs/input.MonteCarloInputs",
"parametric": "#/$defs/input.ParametricInputs"
},
"propertyName": "calculation"
},
"examples": [
{
"calculation": "parametric",
"confidence": 0.99,
"horizon": 10,
"mean": 0,
"position_value": 1000000,
"volatility": 0.012
},
{
"calculation": "cornish_fisher",
"confidence": 0.99,
"excess_kurtosis": 2,
"horizon": 1,
"mean": 0.0005,
"position_value": 1,
"skewness": -0.5,
"volatility": 0.012
},
{
"calculation": "historical",
"confidence": 0.9,
"horizon": 1,
"interpolation": "linear",
"position_value": 1,
"returns": [
-0.031,
0.012,
-0.008,
0.004,
-0.019,
0.022,
0.001,
-0.012,
0.009,
-0.002
]
},
{
"calculation": "monte_carlo",
"confidence": 0.99,
"degrees_of_freedom": 4,
"distribution": "student_t",
"horizon": 1,
"mean": 0,
"position_value": 1,
"seed": 7,
"simulations": 20000,
"volatility": 0.012
},
{
"calculation": "ewma",
"confidence": 0.95,
"decay": 0.94,
"horizon": 1,
"position_value": 1,
"returns": [
0.004,
-0.011,
0.007,
-0.002,
0.013,
-0.009
]
}
],
"oneOf": [
{
"$ref": "#/$defs/input.ParametricInputs"
},
{
"$ref": "#/$defs/input.CornishFisherInputs"
},
{
"$ref": "#/$defs/input.HistoricalInputs"
},
{
"$ref": "#/$defs/input.MonteCarloInputs"
},
{
"$ref": "#/$defs/input.EwmaInputs"
}
],
"title": "Value-at-risk and expected shortfall: inputs"
},
"input.CornishFisherInputs": {
"additionalProperties": false,
"description": "The first four moments of returns per period.",
"properties": {
"calculation": {
"const": "cornish_fisher",
"default": "cornish_fisher",
"description": "Modified VaR and ES from skewness and kurtosis",
"title": "Calculation",
"type": "string"
},
"confidence": {
"default": 0.99,
"description": "One-tailed confidence level, such as 0.99",
"maximum": 0.9999,
"minimum": 0.5,
"title": "Confidence",
"type": "number",
"x-unit": "probability"
},
"excess_kurtosis": {
"default": 0,
"description": "Excess kurtosis of returns per period",
"maximum": 20,
"minimum": -2,
"title": "Excess Kurtosis",
"type": "number",
"x-unit": "ratio"
},
"horizon": {
"default": 1,
"description": "Horizon in periods of the returns, such as 10 days",
"maximum": 1000,
"minimum": 1,
"title": "Horizon",
"type": "number",
"x-unit": "periods"
},
"mean": {
"default": 0,
"description": "Mean return per period",
"maximum": 1,
"minimum": -1,
"title": "Mean",
"type": "number",
"x-unit": "return"
},
"position_value": {
"default": 1,
"description": "Position value; the default of 1 makes the amounts the decimals",
"exclusiveMinimum": 0,
"maximum": 10000000000,
"title": "Position Value",
"type": "number",
"x-unit": "money"
},
"skewness": {
"default": 0,
"description": "Skewness of returns per period",
"maximum": 3,
"minimum": -3,
"title": "Skewness",
"type": "number",
"x-unit": "ratio"
},
"volatility": {
"description": "Standard deviation of returns per period",
"exclusiveMinimum": 0,
"maximum": 2,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
}
},
"required": [
"volatility"
],
"title": "CornishFisherInputs",
"type": "object"
},
"input.EwmaInputs": {
"additionalProperties": false,
"description": "A return series and the RiskMetrics decay factor.",
"properties": {
"calculation": {
"const": "ewma",
"default": "ewma",
"description": "RiskMetrics EWMA volatility with normal VaR and ES",
"title": "Calculation",
"type": "string"
},
"confidence": {
"default": 0.99,
"description": "One-tailed confidence level, such as 0.99",
"maximum": 0.9999,
"minimum": 0.5,
"title": "Confidence",
"type": "number",
"x-unit": "probability"
},
"decay": {
"default": 0.94,
"description": "Decay factor lambda (RiskMetrics uses 0.94 for daily data)",
"maximum": 0.999,
"minimum": 0.5,
"title": "Decay",
"type": "number",
"x-unit": "ratio"
},
"horizon": {
"default": 1,
"description": "Horizon in periods of the returns, such as 10 days",
"maximum": 1000,
"minimum": 1,
"title": "Horizon",
"type": "number",
"x-unit": "periods"
},
"position_value": {
"default": 1,
"description": "Position value; the default of 1 makes the amounts the decimals",
"exclusiveMinimum": 0,
"maximum": 10000000000,
"title": "Position Value",
"type": "number",
"x-unit": "money"
},
"returns": {
"description": "Returns per period, oldest first",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 1,
"title": "Returns",
"type": "array"
}
},
"required": [
"returns"
],
"title": "EwmaInputs",
"type": "object"
},
"input.HistoricalInputs": {
"additionalProperties": false,
"description": "A return series and the rule that picks its quantile.",
"properties": {
"calculation": {
"const": "historical",
"default": "historical",
"description": "Historical-simulation VaR and ES",
"title": "Calculation",
"type": "string"
},
"confidence": {
"default": 0.99,
"description": "One-tailed confidence level, such as 0.99",
"maximum": 0.9999,
"minimum": 0.5,
"title": "Confidence",
"type": "number",
"x-unit": "probability"
},
"horizon": {
"default": 1,
"description": "Horizon in periods of the returns, such as 10 days",
"maximum": 1000,
"minimum": 1,
"title": "Horizon",
"type": "number",
"x-unit": "periods"
},
"interpolation": {
"default": "linear",
"description": "How the quantile falls between two returns (NumPy's methods; linear is Hyndman and Fan's definition 7)",
"enum": [
"linear",
"lower",
"higher",
"midpoint",
"nearest"
],
"title": "Interpolation",
"type": "string"
},
"position_value": {
"default": 1,
"description": "Position value; the default of 1 makes the amounts the decimals",
"exclusiveMinimum": 0,
"maximum": 10000000000,
"title": "Position Value",
"type": "number",
"x-unit": "money"
},
"returns": {
"description": "Returns per period, in time order",
"items": {
"maximum": 100,
"minimum": -1,
"type": "number",
"x-unit": "return"
},
"maxItems": 10080,
"minItems": 2,
"title": "Returns",
"type": "array"
}
},
"required": [
"returns"
],
"title": "HistoricalInputs",
"type": "object"
},
"input.MonteCarloInputs": {
"additionalProperties": false,
"description": "A return distribution and the size of the simulation.",
"properties": {
"calculation": {
"const": "monte_carlo",
"default": "monte_carlo",
"description": "Monte Carlo VaR and ES with standard errors",
"title": "Calculation",
"type": "string"
},
"confidence": {
"default": 0.99,
"description": "One-tailed confidence level, such as 0.99",
"maximum": 0.9999,
"minimum": 0.5,
"title": "Confidence",
"type": "number",
"x-unit": "probability"
},
"degrees_of_freedom": {
"default": 5,
"description": "Student-t degrees of freedom; ignored for the normal",
"exclusiveMinimum": 2,
"maximum": 1000,
"title": "Degrees Of Freedom",
"type": "number",
"x-unit": "ratio"
},
"distribution": {
"default": "normal",
"description": "Distribution of the standardized horizon return",
"enum": [
"normal",
"student_t"
],
"title": "Distribution",
"type": "string"
},
"horizon": {
"default": 1,
"description": "Horizon in periods of the returns, such as 10 days",
"maximum": 1000,
"minimum": 1,
"title": "Horizon",
"type": "number",
"x-unit": "periods"
},
"mean": {
"default": 0,
"description": "Mean return per period",
"maximum": 1,
"minimum": -1,
"title": "Mean",
"type": "number",
"x-unit": "return"
},
"position_value": {
"default": 1,
"description": "Position value; the default of 1 makes the amounts the decimals",
"exclusiveMinimum": 0,
"maximum": 10000000000,
"title": "Position Value",
"type": "number",
"x-unit": "money"
},
"seed": {
"default": 0,
"description": "Random seed (ADR-0008 decision 7): the same seed, the same draws",
"maximum": 9007199254740991,
"minimum": 0,
"title": "Seed",
"type": "integer",
"x-unit": "count"
},
"simulations": {
"default": 100000,
"description": "Number of simulated horizon returns",
"maximum": 1000000,
"minimum": 10000,
"title": "Simulations",
"type": "integer",
"x-unit": "count"
},
"volatility": {
"description": "Standard deviation of returns per period",
"exclusiveMinimum": 0,
"maximum": 2,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
}
},
"required": [
"volatility"
],
"title": "MonteCarloInputs",
"type": "object"
},
"input.ParametricInputs": {
"additionalProperties": false,
"description": "Normal returns with a mean and a volatility per period.",
"properties": {
"calculation": {
"const": "parametric",
"default": "parametric",
"description": "Normal VaR and ES",
"title": "Calculation",
"type": "string"
},
"confidence": {
"default": 0.99,
"description": "One-tailed confidence level, such as 0.99",
"maximum": 0.9999,
"minimum": 0.5,
"title": "Confidence",
"type": "number",
"x-unit": "probability"
},
"horizon": {
"default": 1,
"description": "Horizon in periods of the returns, such as 10 days",
"maximum": 1000,
"minimum": 1,
"title": "Horizon",
"type": "number",
"x-unit": "periods"
},
"mean": {
"default": 0,
"description": "Mean return per period",
"maximum": 1,
"minimum": -1,
"title": "Mean",
"type": "number",
"x-unit": "return"
},
"position_value": {
"default": 1,
"description": "Position value; the default of 1 makes the amounts the decimals",
"exclusiveMinimum": 0,
"maximum": 10000000000,
"title": "Position Value",
"type": "number",
"x-unit": "money"
},
"volatility": {
"description": "Standard deviation of returns per period",
"exclusiveMinimum": 0,
"maximum": 2,
"title": "Volatility",
"type": "number",
"x-unit": "volatility"
}
},
"required": [
"volatility"
],
"title": "ParametricInputs",
"type": "object"
},
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"const": "risk.value_at_risk"
},
"model_version": {
"const": 1
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"output": {
"description": "VaR and expected shortfall as positive losses by the parametric normal, Cornish-Fisher, historical, Monte Carlo and RiskMetrics EWMA methods.",
"discriminator": {
"mapping": {
"cornish_fisher": "#/$defs/output.CornishFisherOutputs",
"ewma": "#/$defs/output.EwmaOutputs",
"historical": "#/$defs/output.HistoricalOutputs",
"monte_carlo": "#/$defs/output.MonteCarloOutputs",
"parametric": "#/$defs/output.ParametricOutputs"
},
"propertyName": "calculation"
},
"oneOf": [
{
"$ref": "#/$defs/output.ParametricOutputs"
},
{
"$ref": "#/$defs/output.CornishFisherOutputs"
},
{
"$ref": "#/$defs/output.HistoricalOutputs"
},
{
"$ref": "#/$defs/output.MonteCarloOutputs"
},
{
"$ref": "#/$defs/output.EwmaOutputs"
}
],
"title": "Value-at-risk and expected shortfall: outputs"
},
"output.CornishFisherOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "cornish_fisher",
"default": "cornish_fisher",
"description": "Modified VaR and ES from skewness and kurtosis",
"title": "Calculation",
"type": "string"
},
"expected_shortfall": {
"description": "Expected shortfall as a decimal of the position (a loss > 0)",
"maximum": 100000,
"minimum": -100000,
"title": "Expected Shortfall",
"type": "number",
"x-unit": "return"
},
"expected_shortfall_amount": {
"description": "Expected shortfall in money: the decimal times the position",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Expected Shortfall Amount",
"type": "number",
"x-unit": "money"
},
"quantile": {
"description": "Cornish-Fisher quantile of the standardized loss at the confidence level (the normal quantile without skewness or excess kurtosis)",
"maximum": 1000,
"minimum": -1000,
"title": "Quantile",
"type": "number",
"x-unit": "ratio"
},
"value_at_risk": {
"description": "VaR as a decimal of the position (a loss > 0)",
"maximum": 100000,
"minimum": -100000,
"title": "Value At Risk",
"type": "number",
"x-unit": "return"
},
"value_at_risk_amount": {
"description": "VaR in money: the decimal times the position",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Value At Risk Amount",
"type": "number",
"x-unit": "money"
}
},
"required": [
"value_at_risk",
"expected_shortfall",
"value_at_risk_amount",
"expected_shortfall_amount",
"quantile"
],
"title": "CornishFisherOutputs",
"type": "object"
},
"output.EwmaOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "ewma",
"default": "ewma",
"description": "RiskMetrics EWMA volatility with normal VaR and ES",
"title": "Calculation",
"type": "string"
},
"expected_shortfall": {
"description": "Expected shortfall as a decimal of the position (a loss > 0)",
"maximum": 100000,
"minimum": -100000,
"title": "Expected Shortfall",
"type": "number",
"x-unit": "return"
},
"expected_shortfall_amount": {
"description": "Expected shortfall in money: the decimal times the position",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Expected Shortfall Amount",
"type": "number",
"x-unit": "money"
},
"value_at_risk": {
"description": "VaR as a decimal of the position (a loss > 0)",
"maximum": 100000,
"minimum": -100000,
"title": "Value At Risk",
"type": "number",
"x-unit": "return"
},
"value_at_risk_amount": {
"description": "VaR in money: the decimal times the position",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Value At Risk Amount",
"type": "number",
"x-unit": "money"
},
"volatility_forecast": {
"description": "Volatility forecast for the next period",
"maximum": 100,
"minimum": 0,
"title": "Volatility Forecast",
"type": "number",
"x-unit": "volatility"
}
},
"required": [
"value_at_risk",
"expected_shortfall",
"value_at_risk_amount",
"expected_shortfall_amount",
"volatility_forecast"
],
"title": "EwmaOutputs",
"type": "object"
},
"output.HistoricalOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "historical",
"default": "historical",
"description": "Historical-simulation VaR and ES",
"title": "Calculation",
"type": "string"
},
"expected_shortfall": {
"description": "Expected shortfall as a decimal of the position (a loss > 0)",
"maximum": 100000,
"minimum": -100000,
"title": "Expected Shortfall",
"type": "number",
"x-unit": "return"
},
"expected_shortfall_amount": {
"description": "Expected shortfall in money: the decimal times the position",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Expected Shortfall Amount",
"type": "number",
"x-unit": "money"
},
"observations": {
"description": "Returns used",
"maximum": 10080,
"minimum": 2,
"title": "Observations",
"type": "integer",
"x-unit": "count"
},
"tail_observations": {
"description": "Returns at or below the VaR quantile",
"maximum": 10080,
"minimum": 1,
"title": "Tail Observations",
"type": "integer",
"x-unit": "count"
},
"value_at_risk": {
"description": "VaR as a decimal of the position (a loss > 0)",
"maximum": 100000,
"minimum": -100000,
"title": "Value At Risk",
"type": "number",
"x-unit": "return"
},
"value_at_risk_amount": {
"description": "VaR in money: the decimal times the position",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Value At Risk Amount",
"type": "number",
"x-unit": "money"
}
},
"required": [
"value_at_risk",
"expected_shortfall",
"value_at_risk_amount",
"expected_shortfall_amount",
"observations",
"tail_observations"
],
"title": "HistoricalOutputs",
"type": "object"
},
"output.MonteCarloOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "monte_carlo",
"default": "monte_carlo",
"description": "Monte Carlo VaR and ES with standard errors",
"title": "Calculation",
"type": "string"
},
"expected_shortfall": {
"description": "Expected shortfall as a decimal of the position (a loss > 0)",
"maximum": 100000,
"minimum": -100000,
"title": "Expected Shortfall",
"type": "number",
"x-unit": "return"
},
"expected_shortfall_amount": {
"description": "Expected shortfall in money: the decimal times the position",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Expected Shortfall Amount",
"type": "number",
"x-unit": "money"
},
"expected_shortfall_standard_error": {
"description": "Standard error of the simulated ES",
"maximum": 100000,
"minimum": 0,
"title": "Expected Shortfall Standard Error",
"type": "number",
"x-unit": "return"
},
"simulations": {
"description": "Simulated returns",
"maximum": 1000000,
"minimum": 10000,
"title": "Simulations",
"type": "integer",
"x-unit": "count"
},
"value_at_risk": {
"description": "VaR as a decimal of the position (a loss > 0)",
"maximum": 100000,
"minimum": -100000,
"title": "Value At Risk",
"type": "number",
"x-unit": "return"
},
"value_at_risk_amount": {
"description": "VaR in money: the decimal times the position",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Value At Risk Amount",
"type": "number",
"x-unit": "money"
},
"value_at_risk_standard_error": {
"description": "Standard error of the simulated VaR",
"maximum": 100000,
"minimum": 0,
"title": "Value At Risk Standard Error",
"type": "number",
"x-unit": "return"
}
},
"required": [
"value_at_risk",
"expected_shortfall",
"value_at_risk_amount",
"expected_shortfall_amount",
"value_at_risk_standard_error",
"expected_shortfall_standard_error",
"simulations"
],
"title": "MonteCarloOutputs",
"type": "object"
},
"output.ParametricOutputs": {
"additionalProperties": false,
"properties": {
"calculation": {
"const": "parametric",
"default": "parametric",
"description": "Normal VaR and ES",
"title": "Calculation",
"type": "string"
},
"expected_shortfall": {
"description": "Expected shortfall as a decimal of the position (a loss > 0)",
"maximum": 100000,
"minimum": -100000,
"title": "Expected Shortfall",
"type": "number",
"x-unit": "return"
},
"expected_shortfall_amount": {
"description": "Expected shortfall in money: the decimal times the position",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Expected Shortfall Amount",
"type": "number",
"x-unit": "money"
},
"quantile": {
"description": "Standard normal quantile of the loss at confidence c",
"maximum": 4,
"minimum": 0,
"title": "Quantile",
"type": "number",
"x-unit": "ratio"
},
"value_at_risk": {
"description": "VaR as a decimal of the position (a loss > 0)",
"maximum": 100000,
"minimum": -100000,
"title": "Value At Risk",
"type": "number",
"x-unit": "return"
},
"value_at_risk_amount": {
"description": "VaR in money: the decimal times the position",
"maximum": 1000000000000000,
"minimum": -1000000000000000,
"title": "Value At Risk Amount",
"type": "number",
"x-unit": "money"
}
},
"required": [
"value_at_risk",
"expected_shortfall",
"value_at_risk_amount",
"expected_shortfall_amount",
"quantile"
],
"title": "ParametricOutputs",
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"$ref": "#/$defs/input"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"const": "risk.value_at_risk"
},
"model_version": {
"const": 1
},
"outputs": {
"$ref": "#/$defs/output"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "Value-at-risk and expected shortfall: result",
"type": "object"
}
},
{
"description": "Runs any registered model on its inputs, or binds its inputs to the data catalog first (as of a date, or the latest), and returns the canonical result: the validated inputs, the outputs, the warnings and the manifest of every source read. Data whose terms do not let it reach an AI assistant is never used.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "A run of any model. Any of as_of, vintage, profile, concepts or parameters binds the model's data first; without them the model runs on its inputs alone.",
"properties": {
"as_of": {
"description": "Bind the model's data as published on this date (YYYY-MM-DD).",
"format": "date",
"type": "string"
},
"concepts": {
"additionalProperties": {
"type": "string"
},
"description": "Field names mapped to catalog concept ids that replace their bindings' concepts.",
"type": "object"
},
"inputs": {
"description": "The model's inputs, as its input schema (describe_model) gives them. With a bind, each one given replaces the value the data would supply.",
"type": "object"
},
"model_id": {
"description": "A model id, or an alias of one.",
"maxLength": 128,
"minLength": 1,
"type": "string"
},
"parameters": {
"description": "Values of the bound concepts' parameters.",
"type": "object"
},
"profile": {
"description": "The named set of bindings to read; 'default' binds the latest data.",
"maxLength": 64,
"minLength": 1,
"type": "string"
},
"vintage": {
"description": "The vintage policy of every binding, in place of their own.",
"enum": [
"real_time",
"latest"
]
}
},
"required": [
"model_id"
],
"title": "run_model: inputs",
"type": "object"
},
"name": "run_model",
"outputSchema": {
"$defs": {
"manifest": {
"additionalProperties": false,
"properties": {
"bit_generator": {
"type": [
"string",
"null"
]
},
"data_sources": {
"items": {
"type": "object"
},
"type": "array"
},
"dependencies": {
"additionalProperties": {
"type": "string"
},
"type": "object"
},
"inputs_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"model_id": {
"pattern": "^[a-z][a-z0-9_]*(\\.[a-z][a-z0-9_]*){1,2}$",
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"package_version": {
"type": "string"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"schema_version": {
"const": 2
},
"seed": {
"minimum": 0,
"type": [
"integer",
"null"
]
}
},
"required": [
"schema_version",
"model_id",
"model_version",
"package_version",
"dependencies",
"seed",
"bit_generator",
"data_sources",
"inputs_sha256",
"result_sha256"
],
"type": "object"
},
"notice": {
"additionalProperties": false,
"properties": {
"download": {
"anyOf": [
{
"additionalProperties": false,
"properties": {
"method": {
"const": "GET"
},
"path": {
"description": "The run's GET form on this server's REST API, which answers the same result; ?format= gives other formats.",
"type": "string"
}
},
"required": [
"method",
"path"
],
"type": "object"
},
{
"type": "null"
}
]
},
"model_id": {
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"result_bytes": {
"minimum": 0,
"type": "integer"
},
"result_sha256": {
"pattern": "^[0-9a-f]{64}$",
"type": "string"
},
"summary": {
"type": "string"
}
},
"required": [
"download",
"model_id",
"model_version",
"result_bytes",
"result_sha256",
"summary"
],
"type": "object"
},
"result": {
"additionalProperties": false,
"properties": {
"inputs": {
"type": "object"
},
"manifest": {
"$ref": "#/$defs/manifest"
},
"model_id": {
"type": "string"
},
"model_version": {
"minimum": 1,
"type": "integer"
},
"outputs": {
"type": "object"
},
"warnings": {
"items": {
"$ref": "#/$defs/warning"
},
"type": "array"
}
},
"required": [
"inputs",
"manifest",
"model_id",
"model_version",
"outputs",
"warnings"
],
"type": "object"
},
"warning": {
"additionalProperties": false,
"properties": {
"code": {
"type": "string"
},
"message": {
"type": "string"
}
},
"required": [
"code",
"message"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"anyOf": [
{
"$ref": "#/$defs/result"
},
{
"$ref": "#/$defs/notice"
}
],
"description": "The run's result as canonical JSON (RFC 8785): the validated inputs and outputs, the warnings and the manifest. A result larger than the server's limit is replaced by a notice: its summary, size and hash, and the REST download that answers it.",
"title": "run_model: result",
"type": "object"
}
},
{
"description": "Searches the registered economics and finance models by words in their ids, titles, tags, domains and summaries, best match first, or lists every model of a domain. Each entry gives the model's id, title, summary, domain, cost class and whether it can bind its inputs to data.",
"inputSchema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "A search of the models.",
"properties": {
"domain": {
"description": "Only the models of this domain.",
"enum": [
"accounting",
"asset_pricing",
"corporate",
"derivatives",
"econometrics",
"equity",
"fixed_income",
"foundations",
"international",
"macro",
"performance",
"portfolio",
"risk"
]
},
"limit": {
"default": 20,
"description": "The most entries a search returns, best first.",
"maximum": 100,
"minimum": 1,
"type": "integer"
},
"query": {
"description": "Words to look for in each model's id, title, tags, domain and summary. Without it, every model of the domain (or every model) is listed, sorted by id.",
"maxLength": 256,
"minLength": 1,
"type": "string"
}
},
"required": [],
"title": "search_models: inputs",
"type": "object"
},
"name": "search_models",
"outputSchema": {
"$defs": {
"ModelEntry": {
"additionalProperties": false,
"properties": {
"bound": {
"type": "boolean"
},
"cost": {
"enum": [
"instant",
"light",
"heavy",
null
]
},
"domain": {
"type": "string"
},
"extra": {
"type": [
"string",
"null"
]
},
"id": {
"type": "string"
},
"summary": {
"type": "string"
},
"tags": {
"items": {
"type": "string"
},
"type": "array"
},
"title": {
"type": "string"
},
"version": {
"minimum": 1,
"type": "integer"
}
},
"required": [
"bound",
"cost",
"domain",
"extra",
"id",
"summary",
"tags",
"title",
"version"
],
"type": "object"
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"additionalProperties": false,
"description": "The models found, best first, or every model listed, sorted by id.",
"properties": {
"models": {
"items": {
"$ref": "#/$defs/ModelEntry"
},
"type": "array"
}
},
"required": [
"models"
],
"title": "search_models: result",
"type": "object"
}
}
]
}Verify it yourself
curl -s https://api.teppi.xyz/v1/evidence/sha256:3992288c1a5bac4f20e9f1e90dfaa7e8e62f18ccace90ebd6672346f0fab53e0 | sha256sum