rbivnorm {AoE}R Documentation

Random Number Generation for the Bivariate Normal Distribution

Description

Generates a random sample of the bivariate Normal distribution with given means, variances, and correlation.

Usage

rbivnorm(n, mean.x = 0, sd.x = 1, mean.y = 0, sd.y = 1, cor = 0)

Arguments

n Sample size.
mean.x, mean.y Means of the two components. Default value is 0.
sd.x, sd.y Standard deviations of the two components. Should be positive. Default value is 1.
cor Linear correlation between the two components. Should be between -1 and 1. Default value is 0.

Value

An n-by-2 matrix containing the generated data.

Examples

# Even for high correlation, 
# the bivariate normal distribution has 
# asymptotic independence in the tails:
x <- rbivnorm(10000, cor = 0.9)
plot(x[,1], x[,2])
plot(rank(x[,1]), rank(x[,2]))

[Package AoE version 1.0.1 Index]