time-to-botec

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

repl.txt (1634B)


      1 
      2 {{alias}}( t, k, λ )
      3     Evaluates the moment-generating function (MGF) for an Erlang distribution
      4     with shape parameter `k` and rate parameter `λ` at a value `t`.
      5 
      6     If provided `NaN` as any argument, the function returns `NaN`.
      7 
      8     If not provided a nonnegative integer for `k`, the function returns `NaN`.
      9 
     10     If provided a non-positive value for `λ`, the function returns `NaN`.
     11 
     12     Parameters
     13     ----------
     14     t: number
     15         Input value.
     16 
     17     k: number
     18         Shape parameter.
     19 
     20     λ: number
     21         Rate parameter.
     22 
     23     Returns
     24     -------
     25     out: number
     26         Evaluated MGF.
     27 
     28     Examples
     29     --------
     30     > var y = {{alias}}( 0.3, 1, 1.0 )
     31     ~1.429
     32     > y = {{alias}}( 2.0, 2, 3.0 )
     33     ~9.0
     34     > y = {{alias}}( -1.0, 2, 2.0 )
     35     ~0.444
     36 
     37     > y = {{alias}}( NaN, 1, 1.0 )
     38     NaN
     39     > y = {{alias}}( 0.0, NaN, 1.0 )
     40     NaN
     41     > y = {{alias}}( 0.0, 1, NaN )
     42     NaN
     43 
     44     > y = {{alias}}( 0.2, -2, 0.5 )
     45     NaN
     46     > y = {{alias}}( 0.2, 0.5, 0.5 )
     47     NaN
     48 
     49     > y = {{alias}}( 0.2, 1, 0.0 )
     50     NaN
     51     > y = {{alias}}( 0.2, 1, -5.0 )
     52     NaN
     53 
     54 
     55 {{alias}}.factory( k, λ )
     56     Returns a function for evaluating the moment-generating function (MGF) of an
     57     Erlang distribution with shape parameter `k` and rate parameter `λ`.
     58 
     59     Parameters
     60     ----------
     61     k: number
     62         Shape parameter.
     63 
     64     λ: number
     65         Rate parameter.
     66 
     67     Returns
     68     -------
     69     mgf: Function
     70         Moment-generating function (MGF).
     71 
     72     Examples
     73     --------
     74     > var myMGF = {{alias}}.factory( 2, 0.5 );
     75     > var y = myMGF( 0.2 )
     76     ~2.778
     77     > y = myMGF( -0.5 )
     78     0.25
     79 
     80     See Also
     81     --------
     82