Rev 3265 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
20 | reyssat | 1 | !if $wims_read_parm!=slib_header |
2 | !goto proc |
||
3 | !endif |
||
4 | slib_title=Cumulative distribution function of Gamma law |
||
5 | slib_parms=3\ |
||
6 | ,[data]\ |
||
7 | ,a\ |
||
8 | ,b |
||
9 | |||
10 | slib_author=Bernadette PERRIN-RIOU |
||
11 | slib_out=values of cumulative distribution function of Gamma law on data |
||
12 | slib_comment=data can be a list of reals in brackets; density is b*exp(-b*x)*(b*x)^(a-1)/gamma(a) for x>=0 |
||
13 | slib_example=[0.2,0.4,7],4,5 |
||
14 | !exit |
||
15 | |||
16 | :proc |
||
17 | slib_out= |
||
18 | |||
19 | !distribute item $wims_read_parm into slib_data,slib_a, slib_b |
||
20 | slib_data=!declosing $slib_data |
||
21 | slib_n=!itemcnt $slib_data |
||
22 | |||
23 | slib_out=!exec pari slib_u=gamma($slib_a); V=vector($slib_n,x,1-incgam($slib_a ,$slib_b*[$slib_data][x],slib_u)/slib_u);\ |
||
24 | for(slib_r =1, $slib_n, if ( [$slib_data][slib_r] <= 0, V[slib_r]=0)); V |
||
25 | |||
26 | slib_out=!trim $slib_out |
||
27 |