| 1 | <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 | <title>randomGamma</title> |
| 3 | <style> |
| 4 | td { padding-left: 5pt; padding-right: 5pt; } |
| 5 | th { padding-left: 5pt; padding-right: 5pt; } |
| 6 | code { white-space: pre-wrap; } |
| 7 | dd { white-space: pre-wrap; } |
| 8 | </style> |
| 9 | </head><body bgcolor="#FFFFFF"> |
| 10 | |
| 11 | <table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Monaco,Courier" size=6 color="#999900"><b> |
| 12 | randomGamma |
| 13 | </b></font></table></table> |
| 14 | <p>A function that can be used in <a href="Formulas.html">Formulas</a>.</p> |
| 15 | <h2>Syntax and semantics</h2> |
| 16 | <dl> |
| 17 | <dt><b><code><font size=+1>randomGamma</font></code></b> (<i><code><font size=+1>shape</font></code></i>, <i><code><font size=+1>rate</font></code></i>) |
| 18 | <dd>generate a random number from a Gamma distribution with shape parameter <i><code><font size=+1>shape</font></code></i> and rate parameter <i><code><font size=+1>rate</font></code></i>, which is defined as the probability density function <i>f</i>(<i>x</i>; <i><code><font size=+1>shape</font></code></i>, <i><code><font size=+1>rate</font></code></i>) = (1 / Γ (<i><code><font size=+1>shape</font></code></i>)) <i><code><font size=+1>rate</font></code></i><sup><i><code><font size=+1>shape</font></code></i></sup> <i>x</i><sup><i><code><font size=+1>shape</font></code></i>−1</sup> <i>e</i><sup>−<i><code><font size=+1>rate</font></code></i> <i><code><font size=+1>x</font></code></i></sup>, for <i><code><font size=+1>x</font></code></i> > 0, <i><code><font size=+1>shape</font></code></i> > 0 and <i><code><font size=+1>rate</font></code></i> > 0, according to the method by <a href="Marsaglia___Tsang__2000_.html">Marsaglia & Tsang (2000)</a>.</dd> |
| 19 | </dl> |
| 20 | <h3>Links to this page</h3> |
| 21 | <ul> |
| 22 | <li><a href="_randomGamma-H-H_.html"><code><font size=+1>randomGamma##</font></code></a> |
| 23 | <li><a href="_randomGamma-H_.html"><code><font size=+1>randomGamma#</font></code></a> |
| 24 | <li><a href="Functions.html">Functions</a> |
| 25 | </ul> |
| 26 | <hr> |
| 27 | <address> |
| 28 | <p>© David Weenink 2019, Paul Boersma 2023</p> |
| 29 | </address> |
| 30 | </body> |
| 31 | </html> |