Skip to main content

scikit-agent

Actions Status Documentation PyPI version PyPI platforms GitHub Discussion

A scientific Python toolkit for agent-based economic modeling: build models from modular blocks, solve them with deep learning or classical numerical methods, and simulate.

📖 Documentation  ·  Quickstart  ·  Examples  ·  API Reference

Quick example

import skagent as ska
from skagent.models.consumer import cons_problem, calibration

# `cons_problem` is a prebuilt consumption-saving model. Supply a decision
# rule for the control `c` and simulate a population of agents forward.
simulator = ska.MonteCarloSimulator(
    calibration=calibration,
    block=cons_problem,
    dr={"c": lambda m: 0.9 * m},
    initial={"k": 1.0},
    agent_count=1000,
    T_sim=50,
    seed=42,
)
simulator.initialize_sim()
history = simulator.simulate()

The Quickstart goes further, solving the model for an optimal policy instead of hand-coding a rule.

scikit-agent is a scientific Python toolkit for agent-based economic modeling and multi-agent systems design. It provides a unified interface for creating, solving, and simulating economic models using modern computational methods — including deep learning — alongside more traditional numerical techniques.

Our goal is for scikit-agent to be for computational social science what scikit-learn is for machine learning.

Key Features

  • 🧱 Modular modeling system. Construct multi-agent environments from composable blocks of structural equations.
  • Solution algorithms. Solve models with deep-learning methods (following Maliar, Maliar, and Winant, 2021), value backwards induction, and reinforcement learning via Stable-Baselines3.
  • 📊 Simulation tools. Generate synthetic data and run policy experiments with a Monte Carlo engine.
  • 🐍 Built on Scientific Python and PyTorch for easy integration with the wider Python ecosystem.

Installation

uv add scikit-agent

Or, outside a uv project, uv pip install scikit-agent (or plain pip install scikit-agent).

For a development installation (uv required):

git clone https://github.com/scikit-agent/scikit-agent.git
cd scikit-agent
uv sync --extra test --extra docs

See the documentation for the user guide, a gallery of runnable examples, and the full API reference.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scikit_agent-0.1.0.tar.gz (308.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

scikit_agent-0.1.0-py3-none-any.whl (137.4 kB view details)

Uploaded Python 3

File details

Details for the file scikit_agent-0.1.0.tar.gz.

File metadata

  • Download URL: scikit_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 308.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scikit_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 50d96caffcf36a29e49ed0dd0d5126409769e41168e2613af0e44957d6f4c3b7
MD5 0fad7b60fe34e38d9bffed19ff9b5d59
BLAKE2b-256 3aa536d0527037d2fcaf4367ded1debca804918ef7d479df5dce279e431434be

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_agent-0.1.0.tar.gz:

Publisher: cd.yml on scikit-agent/scikit-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file scikit_agent-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: scikit_agent-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 137.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for scikit_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 89d0cd394e3df7b9f60d806f84dbe9021c75668d4c1004f7832e17039a592bc6
MD5 2c5c9da6c8cae1316844b934efed6116
BLAKE2b-256 04d17946e16fd0a1ebe609f3e334ae477bc4559471b7f2e24d275b576685549e

See more details on using hashes here.

Provenance

The following attestation bundles were made for scikit_agent-0.1.0-py3-none-any.whl:

Publisher: cd.yml on scikit-agent/scikit-agent

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page