Fwd: Accurate probability distribution functions (GSOC 2012)

michael.baudin at contrib.scilab.org michael.baudin at contrib.scilab.org
Mon Mar 26 15:54:10 CEST 2012


 The Inverse Beta is implemented here :

 http://forge.scilab.org/index.php/p/distfun/source/tree/HEAD/macros/distfun_betainv.sci

 This is currently just a macro which calls cdfbet with consistent 
 arguments. One possible improvement is to refactor the function into a 
 proper C gateway, with much more flexibility that the current cdfbet 
 function. For example, betainv can take as arguments a 1-by-1 double "a" 
 parameter and a 5-by-6 matrix "b" parameter: in this case, the parameter 
 "a" is expanded into a 5-by-6 matrix. The current cdfbet function cannot 
 do this.

 It is a good thing that you are interested in the Geometric 
 distribution, since it is not currently implemented. As an exercise, 
 please create a geopdf function on the model of the Matlab function :

 http://www.mathworks.fr/help/toolbox/stats/geopdf.html

 Once done, please send your script to us. Please do not spend more that 
 a few hours on it. A script with comments is unnecessary at this point: 
 just focus on the Scilab code. More that 100 lines would be very 
 surprising.

 When you are done, please pause on the research phase and fill-in your 
 application form. We are currently in the early stages of the selection 
 process: you will have plenty of time if you get selected.

 Best regards,

 Michaël Baudin



 On Mon, 26 Mar 2012 03:36:09 +0530, prateek papriwal 
 <papriwalprateek at gmail.com> wrote:
> Where is the inverse CDF's implemented (Beta inverse cdf,normal
> inverse cdf etc. as menationed in [1]) . The list of functions(given
> at link [2]) under sub heading Statistics does not have these
> functions . Also i looked upon the functions there can be a lot more
> can be implemented . Matlab has huge number of functions .
>
> One of such functions as Geometric CDF , i have planned for how to go
> about implenting it. Geometric CDF is the probability distribution of
> the number of bernoulli trials to get one success.
>
> Calling Sequence
>
> [P,Q] = cdfgeo("PQ",Xn,Pr,Ompr)
>
> Arguments
> P,Q,Xn,PR,Ompr
>    5 real vecors of the same size
>
> P,Q(Q=1-P)
>    The cumulation from 0 to Xn of the geometric distribution.
>     (Probablility of getting one(first) success in Xn trials or
> less than Xn. Probability of success is Pr . )  Input range: [0,1].
>
> Xn
> The number of max trials .We will be looking at the geometric
> distribution for 1 to Xn trials and then sum them up to get geocdf.
>
> Pr,Ompr
> The probability of getting success in each trial .
>
> In matlab it is implemented as
>
> geocdf(3,0.5) where 3 is our Xn and Pr=Ompr=0.5
>
> Hence now geocdf will be = (0.5^0)(0.5) + ((0.5)^1)(0.5) +
> ((0.5)^2)(0.5) = 0.5 + 0.25 + 0.125 
>  Explanation of 3rd term -- to get first success, i used 3 trials(Xn)
> , therefore got failure in first two trials and success in the 3rd
> trial .
> Explanation of 2nd Term -- to get first success , i used 2 trials
> (less than Xn) , therefore got failure in first trial and success in
> 2nd one...
>  Explanation of 1st Term  --  i got success in first trial only ...
>
> Note -- Xn is the total number of max trials. For determining cdf we
> will be using fewer number tan Xn also and adding all them up ..
>
> [1] http://forge.scilab.org/index.php/p/distfun/ [1]
> [2] http://help.scilab.org/docs/5.4.0-alpha-1/en_US/index.html [2]
>
> On Sat, Mar 24, 2012 at 9:50 PM, Sylvestre Ledru  wrote:
>  thanks for the forward, just don't forget me the next time ;)
>
>  Le samedi 24 mars 2012 à 17:19 +0530, prateek papriwal a écrit :
>
>>
>  >
>  > ---------- Forwarded message ----------
>  > From: prateek papriwal
>  > Date: Sat, Mar 24, 2012 at 4:47 PM
>  > Subject: Re: Accurate probability distribution functions (GSOC
> 2012)
>  > To: michael.baudin at contrib.scilab.org [5]
>  >
>  >
>  > ok .
>  >
>  > yes . its true there are much more functions in matlab.
>  > PLUS more function such as
>  > binmial,geometric,hypergeometric,poisson,chebyshev's inequality,
>  > markov's inequality, MGF of random variable , chi- square,
> bernoulli
>  > etc.
>  >
>  > Yes implementing these functions in scilab would be a good idea to
>  > work upon .
>  >
>  >
>  > On Sat, Mar 24, 2012 at 4:27 PM,
>  > wrote:
>  >         I think that you looked at it too quickly.
>  >         There is, by far, not all the required functions.
>  >         To see this more quickly, compare with :
>  >
>  >        
> http://www.mathworks.fr/help/toolbox/stats/bq_w_hm.html#bq_w_ie-8 [7]
>  >
>  >         There is only ~5% of the distributions in Matlab.
>  >         At least 30-40 more functions are necessary to make a
> complete
>  >         distribution toolbox:
>  >         just look at the "TODO" section in the readme.
>  >
>  >         As far as I am concerned, I have no interest in Queuing
>  >         theory.
>  >
>  >         Regards,
>  >
>  >         Michaël
>  >
>  >
>  >
>  >         On Mon, 19 Mar 2012 18:05:25 +0530, prateek papriwal
>  >          wrote:
>  >
>  >                 @michael, thank you for ur reply .
>  >
>  >
>  >                
> http://forge.scilab.org/index.php/p/distfun/ [9] [1] .. i
>  >                 saw the
>  >
>  >                 features(functions) already implemented .
>  >                 i would like to have a view at the current
> state and
>  >                 would be very
>  >                 mjuch interested in implemeting concepts of
> Queueing
>  >                 theory .
>  >
>  >
>  >                 On Sun, Mar 18, 2012 at 7:24 AM, Sylvestre
> Ledru
>  >                  wrote:
>  >
>  >                  Le samedi 17 mars 2012 à 17:24 +0100,
>  >
>  >                 michael.baudin at contrib.scilab.org [10] [3]
>  >
>  >                  a écrit :
>  >
>  >
>  >                  >  Secondly, i now work at EDF R&D, and
> no more in
>  >                 the Scilab
>  >                  > Consortium.
>  >                  >  How i could be involved in the GSOC
> 2012 has to be
>  >                 clarified with
>  >                  > the
>  >                  >  Consortium.
>  >
>  >                  As long as I (or someone else in the
> consortium) am
>  >                 in the loop, I
>  >                 don't
>  >                  have any issues with that.
>  >
>  >                  S
>  >
>  >                  --
>  >                  -----------------------------
>  >                  Sylvestre Ledru
>  >                  Projects manager
>  >                  Community manager
>  >                  -----------------------------
>  >                  Scilab Enterprises
>  >
>  >                  http://www.scilab-enterprises.com/ [11]
> [4]
>  >                  http://www.scilab.org/ [12] [5]
>  >                  -----------------------------
>  >
>  >
>  >
>  >                 Links:
>  >                 ------
>  >                 [1]
> http://forge.scilab.org/index.php/p/distfun/ [13]
>  >                 [2]
> mailto:sylvestre.ledru at scilab-enterprises.com [14]
>  >                 [3]
> mailto:michael.baudin at contrib.scilab.org [15]
>  >                 [4] http://www.scilab-enterprises.com/ [16]
>  >                 [5] http://www.scilab.org/ [17]
>  >
>  >
>  >
>
>  --
>  -----------------------------
>  Sylvestre Ledru
>  Operation manager
>
> Community manager
>  -----------------------------
>  Scilab Enterprises
>  http://www.scilab-enterprises.com/ [18]
>  http://www.scilab.org/ [19]
>  -----------------------------
>
>
>
> Links:
> ------
> [1] http://forge.scilab.org/index.php/p/distfun/
> [2] http://help.scilab.org/docs/5.4.0-alpha-1/en_US/index.html
> [3] mailto:sylvestre.ledru at scilab-enterprises.com
> [4] mailto:papriwalprateek at gmail.com
> [5] mailto:michael.baudin at contrib.scilab.org
> [6] mailto:michael.baudin at contrib.scilab.org
> [7] http://www.mathworks.fr/help/toolbox/stats/bq_w_hm.html#bq_w_ie-8
> [8] mailto:papriwalprateek at gmail.com
> [9] http://forge.scilab.org/index.php/p/distfun/
> [10] mailto:michael.baudin at contrib.scilab.org
> [11] http://www.scilab-enterprises.com/
> [12] http://www.scilab.org/
> [13] http://forge.scilab.org/index.php/p/distfun/
> [14] mailto:sylvestre.ledru at scilab-enterprises.com
> [15] mailto:michael.baudin at contrib.scilab.org
> [16] http://www.scilab-enterprises.com/
> [17] http://www.scilab.org/
> [18] http://www.scilab-enterprises.com/
> [19] http://www.scilab.org/




More information about the users mailing list