removedOutput schema / $defs / AggregationRequest
Removed value: -{
- "additionalProperties": false,
- "description": "A post-simulation, series-aware metric over one node's full series.\n\nNPV/IRR/payback/CAGR/cumsum are NOT per-period node values: they consume a\ntarget node's complete ``(time_periods x trials)`` matrix AFTER the run and\nreturn one value per trial, summarised into a distribution.\n\nDiscount convention (0-based series index): period ``t=0`` is the present\n(undiscounted) cash flow; period ``t`` is discounted by ``(1+rate)**t``. The\nfirst period is undiscounted.\n\nWarning — two discount conventions coexist; do not mix them. These\naggregations use the **0-based** series index above (first period\nundiscounted). The per-period formula functions ``DISCOUNT(rate,\n{time_period})`` and ``PV(rate, value, {time_period})`` use the **1-based**\n``{time_period}``, so they discount the first period by ``(1+rate)**1``.\n\n\"Investment at period 0\" pattern: model an up-front outlay as a negative\nperiod-0 cash flow in the target node's series; NPV's t=0-undiscounted\nconvention then treats it as the present-value outlay. Do not additionally\ndiscount that first period with ``PV(...,{time_period})`` inside the target\nnode's formula when also requesting an aggregation ``npv`` — combining the\n1-based per-period discount with the 0-based ``npv`` double-shifts the first\nperiod.\n\nPer-period node vs aggregate metric (``prob``): pointing ``prob`` at a\nmulti-period cash-flow NODE via ``target_node_id`` thresholds only that node's\nFINAL-period per-trial value — i.e. ``P(per-period value > x)``, NOT\n``P(NPV > x)``. To get a true ``P(NPV > 0)``, define an ``npv`` aggregation\nfirst, then add a ``prob`` aggregation whose ``target_aggregation_id`` points\nat that ``npv`` id; ``prob`` then thresholds the NPV per-trial vector directly.\nA ``prob`` request targets EITHER a node (``target_node_id``) OR an earlier\naggregation (``target_aggregation_id``) — exactly one, never both.",
- "properties": {
- "function": {
- "description": "One of: npv, irr, payback, discounted_payback, cagr, cumsum, prob, terminal_value, mirr. discounted_payback requires params.rate; npv requires params.rate OR a per-period params.rates curve; prob requires params.op (one of >, >=, <, <=, ==) and params.value; terminal_value requires params.g and params.rate; mirr requires params.finance_rate and params.reinvest_rate.",
- "title": "Function",
- "type": "string"
- },
- "id": {
- "description": "Result key for this metric (unique within the request).",
- "title": "Id",
- "type": "string"
- },
- "params": {
- "additionalProperties": true,
- "description": "Function params, e.g. {'rate': 0.1} for npv/discounted_payback, {'op': '>', 'value': 0} for prob, {'g': 0.02, 'rate': 0.1} for terminal_value, {'finance_rate': 0.1, 'reinvest_rate': 0.08} for mirr.",
- "title": "Params",
- "type": "object"
- },
- "target_aggregation_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "For a ``prob`` request only: the id of an aggregation defined EARLIER in this output_request whose per-trial vector (e.g. an ``npv``) is thresholded. Lets ``P(NPV > 0)`` be expressed directly instead of the per-period ``P(value > x)`` you get by targeting a multi-period node. The referenced aggregation must produce a per-trial vector (npv/irr/payback/discounted_payback/cagr/cumsum/terminal_value/mirr).",
- "title": "Target Aggregation Id"
- },
- "target_node_id": {
- "anyOf": [
- {
- "type": "string"
- },
- {
- "type": "null"
- }
- ],
- "default": null,
- "description": "The node whose full per-period series the metric consumes. Required for every metric except a ``prob`` that targets a prior aggregation via ``target_aggregation_id``. Exactly one of ``target_node_id`` / ``target_aggregation_id`` may be set on a ``prob`` request.",
- "title": "Target Node Id"
- }
- },
- "required": [
- "id",
- "function"
- ],
- "title": "AggregationRequest",
- "type": "object"
-}
removedOutput schema / $defs / RootNode
Removed value: -{
- "additionalProperties": false,
- "description": "A source node that samples from a probability distribution each period.\n\n``json_schema_extra`` (neumann#288) attaches a ``oneOf`` discriminated on\n``distribution_type``, so the published schema states each type's own\nrequired ``distribution_params`` keys instead of advertising an opaque\nobject. The RUNTIME annotation stays ``dict[str, object]`` — see\n``contracts.catalog.add_distribution_variants`` for why a real pydantic\ndiscriminated union is not used here.",
- "oneOf": [
- {
- "description": "A constant value that never changes",
- "properties": {
- "distribution_params": {
- "properties": {
- "value": {
- "description": "The constant value to return",
- "type": "number"
- }
- },
- "required": [
- "value"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "constant"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "constant"
- },
- {
- "description": "Normal (Gaussian) distribution",
- "properties": {
- "distribution_params": {
- "properties": {
- "mean": {
- "description": "The mean (average) of the distribution",
- "type": "number"
- },
- "std": {
- "description": "The standard deviation (spread) of the distribution (positive)",
- "type": "number"
- }
- },
- "required": [
- "mean",
- "std"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "normal"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "normal"
- },
- {
- "description": "Uniform distribution between low and high values",
- "properties": {
- "distribution_params": {
- "properties": {
- "high": {
- "description": "Upper bound of the distribution",
- "type": "number"
- },
- "low": {
- "description": "Lower bound of the distribution",
- "type": "number"
- }
- },
- "required": [
- "low",
- "high"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "uniform"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "uniform"
- },
- {
- "description": "Beta distribution for modeling probabilities and proportions",
- "properties": {
- "distribution_params": {
- "properties": {
- "alpha": {
- "description": "The alpha shape parameter (α) (positive)",
- "type": "number"
- },
- "beta": {
- "description": "The beta shape parameter (β) (positive)",
- "type": "number"
- }
- },
- "required": [
- "alpha",
- "beta"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "beta"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "beta"
- },
- {
- "description": "Gamma distribution for modeling waiting times",
- "properties": {
- "distribution_params": {
- "properties": {
- "scale": {
- "description": "The scale parameter (θ) (positive)",
- "type": "number"
- },
- "shape": {
- "description": "The shape parameter (k) (positive)",
- "type": "number"
- }
- },
- "required": [
- "shape",
- "scale"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "gamma"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "gamma"
- },
- {
- "description": "Exponential distribution with scale parameter",
- "properties": {
- "distribution_params": {
- "properties": {
- "scale": {
- "description": "Scale parameter (mean) of the distribution (positive)",
- "type": "number"
- }
- },
- "required": [
- "scale"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "exponential"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "exponential"
- },
- {
- "description": "Poisson distribution for modeling count data",
- "properties": {
- "distribution_params": {
- "properties": {
- "lambda_val": {
- "description": "The rate parameter (λ) (positive)",
- "type": "number"
- }
- },
- "required": [
- "lambda_val"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "poisson"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "poisson"
- },
- {
- "description": "Bernoulli distribution for binary outcomes",
- "properties": {
- "distribution_params": {
- "properties": {
- "p": {
- "description": "The probability of success (between 0 and 1)",
- "type": "number"
- }
- },
- "required": [
- "p"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "bernoulli"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "bernoulli"
- },
- {
- "description": "Triangle distribution with minimum, maximum, and mode parameters",
- "properties": {
- "distribution_params": {
- "properties": {
- "max_val": {
- "description": "The maximum value of the distribution",
- "type": "number"
- },
- "min_val": {
- "description": "The minimum value of the distribution",
- "type": "number"
- },
- "mode_val": {
- "description": "The mode (peak) of the distribution",
- "type": "number"
- }
- },
- "required": [
- "min_val",
- "max_val",
- "mode_val"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "triangle"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "triangle"
- },
- {
- "description": "Log-normal distribution for modeling skewed, positive-valued data",
- "properties": {
- "distribution_params": {
- "properties": {
- "mu": {
- "description": "Mean of the underlying normal distribution (log-scale)",
- "type": "number"
- },
- "sigma": {
- "description": "Standard deviation of the underlying normal distribution (log-scale) (positive)",
- "type": "number"
- }
- },
- "required": [
- "mu",
- "sigma"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "log_normal"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "log_normal"
- },
- {
- "description": "Discrete log-normal: sample log-normal then round to nearest integer (zero allowed)",
- "properties": {
- "distribution_params": {
- "properties": {
- "mu": {
- "description": "Mean of the underlying normal distribution (log-scale)",
- "type": "number"
- },
- "sigma": {
- "description": "Standard deviation of the underlying normal distribution (log-scale) (positive)",
- "type": "number"
- }
- },
- "required": [
- "mu",
- "sigma"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "discrete_lognormal"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "discrete_lognormal"
- },
- {
- "description": "Categorical distribution for discrete outcomes with custom probabilities",
- "properties": {
- "distribution_params": {
- "properties": {
- "probabilities": {
- "description": "List of probabilities for each value (must sum to 1) (sum to 1)",
- "items": {
- "type": "number"
- },
- "type": "array"
- },
- "values": {
- "description": "List of possible values to sample from",
- "items": {
- "type": "number"
- },
- "type": "array"
- }
- },
- "required": [
- "values",
- "probabilities"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "categorical"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "categorical"
- },
- {
- "description": "Discrete gamma: sample gamma then round to nearest integer (zero allowed)",
- "properties": {
- "distribution_params": {
- "properties": {
- "scale": {
- "description": "The scale parameter (θ) (positive)",
- "type": "number"
- },
- "shape": {
- "description": "The shape parameter (k) (positive)",
- "type": "number"
- }
- },
- "required": [
- "shape",
- "scale"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "discrete_gamma"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "discrete_gamma"
- },
- {
- "description": "Binomial distribution for modeling the number of successes in n independent trials",
- "properties": {
- "distribution_params": {
- "properties": {
- "n": {
- "description": "Number of trials (positive integer)",
- "type": "integer"
- },
- "p": {
- "description": "Probability of success in each trial (between 0 and 1)",
- "type": "number"
- }
- },
- "required": [
- "n",
- "p"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "binomial"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "binomial"
- },
- {
- "description": "Dirichlet distribution for modeling correlated probabilities that sum to 1",
- "properties": {
- "distribution_params": {
- "properties": {
- "alpha": {
- "description": "Concentration parameters for each category (all positive)",
- "items": {
- "type": "number"
- },
- "type": "array"
- }
- },
- "required": [
- "alpha"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "dirichlet"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "dirichlet"
- },
- {
- "description": "Constant array distribution for deterministic array values (used internally for scenarios)",
- "properties": {
- "distribution_params": {
- "properties": {
- "values": {
- "description": "Array of constant values to return",
- "items": {
- "type": "number"
- },
- "type": "array"
- }
- },
- "required": [
- "values"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "constant_array"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "constant_array"
- },
- {
- "description": "Discrete normal distribution for integer-valued data with normal characteristics",
- "properties": {
- "distribution_params": {
- "properties": {
- "mean": {
- "description": "The mean (average) of the distribution",
- "type": "number"
- },
- "std": {
- "description": "The standard deviation (spread) of the distribution (positive)",
- "type": "number"
- }
- },
- "required": [
- "mean",
- "std"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "discrete_normal"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "discrete_normal"
- },
- {
- "description": "Multivariate normal (correlated inputs): draws a vector of correlated values per trial from a mean vector + correlation matrix + per-component standard deviations. Array-valued — feed multiple downstream calc nodes by INDEXing component k (1-based): INDEX({edge}, k).",
- "properties": {
- "distribution_params": {
- "properties": {
- "correlation": {
- "description": "Square correlation matrix (NxN for N components); diagonal 1.0, symmetric, entries in [-1, 1]",
- "items": {
- "items": {
- "type": "number"
- },
- "type": "array"
- },
- "type": "array"
- },
- "mean": {
- "description": "Mean vector (one entry per correlated component)",
- "items": {
- "type": "number"
- },
- "type": "array"
- },
- "stds": {
- "description": "Per-component standard deviations (same length as mean) (all positive)",
- "items": {
- "type": "number"
- },
- "type": "array"
- }
- },
- "required": [
- "mean",
- "stds",
- "correlation"
- ],
- "type": "object"
- },
- "distribution_type": {
- "const": "multivariate_normal"
- }
- },
- "required": [
- "distribution_type",
- "distribution_params"
- ],
- "title": "multivariate_normal"
- }
- ],
- "properties": {
- "delay": {
- "default": 0,
- "description": "Periods to wait before the first sample.",
- "minimum": 0,
- "title": "Delay",
- "type": "integer"
- },
- "distribution_params": {
- "additionalProperties": true,
- "description": "Params for the chosen distribution. Which keys are required depends on distribution_type -- see this schema's oneOf, or the `neumann://catalog` resource. Common types: normal{mean,std} log_normal{mu,sigma} uniform{low,high} triangle{min_val,max_val,mode_val} beta{alpha,beta} poisson{lambda_val} bernoulli{p}.",
- "title": "Distribution Params",
- "type": "object"
- },
- "distribution_type": {
- "description": "One of the catalog distributions. Read the catalog from the `neumann://catalog` resource (or the service's contract endpoint); this schema's oneOf also lists every type and its required params.",
- "title": "Distribution Type",
- "type": "string"
- },
- "id": {
- "description": "Unique node id within the graph.",
- "title": "Id",
- "type": "string"
- },
- "interval": {
- "default": 1,
- "description": "Sample every N periods (1 = every period).",
- "minimum": 0,
- "title": "Interval",
- "type": "integer"
- },
- "name": {
- "default": "",
- "description": "Human-readable label.",
- "title": "Name",
- "type": "string"
- },
- "sampling_frequency": {
- "default": "per_period",
- "description": "'once' draws a single value reused across periods.",
- "enum": [
- "per_period",
- "once"
- ],
- "title": "Sampling Frequency",
- "type": "string"
- }
- },
- "required": [
- "id",
- "distribution_type",
- "distribution_params"
- ],
- "title": "RootNode",
- "type": "object"
-}