time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

repl.txt (1304B)


      1 
      2 {{alias}}( t, p )
      3     Evaluates the moment-generating function (MGF) for a geometric
      4     distribution with success probability `p` at a value `t`.
      5 
      6     If provided `NaN` as any argument, the function returns `NaN`.
      7 
      8     If `p < 0` or `p > 1`, the function returns `NaN`.
      9 
     10     If `t >= -ln(1-p)`, the function returns `NaN`.
     11 
     12     Parameters
     13     ----------
     14     t: number
     15         Input value.
     16 
     17     p: number
     18         Success probability.
     19 
     20     Returns
     21     -------
     22     out: number
     23         Evaluated MGF.
     24 
     25     Examples
     26     --------
     27     > var y = {{alias}}( 0.2, 0.5 )
     28     ~1.569
     29     > y = {{alias}}( 0.4, 0.5 )
     30     ~2.936
     31     // Case: t >= -ln(1-p)
     32     > y = {{alias}}( 0.8, 0.5 )
     33     NaN
     34     > y = {{alias}}( NaN, 0.0 )
     35     NaN
     36     > y = {{alias}}( 0.0, NaN )
     37     NaN
     38     > y = {{alias}}( -2.0, -1.0 )
     39     NaN
     40     > y = {{alias}}( 0.2, 2.0 )
     41     NaN
     42 
     43 
     44 {{alias}}.factory( p )
     45     Returns a function for evaluating the moment-generating function (MGF) of a
     46     geometric distribution with success probability `p`.
     47 
     48     Parameters
     49     ----------
     50     p: number
     51         Success probability.
     52 
     53     Returns
     54     -------
     55     mgf: Function
     56         Moment-generating function (MGF).
     57 
     58     Examples
     59     --------
     60     > var mymgf = {{alias}}.factory( 0.8 );
     61     > var y = mymgf( -0.2 )
     62     ~0.783
     63 
     64     See Also
     65     --------
     66