microcalibrate

Calibrate survey weights to population targets using L0 regularization.

31|6|Updated Oct 19, 2025
One-click install
npx skills add https://github.com/PolicyEngine/policyengine-claude --skill microcalibrate
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: microcalibrate
Source: https://github.com/PolicyEngine/policyengine-claude/tree/main/skills/microcalibrate-skill
Command: npx skills add https://github.com/PolicyEngine/policyengine-claude --skill microcalibrate

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires microcalibrate.

What problem does it solve?

Survey data often needs adjustment to accurately represent population totals (benchmarks), and traditional calibration can result in dense, inefficient datasets. MicroCalibrate addresses this by providing advanced calibration with sparsity and hyperparameter tuning.

Core Features & Use Cases

  • Weighted Survey Calibration: Adjusts survey weights to precisely match known population targets (e.g., total income, employment).
  • Sparsity with L0 Regularization: Encourages many weights to become zero, reducing dataset size for faster simulations without losing accuracy.
  • Automatic Hyperparameter Tuning: Optimizes calibration parameters to achieve the best balance between target matching and sparsity.
  • Use Case: Calibrate a survey dataset's household weights to match known population totals for income and employment, reducing the number of active households by 60% for faster PolicyEngine simulations.

Quick Start

Use the microcalibrate skill to calibrate your weights to match targets using your estimate_matrix with a sparsity penalty.

Frequently Asked Questions about microcalibrate

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

FAQPage Schema
How do I calibrate survey weights to match population targets?

Calibrate survey weights by providing your estimate matrix, target benchmarks, and initial weights to microcalibrate, which uses L0 regularization and PyTorch optimization to adjust weights until sample totals align with known population totals like income or employment.

What is L0 regularization and how does it reduce dataset size?

L0 regularization penalizes non-zero weights during calibration, encouraging many weights to become exactly zero. This sparsity shrinks your active dataset—often by 60% or more—while maintaining accuracy for faster PolicyEngine simulations.

Can microcalibrate automatically tune hyperparameters for my survey data?

Yes, microcalibrate includes automatic hyperparameter tuning that optimizes the sparsity penalty (lambda) to balance target matching accuracy against dataset sparsity, eliminating manual lambda selection.

When should I use calibration with sparsity instead of standard weighting methods?

Use calibration with sparsity when you have known population benchmarks, need faster simulations without sacrificing representativeness, and can tolerate some weights becoming zero. It's ideal for PolicyEngine workflows requiring both accuracy and computational efficiency.

What input data do I need to calibrate my survey with microcalibrate?

Provide three inputs: your survey weights (initial adjustment factors), an estimate matrix (survey characteristics aligned to population dimensions), and target values (known population totals for each dimension like total income or employment count).

Does microcalibrate work with survey data that has multiple population targets?

Yes, microcalibrate accepts multiple population targets simultaneously—income, employment, demographics, or any measurable benchmarks—and optimizes weights to match all targets while enforcing sparsity across the entire dataset.