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

📄 mvrnorm.html

📁 本程序是基于linux系统下c++代码
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><title>R: Simulate from a Multivariate Normal Distribution</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 mvrnorm {MASS}"><tr><td>mvrnorm {MASS}</td><td align="right">R Documentation</td></tr></table>
<h2>Simulate from a Multivariate Normal Distribution</h2>


<h3>Description</h3>

<p>
Produces one or more samples from the specified
multivariate normal distribution.
</p>


<h3>Usage</h3>

<pre>
mvrnorm(n = 1, mu, Sigma, tol = 1e-6, empirical = FALSE)
</pre>


<h3>Arguments</h3>

<table summary="R argblock">
<tr valign="top"><td><code>n</code></td>
<td>
the number of samples required.
</td></tr>
<tr valign="top"><td><code>mu</code></td>
<td>
a vector giving the means of the variables.
</td></tr>
<tr valign="top"><td><code>Sigma</code></td>
<td>
a positive-definite symmetric matrix specifying the covariance matrix
of the variables.
</td></tr>
<tr valign="top"><td><code>tol</code></td>
<td>
tolerance (relative to largest variance) for numerical lack of
positive-definiteness in <code>Sigma</code>.
</td></tr>
<tr valign="top"><td><code>empirical</code></td>
<td>
logical. If true, mu and Sigma specify the empirical not population
mean and covariance matrix.
</td></tr>
</table>

<h3>Details</h3>

<p>
The matrix decomposition is done via <code>eigen</code>; although a Choleski
decomposition might be faster, the eigendecomposition is
stabler.
</p>


<h3>Value</h3>

<p>
If <code>n = 1</code> a vector of the same length as <code>mu</code>, otherwise an
<code>n</code> by <code>length(mu)</code> matrix with one sample in each row.</p>

<h3>Side Effects</h3>

<p>
Causes creation of the dataset <code>.Random.seed</code> if it does
not already exist, otherwise its value is updated.
</p>


<h3>References</h3>

<p>
B. D. Ripley (1987)
<EM>Stochastic Simulation.</EM>
Wiley. Page 98.
</p>


<h3>See Also</h3>

<p>
<code><a href="../../stats/html/Normal.html">rnorm</a></code>
</p>


<h3>Examples</h3>

<pre>
Sigma &lt;- matrix(c(10,3,3,2),2,2)
Sigma
var(mvrnorm(n=1000, rep(0, 2), Sigma))
var(mvrnorm(n=1000, rep(0, 2), Sigma, empirical = TRUE))
</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 + -