Skip to content

Instantly share code, notes, and snippets.

View playgrdstar's full-sized avatar

Ming | Gary Ang playgrdstar

View GitHub Profile
@playgrdstar
playgrdstar / Fleishman.py
Created October 10, 2021 13:48 — forked from zeimusu/Fleishman.py
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)
"""