123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- <html lang="en">
- <head>
- <title>rmath statistical functions - avram - a virtual machine code interpreter</title>
- <meta http-equiv="Content-Type" content="text/html">
- <meta name="description" content="avram - a virtual machine code interpreter">
- <meta name="generator" content="makeinfo 4.13">
- <link title="Top" rel="start" href="index.html#Top">
- <link rel="up" href="rmath.html#rmath" title="rmath">
- <link rel="prev" href="rmath.html#rmath" title="rmath">
- <link rel="next" href="rmath-miscellaneous-functions.html#rmath-miscellaneous-functions" title="rmath miscellaneous functions">
- <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
- <meta http-equiv="Content-Style-Type" content="text/css">
- <style type="text/css"><!--
- pre.display { font-family:inherit }
- pre.format { font-family:inherit }
- pre.smalldisplay { font-family:inherit; font-size:smaller }
- pre.smallformat { font-family:inherit; font-size:smaller }
- pre.smallexample { font-size:smaller }
- pre.smalllisp { font-size:smaller }
- span.sc { font-variant:small-caps }
- span.roman { font-family:serif; font-weight:normal; }
- span.sansserif { font-family:sans-serif; font-weight:normal; }
- --></style>
- </head>
- <body>
- <div class="node">
- <a name="rmath-statistical-functions"></a>
- <p>
- Next: <a rel="next" accesskey="n" href="rmath-miscellaneous-functions.html#rmath-miscellaneous-functions">rmath miscellaneous functions</a>,
- Previous: <a rel="previous" accesskey="p" href="rmath.html#rmath">rmath</a>,
- Up: <a rel="up" accesskey="u" href="rmath.html#rmath">rmath</a>
- <hr>
- </div>
- <h4 class="subsection">D.16.1 <code>rmath</code> statistical functions</h4>
- <p>Functions for evaluating random draws, density, cumulative probability
- and inverse cumulative probability are provided for some of the more
- frequently used probability distributions, which are chi-squared,
- non-central chi-squared, exponential, lognormal, normal, poisson,
- Student's t, and uniform.
- <p>Each distribution is known by an abbreviated name and specified by one
- <a name="index-distributions-806"></a><a name="index-probability-distributions-807"></a><a name="index-statistical-distributions-808"></a>or two real parameters as listed below. Names of distributions in this
- table form the stem of a library function name. The names of the
- parameters such as <var>mu</var> and <var>sigma</var> are not explicitly
- mentioned when invoking the functions, but are listed here for
- reference. The precise definitions of the distribution functions and
- interpretations of these parameters can be found in standard texts on
- probability and statistics.
- <pre class="example"> chisq <var>df</var>
- nchisq <var>df</var>, <var>lambda</var>
- exp <var>scale</var>
- lnorm <var>logmean</var>, <var>logsd</var>
- norm <var>mu</var>, <var>sigma</var>
- pois <var>lambda</var>
- t <var>n</var>
- unif <var>a</var>, <var>b</var>
- </pre>
- <p>The virtual code interface follows a naming convention similar to the
- native API, in that function names beginning with <code>r</code> represent
- random draws from a distribution, with the argument to the function
- being the parameters specifying the distribution. Functions in this
- first group return a random draw from a distribution described by a
- single real parameter.
- <ul>
- <li><code>rchisq</code>
- <li><code>rexp</code>
- <li><code>rpois</code>
- <li><code>rt</code>
- </ul>
- <p class="noindent">These next functions return random draws from distributions specified
- by a pair of parameters, <code>(</code><var>x</var><code>,</code><var>y</var><code>)</code>.
- <ul>
- <li><code>rnchisq</code>
- <li><code>rlnorm</code>
- <li><code>rnorm</code>
- <li><code>runif</code>
- </ul>
- <p>Functions whose names begin with <code>d</code> evaluate the probability
- density of a distribution at a given point. They require at least two
- real arguments, the first being the point whose probability density is
- sought, and the remaining ones being the parameters that specify the
- distribution. A boolean operand, which is <code>nil</code> for false and
- <code>(nil,nil)</code> for true, requests the logarithm of the density when
- true.
- <p>Functions with names in the following group take a triple with two
- real operands and a boolean, <code>(</code><var>x</var><code>,(</code><var>y</var><code>,</code><var>a</var><code>))</code>, and
- return a probabiity density.
- <ul>
- <li><code>dchisq</code>
- <li><code>dexp</code>
- <li><code>dpois</code>
- <li><code>dt</code>
- </ul>
- <p class="noindent">The next functions pertain to distributions requiring two paramters to
- specify them, so they take a quadruple with three real operands and a
- boolean, <code>(</code><var>x</var><code>,(</code><var>y</var><code>,(</code><var>z</var><code>,</code><var>a</var><code>)))</code>.
- <ul>
- <li><code>dnchisq</code>
- <li><code>dlnorm</code>
- <li><code>dnorm</code>
- <li><code>dunif</code>
- </ul>
- <p>Functions whose names begin with <code>p</code> or <code>q</code> obtain
- <a name="index-cumulative-probability-809"></a>cumulative probabilities or inverse cumulative probabilities
- respectively for a specified distribution. They require one real
- operand to identify the point whose probability or inverse probability
- is sought, and other real operands to parameterize the distribution,
- as above. There are also two boolean operands. The first is true in
- order to request a probability or inverse probability with respect to
- the lower tail as opposed to the upper, and the other is true to
- indicate that probabilities are to be expressed logarithmically.
- <p>The argument to these functions is a quadruple with two real operands
- and two booleans, <code>(</code><var>x</var><code>,(</code><var>y</var><code>,(</code><var>a</var><code>,</code><var>b</var><code>)))</code>.
- <ul>
- <li><code>pchisq</code>, <code>qchisq</code>
- <li><code>pexp</code>, <code>qexp</code>
- <li><code>ppois</code>, <code>qpois</code>
- <li><code>pt</code>, <code>qt</code>
- </ul>
- <p class="noindent">The remaining functions pertain to distributions parameterized by two
- real operands. These take a quintuple with three real operands and two
- booleans, <code>(</code><var>x</var><code>,(</code><var>y</var><code>,(</code><var>z</var><code>,(</code><var>a</var><code>,</code><var>b</var><code>))))</code>.
- <ul>
- <li><code>pnchisq</code>,
- <code>qnchisq</code>
- <li><code>plnorm</code>,
- <code>qlnorm</code>
- <li><code>pnorm</code>,
- <code>qnorm</code>
- <li><code>punif</code>,
- <code>qunif</code>
- </ul>
- </body></html>
|