Learn R Programming

bbricks (version 0.1.1)

rGaussian: Random generation for Gaussian distribution

Description

Generate random samples from a Gaussian distribution.

Usage

rGaussian(n, mu, Sigma = NULL, A = NULL)

Arguments

n

integer, number of samples.

mu

numeric, mean vector.

Sigma

matrix, covariance matrix, one of Sigma and A should be non-NULL.

A

matrix, the Cholesky decomposition of Sigma, an upper triangular matrix, one of Sigma and A should be non-NULL.

Value

A matrix of n rows and length(mu) columns.

See Also

dGaussian

Examples

Run this code
# NOT RUN {
x <- rGaussian(1000,mu = c(1,1),Sigma = matrix(c(1,0.5,0.5,3),2,2))
plot(x)
# }

Run the code above in your browser using DataLab