Estimate longitudinal policy effect MSM
Estimate repeated-intervention regime effects with stabilized inverse-probability weights, an explicit marginal structural model, cluster bootstrap uncertainty, and positivity gates.
What it's for
Evaluates sequences of management policies when each decision depends on the team's evolving measured history instead of pretending interventions are one-shot and unconfounded.
What you give it
Every tool is a pure function: it computes from what you pass it and reads nothing on its own. Inputs split into evidence you supply from your connected systems, calibration your team owns, and numerical controls that affect precision but never the result's meaning.
| Field | Type | Role | Required |
|---|---|---|---|
| bootstrap_draws | integer ≥ 200, ≤ 20000 | Numerical control | Optional |
| confidence_level | number ≥ 0.8, ≤ 0.999 | Your calibration | Optional |
| max_stabilized_weight | number ≥ 1, ≤ 1000 | Your calibration | Optional |
| minimum_effective_sample_size | number ≥ 10 | Your calibration | Optional |
| minimum_observed_action_probability | number ≥ 0.000001, ≤ 0.25 | Your calibration | Optional |
| regimes | array of objects (2 fields) ≥ 2 items | Evidence | Yes |
| ridge | number ≥ 0, ≤ 100 | Your calibration | Optional |
| seed | integer | Numerical control | Optional |
| unit_histories | array of objects (3 fields) ≥ 100 items | Evidence | Yes |
Each unit_histories
record
| Field | Type | Required |
|---|---|---|
| id | string (non-empty) | Yes |
| outcome | number | Yes |
| periods | array of objects (4 fields) (≥ 2 items) | Yes |
{
"bootstrap_draws": 200,
"regimes": [
{
"id": "never",
"treatments": [
0,
0,
0,
0
]
},
{
"id": "always",
"treatments": [
1,
1,
1,
1
]
},
{
"id": "late",
"treatments": [
0,
0,
1,
1
]
}
],
"seed": 9,
"unit_histories": [
{
"id": "policy-unit-0",
"outcome": 3,
"periods": [
{
"period": 0,
"treatment": 0,
"treatment_propensity": 0.5
},
{
"period": 1, Truncated for display — the full payload is 2635 lines.
What you get back
This is the actual output of running the example above — computed by the same function the platform calls, not an illustration.
{
"assumptions": [
"At every period, the supplied treatment propensity conditions on the complete measured history needed for sequential exchangeability.",
"Consistency, positivity, no interference between units, and non-informative outcome observation hold for the declared regimes.",
"The marginal outcome is adequately represented by cumulative and timing-weighted treatment exposure; regime contrasts may be biased if this structural form is wrong.",
"The unit is a privacy-eligible team, project, service, or company cohort; this estimator must not drive individual employment or surveillance decisions."
],
"decision": "longitudinal_policy_effect_estimable",
"marginal_structural_model": {
"additional_late_treatment_effect": 0,
"effect_per_treated_period": 2,
"intercept": 3
},
"method": "stabilized_iptw_longitudinal_marginal_structural_model_v1",
"overlap": {
"effective_sample_size": 99.6702,
"fraction_weights_clipped": 0,
"maximum_raw_stabilized_weight": 1.0816,
"minimum_observed_action_probability": 0.5,
"minimum_required_effective_sample_size": 30,
"required_minimum_action_probability": 0.02,
"weight_cap": 20
},
"regime_effects": [
{
"contrast_interval": [
0,
0
],
"contrast_vs_baseline": 0,
"estimated_outcome": 3,
"probability_better_than_baseline": null,
"regime_id": "never"
},
{
"contrast_interval": [
8,
8
],
"contrast_vs_baseline": 8,
"estimated_outcome": 11,
"probability_better_than_baseline": 1,
"regime_id": "always"
}, Truncated for display — the full payload is 63 lines.
How it works
Constrained optimization — Pick the best feasible option under real limits — budget, headcount, dependencies, capacity — rather than ranking a list and hoping it fits.
- 1 Estimate repeated-intervention regime effects with stabilized inverse-probability weights, an explicit marginal structural model, cluster bootstrap uncertainty, and positivity gates.
- 2 Evaluate the method-specific diagnostics and gates returned by the function, then abstain unless the declared decision clears them under locally governed thresholds.
Before you trust it
Every tool in the catalog ships with the conditions under which its answer is meaningful — and the conditions under which it should abstain instead of guessing.
Assumptions & guardrails
- Objectives use commensurable locally governed value units, constraints reflect real feasibility, and uncertainty covers plausible adverse inputs.
- The recommendation is optimal only for its stated objective, feasible set, evidence, and solver guarantee; it is not a universal management optimum.
Minimum evidence
- unit_histories: at least 100 rows/items
- regimes: at least 2 rows/items
How to validate it
Backtest the chosen action against simple feasible baselines on held-out scenarios, sweep costs/constraints/risk tolerance, and require constraint feasibility under adverse inputs.
Calibrating it to your org
Same for everyone
The mathematical kernel, validation rules, method version, and JSON output semantics are organization-independent; no tenant-trained coefficients or company benchmark is embedded in the function.
Specific to you
- complete unit-period intervention panel
- terminal outcome at the declared horizon
- sequential treatment regimes
- assignment mechanism
- stabilized-weight and overlap policy
Calibration workflow
- 1 Define the management decision, target outcome, aggregate unit, privacy boundary, cadence, and prediction/intervention horizon for this organization.
- 2 Build a tenant-scoped historical cohort using only information available before each prediction or decision; preserve zero periods, censoring, assignment probabilities, and unresolved outcomes when the method requires them.
- 3 Estimate statistical parameters on training history, but obtain costs, utilities, risk tolerance, practical-effect thresholds, capacity, and policy constraints from accountable decision owners.
- 4 Validate on later time windows or held-out aggregate units at the deployment grain, against a simple baseline and the function-specific validation strategy.
- 5 Deploy only if the returned decision clears evidence, overlap, calibration, robustness, and guardrail checks; warning, unsupported, schema-gap, and fallback decisions are abstentions.
- 6 Monitor realized outcomes, data drift, coverage, and decision regret; recalibrate at a governed cadence or after a detected regime/definition change, never merely because a stakeholder dislikes the result.
Call it from your AI
You don't wire up 388 tools in your MCP client. The GitRevio MCP server exposes 20 tools, three of which let an agent search the catalog, read a tool's schema, and run it — so the assistant finds this one on its own.
gitrevio_capabilities_search
{ "q": "estimate repeatedintervention regime effects with stabilized" }
→ finds "estimate_longitudinal_policy_effect_msm"
gitrevio_capability_describe
{ "capability_id": "estimate_longitudinal_policy_effect_msm" }
→ returns the input schema and agent guidance shown on this page
gitrevio_capability_run
{ "capability_id": "estimate_longitudinal_policy_effect_msm", "arguments": { ... } }
→ returns the result shown above Works in Claude Desktop, Claude Code, Cursor, Cline, Continue.dev, Goose and Aider. See the MCP server.