drisk

drisk is a Python package for quick Monte Carlo modelling, with an emphasis on ergonomic distribution elicitation and model composability.

It is designed to make probabilistic models simple enough for quick scripts and notebooks, while still supporting more structured simulation workflows.

Key features include:

This documentation site collects runnable examples and report-style walkthroughs.

Quick start

import drisk as dr

Create a positive, right-skewed LogNormal distribution and plot it.

volume = dr.LogNormal.elicit(
    lower=800,
    upper=1_500,
    confidence=0.8,
    name="Monthly sales volume",
)

volume.plot(color="steelblue")

Create a PERT distribution from a minimum, most-likely, and maximum estimate.

margin = dr.PERT.elicit(
    min=20,
    mode=35,
    max=60,
    name="Unit margin",
)

margin.plot(color="darkorange")

Compose the distributions with ordinary Python arithmetic, then simulate the result.

monthly_profit = volume * margin
monthly_profit.name = "Simulated Monthly Profit"
samples = monthly_profit.sample(size=50_000, seed=42)
samples[:5]
array([50041.11600797, 45977.5685894 , 48566.97041161, 38203.91838619,
       18664.17584828])
monthly_profit.plot(color="seagreen")