Learn R Programming

sparr (version 0.2-2)

KBivN: Standard bivariate normal kernel

Description

Evaluates the standard bivariate normal (Gaussian) kernel function at specified values.

Usage

KBivN(X)

Arguments

X
A numeric vector of length 2 or a data frame with 2 columns.

Value

  • A single numeric value if X is a vector, or nrow(X) values if X is a data frame, giving the result of the standard bivariate normal kernel at the specified coordinate(s).

Details

If X is a vector of length 2, then the two components X[1] and X[2] are taken to be the x and y coordinates respectively. For multiple evaluations at differing coordinates, X must be a data frame with X[,1] and X[,2] as the corresponding pairs of x and y coordinates respectively.

Examples

Run this code
KBivN(c(0.1,0.4))

x <- y <- seq(-4,4,length=50)
z <- KBivN(data.frame(cbind(sort(rep(x,50)),rep(y,50))))
persp(x,y,matrix(z,50,50,byrow=TRUE),main="bivariate Gaussian kernel",
 phi=30,theta=-30)

Run the code above in your browser using DataLab