Pyciemss
Causal and probabilistic reasoning with continuous time dynamical systems
Install / Use
/learn @ciemss/PyciemssREADME
PyCIEMSS
PyCIEMSS is a library for causal and probabilistic reasoning with continuous time dynamical systems. Specifically, PyCIEMSS provides high-level interfaces for building dynamical systems models from standardized JSON templates, and automating a small collection of standard modeling tasks using them. PyCIEMSS is built on the more general-purpose causal probabilistic programming language ChiRho.
Overview
PyCIEMSS automates the following standard high-level modeling tasks.
sample: Sample simulated trajectories from a probabilistic dynamical systems model. Optionally, add causal interventions.
calibrate: Update dynamical systems parameters from data. Optionally, add causal interventions.
optimize: Find the intervention that best achieves some objective subject to (probabilistic) constraints.
ensemble_sample: Sample simulated trajectories from an ensemble of probabilistic dynamical systems models.
ensemble_calibrate: Update dynamical systems parameters and mixture weights for an ensemble of probabilistic dynamical systems models.
Getting Started
Install PyCIEMSS following our installation instructions.
See our interfaces notebook for example usage of all interfaces.
Intermediate Usage
While PyCIEMSS does not require any direct interaction with ChiRho, there are some use-cases where it makes sense to (i) compile models from the standardized JSON templates using PyCIEMSS and then (ii) use ChiRho directly to answer advanced probabilistic and causal questions. For example, one may wish to add an uncertain intervention as described in ChiRho's dynamical systems tutorial.
from chirho.dynamical.handlers import StaticIntervention
from pyciemss.compiled_dynamics import CompiledDynamics
import pyro
import torch
sir_model_path = ... # TODO: provide a model JSON path
sir_model = CompiledDynamics.load(sir_model_path)
start_time = torch.tensor(0.0)
end_time = torch.tensor(10.0)
intervention_time = torch.tensor(10.0)
intervention_assignment = pyro.sample("intervention_assignment", pyro.distributions.Uniform(10., 20.))
with StaticIntervention(intervention_time, {"S": intervention_assignment}):
end_state = sir_model(start_time, end_time)
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
