Giter VIP home page Giter VIP logo

generate_rvs's Introduction

Generate Random Variates from Various Distributions

The library for generating random variates is in the file generateDistribution.py. By importing the library, we can create an object of the distGenerator class.

# Import the generateDistribution Library
import generateDistribution as genDist

# Create an object of the distGenerator class
dist = genDist.distGenerator()

Once the object is created, we can call the functions below:

Generalized Utility Functions

  • plotDist(): Plot histogram of the generated random numbers

  • compPlotDist(): Side by Side Comparison of Distribution Histograms, usually the generated Random Variate (from the generateDistribution.py Library) and the corresponding scipy function

  • validateDist(): Validates if the generated distribution matches that of the scipy reference distribution by conducting a Kolmogorov–Smirnov test (KS) Test, usually the generated Random Variate (from the generateDistribution.py Library) and the corresponding scipy function generated Random Variate

Generate Random Variates for Various Distributions

  • generateExponential(Lambda, size, random_state): Generates size number of Exponential Random Variables based on Lambda parameter and random state seed

  • generateWeibull(Alpha, Beta, size, random_state): Generates size number of Weibull Random Variables based on Alpha and Beta parameter and random state seed

  • generateBernoulli(p, size, random_state): Generates size number of Bernoulli Random Variables based on p parameter and random state seed

  • generateGeometric(p, size, random_state): Generates size number of Geometric Random Variables based on p parameter and random state seed

  • generateNormal(Mu, Sigma, size, random_state1, random_state2): Generates size number of Normal Random Variables based on Mu, Sigma parameters and random state seeds using the Box-Mueller method

  • generateGamma(Alpha, Beta, size, random_state): Generates size number of Gamma Random Variables based on Alpha and Beta parameter and random state seed

More examples of how to use the functions are in demo.ipynb

generate_rvs's People

Contributors

teresadong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.