Scilab Home Page | Wiki | Bug Tracker | Forge | Mailing List Archives | Scilab Online Help | File Exchange
ATOMS : Distfun details
Please login or create an account

Distfun

Distribution functions
(991 downloads for this version - 66039 downloads for all versions)
Details
Version
0.5
A more recent valid version with binaries for Scilab 5.4 exists: 0.9
Authors
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
Owner Organization
INRIA, DIGITEO and others
Maintainers
Prateek Papriwal
Michael Baudin
License
Dependencies
Creation Date
December 1, 2012
Source created on
Scilab 5.4.x
Binaries available on
Scilab 5.4.x:
Windows 32-bit Windows 64-bit MacOSX
Install command
--> atomsInstall("distfun")
Description
            Distribution Functions toolbox

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.
 * 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 :

http://forge.scilab.org/index.php/p/distfun/
   
Features
--------

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-Square (with x=chi2)
 * Exponential (with x=exp)
 * F (with x=f)
 * Gamma (with x=gam)
 * Geometric (with x=geo)
 * Hypergeometric (with x=hyge)
 * LogNormal (with x=logn)
 * Normal (with x=norm)
 * Poisson (with x=poi)
 * T (with x=t)
 * Uniform (with x=unif)

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

Support
 * distfun_cov — Returns the empirical covariance matrix
 * distfun_erfcinv — Inverse erfc function
 * distfun_genericpdf — Compute the PDF from the CDF.
 * distfun_getpath — Returns path of current module
 * distfun_inthisto — Discrete histogram
 * distfun_plotintcdf -  Plots an integer CDF

Random Number Generator
 * rng_overview — An overview of the Random Number Generators of the Distfun
toolbox.
 * 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
generator
 * distfun_seedset — Set the current state of the current random number
generator
 * distfun_streamget — Get the current stream
 * distfun_streaminit — Initializes the current stream
 * distfun_streamset — Set the current stream            
Files (4)
[1.32 MB]
Source code archive

[1.56 MB]
Windows 32-bit binary for Scilab 5.4.x
Windows 32-bit
Automatically generated by the ATOMS compilation chain

[1.58 MB]
Windows 64-bit binary for Scilab 5.4.x
Windows 64-bit
Automatically generated by the ATOMS compilation chain

[1.18 MB]
MacOSX binary for Scilab 5.4.x
MacOSX version
Automatically generated by the ATOMS compilation chain

News (0)
Comments (4)     Leave a comment 
Comment from Michael Baudin -- December 1, 2012, 09:12:39 PM    
Here is the changelog for this version. 
This includes major changes and a large number of bug fixes.

distfun (0.5)
    * Added Binomial Distribution.
    * Added Poisson Distribution.
    * Added Chi-Square Distribution.
    * Added Hypergeometric Distribution.
    * Fixed two accuracy bugs in distfun_invcdfbin.
      The first bug happened for small values of S.
      The second bug happened for small values of Xn.
      See http://bugzilla.scilab.org/show_bug.cgi?id=11366
    * Fixed accuracy issue in distfun_geocdf when pr is small.
      See http://forge.scilab.org/index.php/p/distfun/issues/774/
    * Fixed accuracy issue in distfun_expinv when p is small.
      See http://forge.scilab.org/index.php/p/distfun/issues/780/
    * Fixed accuracy bug in distfun_expcdf when x is small.
      See http://forge.scilab.org/index.php/p/distfun/issues/781/
    * Added a tutorial.
    * Added distfun_plotintcdf to plot discrete CDF.
      Updated the examples in all discrete CDF examples: 
      geometric, poisson, hypergeometric, binomial.
    * Checked that the x argument in distfun_betapdf is in [0,1].
      It is now consistent with the behavior of distfun_betacdf.
    * Fixed a typo in the example of distfun_binostat.
    * Fixed a typo in the example of distfun_geornd.
    * Fixed a bug in distfun_poissinv (arguments expansion).
    * Fixed distfun_hygernd to invert the CDF.
    * Fixed bug #870
      distfun_hygecdf was too slow
      Implemented with a C-based source code.
      http://bugzilla.scilab.org/show_bug.cgi?id=870
    * Fixed bug #778
      The Quick start of distfun was empty.
      http://forge.scilab.org/index.php/p/distfun/issues/778/
    * Fixed bug #874
      distfun_geoinv failed at p=1
      http://bugzilla.scilab.org/show_bug.cgi?id=874
    * Fixed bug #871
      distfun_hygeinv was too slow
      Implemented with a C-based source code.
      http://bugzilla.scilab.org/show_bug.cgi?id=871
    * Fixed bug #876
      The help page of distfun_hygepdf was wrong.
      http://bugzilla.scilab.org/show_bug.cgi?id=876
    * Fixed bug #882
      distfun_hygeinv was slow when M is large.
      http://forge.scilab.org/index.php/p/distfun/issues/882/
    * Fixed bug #875
      distfun_hygeinv produced a large value of x
      http://forge.scilab.org/index.php/p/distfun/issues/875/
    * Fixed distfun_hygepdf to make it compute zero 
      when x<N-M+k.
    * Fixed bug #883
      distfun_hygecdf was slow when M is large.
      http://forge.scilab.org/index.php/p/distfun/issues/883/
    * Fixed bug #889
      distfun_chi2cdf was not accurate in the upper tail
      http://forge.scilab.org/index.php/p/distfun/issues/889/
    * Fixed bug #881
      distfun_plotintcdf was too slow
      http://forge.scilab.org/index.php/p/distfun/issues/881/
    * Fixed bug #880
      distfun_exppdf did not check that x>=0.
      http://forge.scilab.org/index.php/p/distfun/issues/880/
    * Fixed bug #891
      distfun_hygeinv failed for p=1
      http://forge.scilab.org/index.php/p/distfun/issues/891/
    * Fixed bug #873: 
      The tests for cdf functions were obsolete.
      They now use the assert functions and tables of values.
      http://forge.scilab.org/index.php/p/distfun/issues/873/
    * Fixed bug #900
      distfun_binopdf was wrong for small pr and large N.
      http://forge.scilab.org/index.php/p/distfun/issues/900
    * Fixed bug #918
      distfun_chi2pdf can produce a NaN.
      distfun_gampdf could also produce a NaN.
      http://forge.scilab.org/index.php/p/distfun/issues/918/
    * Fixed bug #913
      distfun_unifrnd could produce a zero
      Now all uniform generators are forced to generate 
      numbers in (0,1).
      http://bugzilla.scilab.org/show_bug.cgi?id=913
    * Fixed bug #912
      distfun_seedset did not accept vectors.
      http://bugzilla.scilab.org/show_bug.cgi?id=912
    * Fixed bug #897
      distfun_fpdf can produce a Nan
      http://forge.scilab.org/index.php/p/distfun/issues/897/
    * Fixed bug #831
      distfun_invcdpoi failed with small values of p
      http://forge.scilab.org/index.php/p/distfun/issues/831/
    * Fixed bug #926
      distfun_poissinv failed for p=1.
      http://forge.scilab.org/index.php/p/distfun/issues/926/
    * Fixed bug #779
      distfun_norminv failed when p = 1.
      http://forge.scilab.org/index.php/p/distfun/issues/779/
    * Fixed bug #777
      distfun_gaminv failed with p=1
      http://forge.scilab.org/index.php/p/distfun/issues/777/
    * Fixed bug #776
      distfun_expinv failed with p=1
      http://forge.scilab.org/index.php/p/distfun/issues/776/
    * Fixed bug #896
      invcdfbet produced weird result for extreme x
      http://forge.scilab.org/index.php/p/distfun/issues/896/
    * Fixed bug #932
      The urng gateway did not use the API.
      http://forge.scilab.org/index.php/p/distfun/issues/932/
    * Ported the tests on Scilab 5.4.0.
    * Created distfun_inthisto to plot integer histograms.
    * Fixed accuracy bug for the upper tail of distfun_poisscdf.
    * Added F Distribution.
    * Removed optional mu and sigma in Normal distribution:
      mu and sigma are now mandatory in 
      distfun_normpdf, distfun_normcdf, distfun_norminv.
      Backward compatibility lost.
    * Removed optional mu and sigma in Log-Normal distribution:
      mu and sigma are now mandatory in
      distfun_lognpdf, distfun_logncdf, distfun_logninv.
      Backward compatibility lost.
    * Fixed bug in distfun_binoinv, in the lower tail of the 
      distribution : call to floor is now replaced with a call to 
      ceil, which shifts the integers by +1.
    * Removed optional a and b in Uniform distribution:
      a and b are now mandatory in
      distfun_unifpdf, distfun_unifcdf, distfun_unifinv.
      Backward compatibility lost.
    * Added C-based implementation of the PDF of : 
      normal, chi-square, geometric, uniform.
    * Fixed bug #950.
      distfun_gaminv could go into an infinite loop.
    * Fixed bug #951.
      distfun_normcdf failed for x=+/-Inf.
    * Fixed bug #953.
      distfun_chi2inv fails for q=0.
      distfun_chi2inv fails for small p.
    * Fixed bug #958.
      distfun_binopdf could fail for non-integer input arguments.
    * Updated binomial distribution functions (distfun_binopdf, distfun_binocdf and 
      distfun_binoinv) to manage large values (greater than 2^32).
    * Fixed bug #960.
      distfun_poisspdf could fail for non-integer, extreme input arguments.
    * Fixed bug #962
      distfun_hygepdf failed for large inputs.
    * Updated hypergeometric distribution functions 
      (distfun_hygepdf, distfun_hygecdf and distfun_hygeinv) to 
      manage large values (greater than 2^32).
    * Updated distfun_poisspdf to manage large arguments.
    * Fixed bug #971
      distfun_betarnd failed for small inputs
    * Fixed bug #976
      distfun_frnd failed for extreme inputs
Comment from Michael Baudin -- December 16, 2012, 03:21:47 PM    
The Mac binaries are not available, as the compilation seems to fail. 
Comment from Michael Baudin -- December 17, 2012, 10:37:44 PM    
The Linux unit tests seem to produce too many failures (both in 32 and 64 bits): I disable

the download, until I can find a bugfix.
Comment from Michael Baudin -- January 11, 2013, 12:52:13 PM    
This release had bugs on Linux. This is fixed in the v0.6.
Leave a comment
You must register and log in before leaving a comment.
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.