bvnorm.pdf: pdf of the Bivariate Normal Distribution

View source: R/NNCTFunctions.R

bvnorm.pdfR Documentation

pdf of the Bivariate Normal Distribution

Description

Computes the value of the probability density function (i.e. density) of the bivariate normal distribution at the specified point X, with mean mu and standard deviations of the first and second components being s_1 and s_2 (denoted as s1 and s2 in the arguments of the function, respectively) and correlation between them being rho (i.e., the covariance matrix is Σ=S where S_{11}=s_1^2, S_{22}=s_2^2, S_{12}=S_{21}=s_1 s_2 rho).

Usage

bvnorm.pdf(X, mu = c(0, 0), s1 = 1, s2 = 1, rho = 0)

Arguments

X

A set of 2D points of size n (i.e an n \times 2 matrix or array) at which the density of the bivariate normal distribution is to be computed.

mu

A 1 \times 2 vector of real numbers representing the mean of the bivariate normal distribution, default=(0,0).

s1, s2

The standard deviations of the first and second components of the bivariate normal distribution, with default is 1 for both

rho

The correlation between the first and second components of the bivariate normal distribution with default=0.

Value

The value of the probability density function (i.e. density) of the bivariate normal distribution at the specified point X, with mean mu and standard deviations of the first and second components being s_1 and s_2 and correlation between them being rho.

Author(s)

Elvan Ceyhan

See Also

mvrnorm

Examples

mu<-c(0,0)
s1<-1
s2<-1
rho<-.5

n<-5
Xp<-cbind(runif(n),runif(n))
bvnorm.pdf(Xp,mu,s1,s2,rho)

nnspat documentation built on Aug. 30, 2022, 9:06 a.m.