Bivariate normal distribution
Density, distribution function and random generation for the bivariate normal distribution.
dbvnorm( x, y = NULL, mean1 = 0, mean2 = mean1, sd1 = 1, sd2 = sd1, cor = 0, log = FALSE ) rbvnorm(n, mean1 = 0, mean2 = mean1, sd1 = 1, sd2 = sd1, cor = 0)
x, y |
vectors of quantiles; alternatively x may be a two-column matrix (or data.frame) and y may be omitted. |
mean1, mean2 |
vectors of means. |
sd1, sd2 |
vectors of standard deviations. |
cor |
vector of correlations ( |
log |
logical; if TRUE, probabilities p are given as log(p). |
n |
number of observations. If |
Probability density function
f(x) = 1/(2*π*sqrt(1-ρ^2)*σ1*σ2) * exp(-(1/(2*(1-ρ^2)* (((x1-μ1)/σ1)^2 - 2*ρ*((x1-μ1)/σ2)*((x2-μ2)/σ2) * ((x2-μ2)/σ2)^2))))
Krishnamoorthy, K. (2006). Handbook of Statistical Distributions with Applications. Chapman & Hall/CRC
Mukhopadhyay, N. (2000). Probability and statistical inference. Chapman & Hall/CRC
y <- x <- seq(-4, 4, by = 0.25) z <- outer(x, y, function(x, y) dbvnorm(x, y, cor = -0.75)) persp(x, y, z) y <- x <- seq(-4, 4, by = 0.25) z <- outer(x, y, function(x, y) dbvnorm(x, y, cor = -0.25)) persp(x, y, z)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.