Skip to main content
Glama
vikranthviki

Causal Decision Agent

by vikranthviki

fepois

Read-only

Estimate Poisson regression with high-dimensional fixed effects for count outcomes. Controls for group heterogeneity and delivers PPML-consistent coefficients with robust inference.

Instructions

Estimate Poisson regression with high-dimensional fixed effects via pyfixest. Validation: certified parity evidence. Assumptions: Conditional mean exponential link: E[y | x, alpha] = exp(x'beta + alpha); Strict exogeneity conditional on the absorbed fixed effects (PPML consistency). Pre-conditions: Outcome is a non-negative count or non-negative continuous variable; Fixed effects columns are categorical; absorbed groups exist. Failure modes: Convergence failure or extreme exponentiated predictions -> Drop large-magnitude regressors, rescale, or switch to OLS on log(1+y) (with caveats); Separation: some FE level perfectly predicts zero outcomes -> Drop perfectly-predicted groups and rerun; document the restriction. Alternatives: sp.feols, sp.regress, sp.panel. Typical minimum N: 200.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fmlYespyfixest formula. E.g. ``"Y ~ X1 | firm"``.
sscNoSmall-sample correction.
seedNoRNG seed for sampled (non-enumerated) ``vce="wild"`` draws.
vcovNoVariance-covariance estimator (``vce=`` is the canonical alias). Besides the pyfixest values (``"iid"``, ``"HC1"``, ``{"CRV1": "firm"}``, ...), accepts the extended menu: - ``vce="CR2"`` / ``"CR3"`` / ``"jackknife"`` (with ``cluster=``) -- clubSandwich glm bias-reduced cluster-robust SEs on the FE-as-dummies design; matches R ``clubSandwich::vcovCR(glm)``. - ``vce="wild"`` (with ``cluster=``) -- restricted score wild cluster bootstrap (Kline-Santos 2012) with Stata ``boottest``'s exact studentization; bit-exact vs ``boottest`` in the enumerated regime.
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
clusterNoCluster id column for the extended ``vce=`` menu; also a shorthand for one-way ``{"CRV1": cluster}``.
weightsNoColumn name for regression weights (not supported with the extended ``vce=`` menu).
fixef_rmNoSingleton fixed effect handling.none
iwls_tolNoIWLS convergence tolerance.
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.
wild_repsNoReplications for ``vce="wild"``. When ``2**G <= wild_reps`` the full Rademacher grid is enumerated (deterministic).
collin_tolNoCollinearity tolerance.
conley_latNoconley_lat parameter (Optional[str]).
conley_lonNoconley_lon parameter (Optional[str]).
data_columnsNoOptional column projection. Parquet/Feather/Stata loaders honour this for fast partial reads.
iwls_maxiterNoMax IWLS iterations.
conley_cutoffNoconley_cutoff parameter (Optional[float]).
data_sample_nNoOptional uniform random subsample size (seed=0, deterministic) — useful on huge panels.
wild_weight_typeNoWild weight distribution (``"rademacher"`` or ``"webb"``).rademacher

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior5/5

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

Beyond the readOnlyHint/openWorldHint annotations, the description discloses the statistical assumptions (exponential conditional mean, strict exogeneity/PPML consistency), two specific failure modes (convergence failure and separation) with step-by-step remedies, a validation parity claim, and a minimum-N heuristic. This is exactly the behavioral context an agent needs to anticipate and handle estimation failures.

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

Conciseness3/5

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

The purpose is front-loaded and sections are labeled (Validation, Assumptions, Pre-conditions, Failure modes, Alternatives), which aids parsing. However, the description runs roughly 280 words and includes vague entries like 'certified parity evidence' (parity with what?) and 'with caveats' (unspecified), and the alternative names use an 'sp.' prefix inconsistent with the tool registry — these ambiguities cost it a point.

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

Completeness4/5

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

For a 21-parameter tool with a rich output schema and fully documented parameters, the description covers the important meta-context: assumptions, pre-conditions, failure modes and remedies, alternatives, and sample-size guidance. The remaining gaps — e.g., pairing vcov choices with failure scenarios or interpreting the detail levels — are minor because the schema and output schema already carry the structured burden.

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 the baseline of 3 applies; every parameter already has a description in the input schema. The tool description adds no parameter-level meaning — it does not clarify fml construction beyond the schema's example, nor does it expand on the extended vce menu interactions, so it neither helps nor hurts.

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 opening sentence states a specific verb and resource: 'Estimate Poisson regression with high-dimensional fixed effects via pyfixest,' which names both the model class and the implementation. It does not explicitly differentiate itself from closely related siblings like feglm, ppmlhdfe, or poisson, though the pyfixest anchor helps an agent distinguish it from those.

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

Usage Guidelines4/5

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

Pre-conditions are explicit (non-negative count/continuous outcome, categorical FE columns, absorbed groups exist) and failure modes carry concrete remediation, including when to abandon this estimator in favor of OLS on log(1+y). Alternatives are listed (sp.feols, sp.regress, sp.panel), but without decision criteria for choosing among them, and the 'sp.' prefix does not match the sibling names as they appear in the environment.

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