Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

mixlogit

Read-only

Estimate mixed logit models with random coefficients using simulated maximum likelihood to analyze discrete choice data and quantify preference heterogeneity for evidence-backed decisions.

Instructions

Mixed Logit (random-coefficient MNL) via simulated maximum likelihood.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
yYesColumn name with the 0/1 chosen indicator.
altNoAlternative identifier -- accepted for API compatibility with ``statsmodels.MNLogit`` / Stata conventions, but the ordering of alternatives is taken directly from the DataFrame's row order within each ``chid`` group.
tolNoNumerical convergence tolerance.
chidYesChoice-situation identifier. All rows with the same ``chid`` form one choice set.
alphaNoSignificance level.
detailNoPayload depth: 'minimal' (~150 tokens) for sub-step calls where only the point estimate is needed; 'standard' (~1K tokens) for diagnostics + coefficient table; 'agent' (~2K tokens, default) adds violations / next_steps / suggested_functions so the LLM can plan its next call without another round-trip.agent
robustNoReport OPG-sandwich robust SEs. ``False`` -> classical inverse Hessian.
maxiterNomaxiter parameter (int).
n_drawsNoNumber of Halton draws per individual. Rule-of-thumb: use ``>= 1000`` for correlated models or precise inference.
verboseNoverbose parameter (bool).
x_fixedNoColumns entering with fixed (non-random) coefficients.
panel_idNoIndividual identifier. When provided, the SAME draws of the random coefficients are used for every choice of the individual (Train 2009 Section 6.5). Omit for cross-sectional data.
x_randomNoColumns entering with random coefficients (at least one required).
as_handleNoIf true, cache the fitted result on the server and return result_id + result_uri alongside the JSON payload so a subsequent tools/call can chain without re-running.
data_pathYesAbsolute path or URL to a data file. Supported: .csv / .tsv / .txt (delimited), .parquet / .pq, .feather / .arrow, .xlsx / .xls, .dta (Stata), .json / .jsonl. Schemes: file://, s3://, gs://, https://.
result_idNoOptional handle to a previously-fitted result (returned by an earlier call when as_handle=true). Tools that operate on a fitted object accept this in place of re-supplying data_path + columns.
correlatedNoIf True, estimate a full Cholesky factor of ``cov(beta_random)``; otherwise only diagonal standard deviations.
halton_seedNohalton_seed parameter (int).
random_distNoPer-random-variable distribution -- one of ``'normal'`` (default), ``'lognormal'``, ``'triangular'``.
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
data_sample_nNoOptional uniform random subsample size (seed=0, deterministic) — useful on huge panels.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered. The description adds no behavioral context—no mention of what the tool returns, whether it caches results, or any side effects. It does not contradict the annotations, but it adds no value beyond them, so a 2 is appropriate.

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

Conciseness4/5

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

The description is a single concise sentence, front-loading the model type and method. It has zero waste and is instantly parseable. It lacks any structural elaboration, but for a description this short, that is acceptable. Not a 5 because it does not provide additional context that would aid scanning.

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

Completeness2/5

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

Given the tool's complexity (21 parameters, required arguments, nested objects, output schema), a one-line description is inadequate. While the schema and output schema cover many details, the description leaves out usage context, expected inputs, and behavioral traits. An agent cannot confidently decide to call this tool without consulting extensive schema and sibling information.

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

Parameters3/5

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

Schema description coverage is 100%, so all 21 parameters are documented in the schema. The description itself contributes nothing about parameters, making the baseline 3 appropriate. It neither enhances nor degrades the parameter understanding beyond the schema.

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

Purpose4/5

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

The description clearly names the model ('Mixed Logit') and the estimation method ('simulated maximum likelihood'), which distinguishes it from siblings like clogit or mlogit. It lacks an explicit verb ('estimates') but the model name unambiguously implies the action. It does not explicitly differentiate from alternatives, hence 4 rather than 5.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives such as mlogit, clogit, or mixed. It does not mention panel data needs, random coefficients, or cross-sectional cases. The schema parameters hint at usage, but the description itself is silent, so an agent gets no routing help.

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

Deploy Server

Other Tools