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
(3199 downloads for this version - 66040 downloads for all versions)
Details
Version
0.4
A more recent valid version exists: 1.1.1
Authors
Michael Baudin
Prateek Papriwal
Owner Organization
INRIA and others
Maintainers
Prateek Papriwal
Michael Baudin
License
Dependencies
Creation Date
June 18, 2012
Source created on
Scilab 5.3.x
Binaries available on
Scilab 5.3.x:
Linux 32-bit Windows 32-bit Windows 64-bit MacOSX Linux 64-bit
Install command
--> atomsInstall("distfun")
Description
            Distribution Functions toolbox

Purpose
-------

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). 

The differences with Scilab is that a consistent set of 
functions is provided. 
First, Scilab currently does not provide the PDFs. 
Users may write their own functions: this is not as easy as it 
seems, and may lead to very innaccurate results if floating point 
issues are ignored. 
Secondly, Scilab does not provide a consistent sets of functions: 
the CDF and the random number generators are provided in two 
different toolboxes, with no consistency. 

The difference with Stixbox is that the current function are 
tested, as accurate as we could, with consistent help pages.
   
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)
 * Exponential (with x=exp)
 * Gamma (with x=gam)
 * Geometric (with x=geo)
 * LogNormal (with x=logn)
 * Normal (with x=norm)
 * Uniform (with x=unif)

Support
 * distfun_erfcinv : Inverse erfc function
 * distfun_getpath : Returns path of current module
 

Random Number Generator
 * 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 substream
 * distfun_streamset : Set the current stream            
Files (6)
[4.75 MB]
Linux 32-bit binary for Scilab 5.3.x
Linux 32-bit
Automatically generated by the ATOMS compilation chain

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

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

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

[4.77 MB]
Linux 64-bit binary for Scilab 5.3.x
Linux 64-bit
Automatically generated by the ATOMS compilation chain

[902.60 kB]
Source code archive

News (0)
Comments (2)     Leave a comment 
Comment from Michael Baudin -- June 21, 2012, 07:40:22 PM    
Here is the changelog of the v0.4.

distfun (0.4)
    * Fixed compilation and loading of the toolbox on Linux.
      See http://bugzilla.scilab.org/show_bug.cgi?id=11127
      Cleanup of the code generated by f2c.
      Fixed includes in src/genrand.
      Removed use of C2F in src/cdflib.
      Cleanup of the code generated by f2c.
    * Added the Geometric distribution.
    * Added Excel benchmark in the demos.
Comment from Michael Baudin -- June 21, 2012, 07:45:52 PM    
Hi,

Here is a test on Windows 7 32 bit with Scilab 5.3.3.
The distfun_grandmn unit test does not pass, because of a minor testing problem (this is 
not a bug in the function, this was a bug in the test). 

There is globally no known problem, except the accuracy of the inverse beta on Linux (but 
not on Windows). 
This is the bug http://forge.scilab.org/index.php/p/distfun/issues/760/

Regards,

Michaël

-->atomsInstall("distfun")
	distfun (0.4-1) will be installed in the 'user' section
	Installing distfun (0.4-1) ... success
 ans  =

!distfun  0.4-1  user  SCIHOME\atoms\distfun\0.4-1  I  !

-->atomsLoad("distfun")

Start Distfun
	Load macros
	Load gateways
	Load help
	Load demos
	Type "demo_gui()" and search for Distfun for Demonstrations.

 ans  =

!distfun  0.4-1  user  SCIHOME\atoms\distfun\0.4-1  !

-->atomsTest("distfun")
   TMPDIR = C:\Users\bla\AppData\Local\Temp\SCI_TMP_7968_

   001/078 - [SCIHOME\atoms\distfun\0.4-1] erfcinv.................passed
   002/078 - [SCIHOME\atoms\distfun\0.4-1|beta] betacdf............passed
   003/078 - [SCIHOME\atoms\distfun\0.4-1|beta] betainv............passed
   004/078 - [SCIHOME\atoms\distfun\0.4-1|beta] betapdf............passed
   005/078 - [SCIHOME\atoms\distfun\0.4-1|beta] betarnd............passed
   006/078 - [SCIHOME\atoms\distfun\0.4-1|beta] betastat...........passed
   007/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdfbet..............passed
   008/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdfbin..............passed
   009/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdfchi..............passed
   010/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdfchn..............passed
   011/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdff................passed
   012/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdffnc..............passed
   013/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdfgam..............passed
   014/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdfnbn..............passed
   015/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdfnor..............passed
   016/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdfpoi..............passed
   017/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] cdft................passed
   018/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdfbet...........passed
   019/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdfbin...........passed
   020/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdfchi...........passed
   021/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdfchn...........passed
   022/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdff.............passed
   023/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdffnc...........passed
   024/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdfgam...........passed
   025/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdfnbn...........passed
   026/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdfnor...........passed
   027/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdfpoi...........passed
   028/078 - [SCIHOME\atoms\distfun\0.4-1|cdf] invcdft.............passed
   029/078 - [SCIHOME\atoms\distfun\0.4-1|exponential] expcdf......passed
   030/078 - [SCIHOME\atoms\distfun\0.4-1|exponential] expinv......passed
   031/078 - [SCIHOME\atoms\distfun\0.4-1|exponential] exppdf......passed
   032/078 - [SCIHOME\atoms\distfun\0.4-1|exponential] exprnd......passed
   033/078 - [SCIHOME\atoms\distfun\0.4-1|exponential] expstat.....passed
   034/078 - [SCIHOME\atoms\distfun\0.4-1|gamma] gamcdf............passed
   035/078 - [SCIHOME\atoms\distfun\0.4-1|gamma] gaminv............passed
   036/078 - [SCIHOME\atoms\distfun\0.4-1|gamma] gampdf............passed
   037/078 - [SCIHOME\atoms\distfun\0.4-1|gamma] gamrnd............passed
   038/078 - [SCIHOME\atoms\distfun\0.4-1|gamma] gamstat...........passed
   039/078 - [SCIHOME\atoms\distfun\0.4-1|geometric] geocdf........passed
   040/078 - [SCIHOME\atoms\distfun\0.4-1|geometric] geoinv........passed
   041/078 - [SCIHOME\atoms\distfun\0.4-1|geometric] geopdf........passed
   042/078 - [SCIHOME\atoms\distfun\0.4-1|geometric] geornd........passed
   043/078 - [SCIHOME\atoms\distfun\0.4-1|geometric] geostat.......passed
   044/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandbet..passed
   045/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandbin..passed
   046/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandchi..passed
   047/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandexp..passed
   048/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandf....passed
   049/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandgam..passed
   050/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandgeom.passed
   051/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandmn...failed  : premature end

of the test script
   052/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandnbn..passed
   053/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandnch..passed
   054/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandnf...passed
   055/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandnor..passed
   056/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandpoi..passed
   057/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandprm..passed
   058/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_granduin..passed
   059/078 - [SCIHOME\atoms\distfun\0.4-1|grand] distfun_grandunf..passed
   060/078 - [SCIHOME\atoms\distfun\0.4-1|grand] grand_plot........passed
   061/078 - [SCIHOME\atoms\distfun\0.4-1|lognormal] logncdf.......passed
   062/078 - [SCIHOME\atoms\distfun\0.4-1|lognormal] logninv.......passed
   063/078 - [SCIHOME\atoms\distfun\0.4-1|lognormal] lognpdf.......passed
   064/078 - [SCIHOME\atoms\distfun\0.4-1|lognormal] lognrnd.......passed
   065/078 - [SCIHOME\atoms\distfun\0.4-1|lognormal] lognstat......passed
   066/078 - [SCIHOME\atoms\distfun\0.4-1|normal] normcdf..........passed
   067/078 - [SCIHOME\atoms\distfun\0.4-1|normal] norminv..........passed
   068/078 - [SCIHOME\atoms\distfun\0.4-1|normal] normpdf..........passed
   069/078 - [SCIHOME\atoms\distfun\0.4-1|normal] normrnd..........passed
   070/078 - [SCIHOME\atoms\distfun\0.4-1|normal] normstat.........passed
   071/078 - [SCIHOME\atoms\distfun\0.4-1|uniform] unifcdf.........passed
   072/078 - [SCIHOME\atoms\distfun\0.4-1|uniform] unifinv.........passed
   073/078 - [SCIHOME\atoms\distfun\0.4-1|uniform] unifpdf.........passed
   074/078 - [SCIHOME\atoms\distfun\0.4-1|uniform] unifrnd.........passed
   075/078 - [SCIHOME\atoms\distfun\0.4-1|uniform] unifstat........passed
   076/078 - [SCIHOME\atoms\distfun\0.4-1|urng] distfun_generators.passed
   077/078 - [SCIHOME\atoms\distfun\0.4-1|urng] distfun_stream.....passed
   078/078 - [SCIHOME\atoms\distfun\0.4-1] bug_9976................passed
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.