Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : Distfun details
Login with GitLab


Distribution functions
(12032 downloads for this version - 111667 downloads for all versions)
A more recent valid version exists: 1.1.1
Michael Baudin
Prateek Papriwal
Pierre Lecuyer
Luc Devroye
Jean-Philippe Chancelier
Michael A. Malcolm
Cleve B. Moler
George Marsaglia
Arif Zaman
Barry W. Brown
James Lovato
Kathy Russell
Makoto Matsumoto
Takuji Nishimura
Bruno Pincon
Richard Brent
John Burkardt
Owner Organization
INRIA, DIGITEO and others
prateek papriwal
Michael BAUDIN
Creation Date
October 10, 2015
Source created on
Scilab 5.5.x
Binaries available on
Scilab 5.5.x:
Linux 32-bit Windows 32-bit Windows 64-bit Linux 64-bit
Install command
--> atomsInstall("distfun")
            The goal of this toolbox is to provide accurate distribution functions. 
The provided functions are designed to be compatible with Matlab.

The goals of this toolbox are the following.
 * All functions are tested with tables (actually, csv datasets).
   The tests includes accuracy tests, so that the accuracy 
   should by from 13 to 15 significant digits in most cases.
 * For each distribution, we have 
   * the probability distribution function (PDF)
   * the cumulated distribution function (CDF)
   * the inverse CDF
   * the random number generator
   * the statistics (mean and variance)
 * The CDF provides the upper and the lower tail of the 
   distribution, for accuracy reasons. 
 * The uniform random numbers are of high quality.
   The default is to use the Mersenne-Twister generator.   
 * Each function has a consistent help page.
   This removes confusions in the meaning 
   of the parameters and clarifies the differences 
   with other computing languages (e.g. R).
The design is similar to Matlab's distribution functions. 
A significant difference with Matlab's function is that both 
the upper and lower tails are available in "distfun", while 
Matlab only provides the lower tail. 
Hence, "distfun" should provide a better accuracy when 
probabilities close to 1 are computed (e.g. p=0.9999). 

There are many interesting, positive, differences with Scilab, Stixbox, or other
tools. For a full set of motivations, please read :

For each distribution x, we provide five functions :
 * distfun_xcdf : x CDF
 * distfun_xinv : x Inverse CDF
 * distfun_xpdf : x PDF
 * distfun_xrnd : x random numbers
 * distfun_xstat : x mean and variance

Distributions available :
 * Beta (with x=beta)
 * Binomial (with x=bino)
 * Chi-Squared (with x=chi2)
 * Extreme Value (with x=ev)
 * Exponential (with x=exp)
 * F (with x=f)
 * Gamma (with x=gam)
 * Geometric (with x=geo)
 * Histogram (with x=histo)
 * Hypergeometric (with x=hyge)
 * Kolmogorov-Smirnov (with x=ks)
 * LogNormal (with x=logn)
 * LogUniform (with x=logu)
 * Multinomial (with x=mn)
 * Multivariate Normal (with x=mvn)
 * Negative Binomial (with x=nbin)
 * Noncentral F (with x=ncf)
 * Noncentral T (with x=nct)
 * Noncentral Chi-Squared (with x=ncx2)
 * Normal (with x=norm)
 * Poisson (with x=poi)
 * T (with x=t)
 * Truncated Normal (with x=tnorm)
 * Uniform Discrete (with x=unid)
 * Uniform (with x=unif)
 * Weibull (with x=wbl)

 * dispfun_tutorial : A tutorial of the Distfun toolbox.
 * dispfun_plots : A collection of distribution function plots.

 * distfun_betainc : Regularized Incomplete Beta function
 * distfun_erfcinv : Inverse erfc function
 * distfun_gammainc : Regularized incomplete Gamma function
 * distfun_genericpdf : Compute the PDF from the CDF.
 * distfun_getpath : Returns path of current module
 * distfun_histocreate : Creates an histogram
 * distfun_inthisto : Discrete histogram
 * distfun_permrnd : Random permutation
 * distfun_plotintcdf :  Plots an integer CDF
 * distfun_verboseset : Set verbose mode.

Weibull fitting
 * distfun_wblfit : Weibull parameter estimates
 * distfun_wblfitmm : Weibull parameter estimates with method of moments
 * distfun_wbllike : Weibull negative log-likelihood
 * distfun_wblplot : Weibull plot

Other fitting functions
 * distfun_uniffitmm : Uniform parameter estimates with method of moments
 * distfun_betafitmm : Beta parameter estimates with method of moments
 * distfun_gamfitmm : Gamma parameter estimates with method of moments

Random Number Generator
 * rng_overview : An overview of the Random Number Generators of the Distfun
 * distfun_genget : Get the current random number generator
 * distfun_genset : Set the current random number generator
 * distfun_seedget : Get the current state of the current random number
 * distfun_seedset : Set the current state of the current random number
 * distfun_streamget : Get the current stream
 * distfun_streaminit : Initializes the current stream
 * distfun_streamset : Set the current stream

Multivariate vectors
 * distfun_vectorrnd : Random vectors.
Files (5)
[1.71 MB]
Source code archive

[1.60 MB]
Linux 32-bit binary for Scilab 5.5.x
Linux version (i686)
Automatically generated by the ATOMS compilation chain

[2.04 MB]
Windows 32-bit binary for Scilab 5.5.x
Windows version (i686)
Automatically generated by the ATOMS compilation chain

[2.06 MB]
Windows 64-bit binary for Scilab 5.5.x
Windows version (x64)
Automatically generated by the ATOMS compilation chain

[1.61 MB]
Linux 64-bit binary for Scilab 5.5.x
Linux version (x86_64)
Automatically generated by the ATOMS compilation chain

News (0)
Comments (5)     Leave a comment 
Comment from Michael BAUDIN -- October 10, 2015, 08:55:05 PM    
This is the changelog.

distfun (1.0)
 * Fixed ticket #1526
   Fixed function name for Multivariate Normal.
To update your code, please replace :


with :


 * Created distfun_vectorrnd : vector random number generator 
   with independent or gaussian copula. 
 * Created new histogram distribution. 
   This is useful when lots of datas are available.
   This fixes ticket #1514.
 * Fixed ticket #1585
   distfun_wblplot failed with Scilab 5.5.2.
   Used backslash instead of regress.

distfun (v0.9.1)
 * Updated distfun_genericpdf to use numderivative, 
   for Scilab 5.5.0
   Idem for distfun_wblfit.
 * Updated distfun_wblstat to update vector^scalar 
   syntax for Scilab 5.5.0
   Idem for distfun_unidstat.
 * Added Rejection algorithm demo : Normal distribution, 
   based on instrumental Cauchy distribution.

Comment from Michael BAUDIN -- February 9, 2016, 10:19:34 PM    

Is there any specific reason for this release not to be packaged ?


Comment from David Chèze -- February 29, 2016, 12:00:33 PM    

I've just tried to run the builder of this module on my WIN7 x64 + msvc120express + 
scilab 6.0 beta1 and I've got error message complaining about unknown nmake command.

Maybe there are some changes in scilab 6 compilation process ?

Comment from prateek papriwal -- October 9, 2016, 10:46:08 AM    
Hi Michael,

****Sorry for posting this here****

This is Prateek. If you remember, I did GSoc'12 and you were mentor. I wanted to reach out
to you but i did 
not have your email id. Could you tell me your email id? My email id is -

Prateek Papriwal 
Leave a comment
You must register and log in before leaving a comment.
Login with GitLab
Email notifications
Send me email when this toolbox has changes, new files or a new release.
You must register and log in before setting up notifications.