Rev 20 | Rev 4161 | Go to most recent revision | Details | Compare with Previous | 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 |
||
3265 | bpr | 14 | slib_require=pari |
20 | reyssat | 15 | !exit |
16 | |||
17 | :proc |
||
18 | slib_out= |
||
19 | |||
20 | !distribute item $wims_read_parm into slib_data,slib_a, slib_b |
||
21 | slib_data=!declosing $slib_data |
||
22 | slib_n=!itemcnt $slib_data |
||
23 | |||
24 | 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);\ |
||
25 | for(slib_r =1, $slib_n, if ( [$slib_data][slib_r] <= 0, V[slib_r]=0)); V |
||
26 | |||
27 | slib_out=!trim $slib_out |
||
28 |