Skip to content

Instantly share code, notes, and snippets.

View April04082001's full-sized avatar

April04082001

View GitHub Profile
@zeimusu
zeimusu / Fleishman.py
Last active June 26, 2023 08:03
Generate data with given mean, standard deviation, skew, and kurtosis. Intended for monte carlo simulations with non normal distributions
import numpy as np
from numpy.linalg import solve
import logging
logging.basicConfig(level = logging.DEBUG)
from scipy.stats import moment,norm
def fleishman(b, c, d):
"""calculate the variance, skew and kurtois of a Fleishman distribution
F = -c + bZ + cZ^2 + dZ^3, where Z ~ N(0,1)
"""