rbinormal: Sample from a bivariate Normal distribution

View source: R/demo1-GEN.R

rbinormalR Documentation

Sample from a bivariate Normal distribution

Description

Simulate x from the marginal f(x), then y from f(y|x), and the pair (x, y) has the desired joint distribution.

Usage

rbinormal(n, m1 = 0, m2 = 0, s1 = 1, s2 = 1, rho = 0)

Arguments

n

the desired sample size

m1, m2

the means of X and Y, respectively

s1, s2

the standard deviations of X and Y, respectively

rho

the correlation coefficient between X and Y

Value

A numeric matrix of two columns X and Y.


yihui/rlp documentation built on Feb. 28, 2023, 1:35 p.m.