statistical-modeling is a Python package that provides two main features:
- Statistical analysis of samples
- Working with distributions
import statistical_modeling as sm
from matplotlib import pyplot as plt
print(sm.RandomInt(sm.geometric.Distribution(0.1)))
s = sm.RandomSample(
100,
sm.binomial.Distribution(10, 0.5),
sm.binomial.CumulativeAlgorithm()
)
print(
f"Mean = {sm.Mean(s)},\n"
f"Variance = {sm.Variance(s)}"
)
fig, ax = plt.subplots()
sm.plot_pdf(s, ax)
fig.show()