⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rnegbin.html

📁 本程序是基于linux系统下c++代码
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Simulate Negative Binomial Variates</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../../R.css">
</head><body>

<table width="100%" summary="page for rnegbin {MASS}"><tr><td>rnegbin {MASS}</td><td align="right">R Documentation</td></tr></table>
<h2>Simulate Negative Binomial Variates</h2>


<h3>Description</h3>

<p>
Function to generate random outcomes from a Negative Binomial distribution,
with mean <code>mu</code> and variance <code>mu + mu^2/theta</code>.
</p>


<h3>Usage</h3>

<pre>
rnegbin(n, mu = n, theta = stop("'theta' must be specified"))
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>n</code></td>
<td>
If a scalar, the number of sample values required.  If a vector,
<code>length(n)</code> is the number required and <code>n</code> is used as the mean vector if
<code>mu</code> is not specified.
</td></tr>
<tr valign="top"><td><code>mu</code></td>
<td>
The vector of means.  Short vectors are recycled.
</td></tr>
<tr valign="top"><td><code>theta</code></td>
<td>
Vector of values of the <code>theta</code> parameter.  Short vectors are recycled.
</td></tr>
</table>

<h3>Details</h3>

<p>
The function uses the representation of the Negative Binomial distribution
as a continuous mixture of Poisson distributions with Gamma distributed means.
Unlike <code>rnbinom</code> the index can be arbitrary.
</p>


<h3>Value</h3>

<p>
Vector of random Negative Binomial variate values.</p>

<h3>Side Effects</h3>

<p>
Changes <code>.Random.seed</code> in the usual way.
</p>


<h3>Examples</h3>

<pre>
# Negative Binomials with means fitted(fm) and theta = 4.5
fm &lt;- glm.nb(Days ~ ., data = quine)
dummy &lt;- rnegbin(fitted(fm), theta = 4.5)
</pre>



<hr><div align="center">[Package <em>MASS</em> version 7.2-44 <a href="00Index.html">Index]</a></div>

</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -