dbvnorm: The Bivariate Normal Distribution

Description Usage Arguments Examples

View source: R/basic.R

Description

The Bivariate Normal Distribution

Usage

1
dbvnorm(x, mean = c(0, 0), sd = c(1, 1), rho = 0)

Arguments

x

a 2-dimensional vector or a 2 by n matrix

mean

a mean vector

sd

a standard deviation vector

rho

correlation coefficient

Examples

1
2
3
4
5
x <- seq(-3,3,length.out=50)
y <- seq(-3,3,length.out=50)
z <- outer(x, y, function(x, y) dbvnorm(cbind(x, y), rho=0.5))
persp(x,y,z,theta=5,phi=20,col="lightblue", expand=0.5, zlab="density")
contour(x,y,z, xlab="x", ylab="y")

ssustat/regbook documentation built on July 7, 2020, 12:16 a.m.