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

    5 people like this

    Posted: 12 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: 9 years ago by Martin Bodocky

  • Average Square Error

    In statistics, one of the standard ways to calculate an estimate/estimation quality, to be able to compare how good are different estimates.

    1 people like this

    Posted: 6 years ago by Tuomas Hietanen


    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: 10 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: 9 years ago by Kevin Roche