EVOLUTION-MANAGER
Edit File: Discrete.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Discrete Distribution</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for Discrete {e1071}"><tr><td>Discrete {e1071}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Discrete Distribution</h2> <h3>Description</h3> <p>These functions provide information about the discrete distribution where the probability of the elements of <code>values</code> is proportional to the values given in <code>probs</code>, which are normalized to sum up to 1. <code>ddiscrete</code> gives the density, <code>pdiscrete</code> gives the distribution function, <code>qdiscrete</code> gives the quantile function and <code>rdiscrete</code> generates random deviates. </p> <h3>Usage</h3> <pre> ddiscrete(x, probs, values = 1:length(probs)) pdiscrete(q, probs, values = 1:length(probs)) qdiscrete(p, probs, values = 1:length(probs)) rdiscrete(n, probs, values = 1:length(probs), ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>x,q</code></td> <td> <p>vector or array of quantiles.</p> </td></tr> <tr valign="top"><td><code>p</code></td> <td> <p>vector or array of probabilities.</p> </td></tr> <tr valign="top"><td><code>n</code></td> <td> <p>number of observations.</p> </td></tr> <tr valign="top"><td><code>probs</code></td> <td> <p>probabilities of the distribution.</p> </td></tr> <tr valign="top"><td><code>values</code></td> <td> <p>values of the distribution.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>ignored (only there for backwards compatibility)</p> </td></tr> </table> <h3>Details</h3> <p>The random number generator is simply a wrapper for <code><a href="../../base/html/sample.html">sample</a></code> and provided for backwards compatibility only. </p> <h3>Author(s)</h3> <p>Andreas Weingessel and Friedrich Leisch</p> <h3>Examples</h3> <pre> ## a vector of length 30 whose elements are 1 with probability 0.2 ## and 2 with probability 0.8. rdiscrete (30, c(0.2, 0.8)) ## a vector of length 100 whose elements are A, B, C, D. ## The probabilities of the four values have the relation 1:2:3:3 rdiscrete (100, c(1,2,3,3), c("A","B","C","D")) </pre> <hr /><div style="text-align: center;">[Package <em>e1071</em> version 1.7-3 <a href="00Index.html">Index</a>]</div> </body></html>