stochlab Documentation
stochlab is a Python library for discrete-time stochastic processes, Monte Carlo simulation, and analytics.
Getting Started:
User Guides:
API Reference:
Contributing:
Quick Start
import numpy as np
from stochlab.core import StateSpace
from stochlab.models import MarkovChain
# Create a simple 2-state Markov chain
states = ["Bull", "Bear"]
P = np.array([[0.7, 0.3], [0.4, 0.6]])
mc = MarkovChain.from_transition_matrix(states, P)
# Simulate paths
result = mc.simulate_paths(n_paths=1000, T=100)
df = result.to_dataframe()