Snippets tagged statistics

  • Statistical functions

    Some basic statistics functions in F#, including erfc, erfcinv, normcdf, normpdf, norminv, additiveCorrection, multiplicativeCorrection, a Box-Mueller RandomSampler and a unitized type for a Gaussian distribution. Based on Ralf Herbrich's samples at

    4 people like this

    Posted: 4 years ago by Robert Herman

  • Binomial probabilities

    Simple function for commute binomial probabilities. For quick summary about binomial distribution: 1.) There are a fixed number of trials (n). 2.) Each trial has two possible outcomes: success of failure 3.) The probability of success (p) is the same for each trial. 4.) The trials are independent, meaning the outcome of one trial doesn't influence that of any other.

    0 people like this

    Posted: 2 years ago by Martin Bodocky


    Density-based spatial clustering of applications with noise (DBSCAN) is a data clustering algorithm. For more information see The implementation is based on the pseudocode in the article and the following C# code The implementation is not very functional but does the job. Added pwd by ignorance, the password is "fssnip" (without quotes)

    1 people like this

    Posted: 3 years ago by Samuel Bosch

  • Simple normally distributed random number generator

    There are better (faster, more efficient) ways to do this, F# numerics library for a start, but this is at least interesting. This snippet uses the polar form of the Box-Muller method to generate Normal- (Gaussian-) distributed random numbers as an infinite sequence. The polar form is more efficient than the basic form as it does not rely on trigonometric function calls, but there are far more efficient alogrithms (read harder to implement) e.g. the Ziggurat method (for a later post).

    2 people like this

    Posted: 2 years ago by Kevin Roche