structural-estimation

Estimates structural economic model primitives and simulates counterfactual equilibria in R, Julia, or Python.

2|Updated Jun 8, 2026
One-click install
npx skills add https://github.com/lancegui/causal-powers --skill structural-estimation-lancegui
Or copy as Structured Prompt for Agentβ–Ό
Please help me install this Agent Skill.
Skill: structural-estimation
Source: https://github.com/lancegui/causal-powers/tree/main/skills/structural-estimation
Command: npx skills add https://github.com/lancegui/causal-powers --skill structural-estimation-lancegui

SYSTEM DOCUMENTATION & REQUIREMENTS

πŸ’‘ This Skill includes references (resource) components.

What problem does it solve? Structural estimation can silently produce confident, wrong answers: an optimizer converges on a parameter the data never identified, or a misspecified model fits in-sample and fabricates counterfactual results for mergers, taxes, or welfare calculations. This Skill enforces a disciplined workflow β€” model card, per-parameter identification, Monte Carlo recovery, gradient verification, and equilibrium re-solving β€” so structural estimates are validated before any counterfactual is trusted. ## Core Features & Use Cases - Model card gate: Documents primitives, per-parameter identification, the target counterfactual, and the estimation plan before any estimation machinery is built. - Monte Carlo recovery: Proves the estimator recovers known parameters from distant starting values across the parameter space, with objective-surface profiling and Hessian eigenvalue checks for non-identification. - Analytical gradient discipline: Derives group-by-group gradients (or uses AD), verified against finite differences, avoiding nested-loop tolerance bias. - Counterfactual simulation: Re-solves equilibria for merger pricing, dynamic discrete choice, entry games, auctions, consideration sets, and search models, bounded by the weakest assumption. - Use Case: An economist estimating a random-coefficients (BLP) demand model uses this Skill to write the model card, verify recovery with simulated data, estimate with pyblp, and simulate post-merger prices with the Bertrand equilibrium re-solved. ## Quick Start Use the structural-estimation skill to estimate a BLP demand model on my market-level data and simulate the price effects of the proposed merger.

Frequently Asked Questions about structural-estimation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I estimate a structural demand model like BLP?β–Ό

Write a model card defining primitives, per-parameter identification, and the target counterfactual first. Then prove Monte Carlo recovery of known parameters, estimate with GMM using instruments for endogenous prices, and validate fit against untargeted moments before running counterfactuals.

When should I use structural estimation instead of reduced-form analysis?β–Ό

Use structural estimation only when the question requires a world not observed in the data, such as post-merger prices, welfare from a new product, or separating preferences from consideration. If a well-identified DiD, IV, or RDD answers the question, reduced form is more credible.

What Python library should I use for BLP random-coefficients demand?β–Ό

pyblp is the recommended tool, implementing analytical gradients, optimal instruments, supply-side moments, and both MPEC and nested-fixed-point estimation. Hand-roll an estimator only outside its scope, and Monte-Carlo-verify any custom implementation.

Why does my structural model converge but give wrong counterfactuals?β–Ό

Convergence does not imply identification β€” a non-identified parameter converges to a value the data never pinned down. Profile the objective surface for flat directions, check the Hessian's smallest eigenvalue for ridges, and confirm Monte Carlo recovery from distant starting values.

Can I identify consideration sets or search costs without a shifter?β–Ό

No. Preferences and consideration are not separately identified without an exclusion restriction β€” a variable like advertising exposure, shelf position, or a default that moves the choice set but not utility. Without such a shifter, the estimation should stop.

Why are analytical gradients important in structural estimation?β–Ό

Finite-difference gradients are noisy and force loose tolerances, and a loose inner-loop tolerance in nested fixed-point estimation silently biases estimates. Derive gradients group by group or use automatic differentiation, then verify once against finite differences.