Expected value and probability weighting
calculate_expected_valueExpected-value engine. Compute expected values over discrete, continuous, simulated, or tree-structured uncertainty, plus football-field ranges. Use this for generic probability weighting of scenarios, Monte-Carlo and decision trees; it does NOT perform IFRS/HKFRS measurement of provisions, insurance or employee-benefit obligations (use calculate_actuarial_pv), and it does not price path-dependent payoffs (use calculate_structured_product). Methods: discrete: outcomes, probabilities; continuous: distribution, mean, std, lower, upper; scenario: scenarios; monte_carlo: iterations, distributions, base_params, seed; decision_tree: tree; football_field: estimates. Supply exactly one method with its declared inputs (no defaults). An unknown method, a missing input, or an extra field returns an error envelope (code INVALID_ARGUMENT) instead of raising.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| std | No | Distribution standard deviation (>0). | |
| mean | No | Distribution mean. | |
| seed | No | Deterministic RNG seed (required by simulation methods for reproducibility). | |
| tree | No | Decision tree with chance/decision nodes. | |
| lower | No | Lower integration bound. | |
| upper | No | Upper integration bound. | |
| method | Yes | Formula to apply; the tool description lists the exact inputs each value requires. | |
| outcomes | No | Outcome values aligned with probabilities. | |
| estimates | No | Estimates [{method, central, low, high}] for a football field. | |
| scenarios | No | Scenarios [{probability, value}] with probabilities summing to 1. | |
| iterations | No | Monte-Carlo iterations (>=1000). | |
| base_params | No | Base parameter values for simulation. | |
| distribution | No | Continuous distribution to integrate over. | |
| distributions | No | Input distributions [{parameter, type, mean, std}]. | |
| probabilities | No | Cumulative success probability per period in [0,1], aligned with cash_flows. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| error | No | Error detail, present only when status='error'. | |
| steps | No | Ordered computation steps, when the method reports them. | |
| value | No | Primary result: a number for scalar methods, an object for valuation methods. | |
| method | No | Method or tool name that produced the result. | |
| status | Yes | 'ok' on success, 'error' on failure. | |
| ticker | No | Ticker the result pertains to, when applicable. | |
| assumptions | No | Inputs and assumptions used, echoed for traceability. | |
| formula_ref | No | Formula or standards reference for the method. | |
| data_timestamp | No | ISO-8601 UTC timestamp of the underlying data, when fetched. |