Git Product home page Git Product logo

stats_sampling's Introduction

Statistical Sampling

Some sampling methods for various discrete and continuous random variables.

distribution params notes
uniform -
binomial n,p
neg. binomial r,p
cauchy center,scale
exponential k
laplace center,scale
poisson mean
normal mean, std. dev
gamma shape, rate
beta shape
dirichlet alphas
chi-squared center,spread

Locale

cocurrent 'sampling'

Uniform (Continuous)

NB. 10 i.i.d. uniform samples taken from U(0,1) distribution.
uniformSample 10

Normal / Gaussian

NB. 10 random variables independently sampled from a N(2.5,6.4) 
NB. normal distribution.
normalSample 2.5 6.4 10

Exponential

NB. 1000 random variables independently sampled from an
NB. exp(10) distribution.
exponentialSample 10 1000

Poisson

NB. 1000 random variables independently sampled from a 
NB. Po(2.222) poisson distribution.
exponentialSample 2.222 1000

Some examples

poisson distribution sampling

Cauchy

NB. 200 random variabled independently sampled from a Cauchy(0,1)
NB. distribution.
cauchySample 0 1 200

Gamma

NB. 4000 random variables independently sampled from a NB. Gamma(4.6,1) gamma distribution.

gammaSample 4.6 1 4000 

Some examples

gamma distribution sampling

Beta

NB. 1000 random variables independently sampled from a
NB. Beta(2,4) beta distribution.
betaSample 2 4 4000 

Binomial

NB. 100 random variables independently sampled from a
NB. Bin(10,0.4) binomial distribution.
binomialSample 10 0.4 100 

Some examples

binomial distribution sampling

Negative Binomial

NB. 100 random variables independently sampled from a
NB. NegBin(10,0.4) binomial distribution.
binomialNegSample 10 0.4 100 

Dirichlet

NB. 100 random variables independently sampled from a
NB. Dir(0.2, 0.1, 0.99, 0.5, 1.4) dirichlet distribution,
NB. where the parameters are the parameter 'a' of a 
NB. Gamma(a,1) distribution.
dirichletSample 10 0.4 100 

Laplace

NB. 1000 random variables independently sampled from a
NB. Laplace(0,2) laplace distribution.
laplaceSample 0 2 1000 

Some examples

laplace distribution sampling

Chi-Squared

NB. 1000 random variables independently sampled from a
NB. ChiSq(0,1,3) chi-squared distribution.
chiSqSample 0 1 3 1000 

Some examples

Chi-Squared distribution sampling

stats_sampling's People

Contributors

jonghough avatar

Watchers

James Cloos avatar  avatar  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.