Learn R Programming

bivariate (version 0.7.0)

15_PD_normal: Normal Distributions

Description

Bivariate and trivariate normal distributions.

Usage

#normal bivariate (PDF and CDF), sd/cor
nbvpdf (mean.X=0, mean.Y=0, sd.X=1, sd.Y=1, cor=0)
nbvcdf (mean.X=0, mean.Y=0, sd.X=1, sd.Y=1, cor=0)

#normal bivariate (PDF and CDF), var/cov nbvpdf.2 (mean.X=0, mean.Y=0, var.X=1, var.Y=1, cov=0) nbvcdf.2 (mean.X=0, mean.Y=0, var.X=1, var.Y=1, cov=0)

#normal trivariate (PDF only) ntvpdf (mean.X=0, mean.Y=0, mean.Z=0, sd.X=1, sd.Y=1, sd.Z=1, cor.XY=0, cor.XZ=0, cor.YZ=0) ntvpdf.2 (mean.X=0, mean.Y=0, mean.Z=0, var.X=1, var.Y=1, var.Z=1, cov.XY=0, cov.XZ=0, cov.YZ=0)

Arguments

mean.X, mean.Y, mean.Z

Numeric values, giving the means of X, Y and Z.

sd.X, sd.Y, sd.Z

Positive numeric values, giving the standard deviations of X, Y and Z.

var.X, var.Y, var.Z

Positive numeric values, giving the variances of X, Y and Z.

cor

Numeric value, giving the correlation between X and Y.

cov

Numeric value, giving the covariance between X and Y.

cor.XY, cor.XZ, cor.YZ

Numeric values, giving the pairwise correlations between X, Y and Z.

cov.XY, cov.XZ, cov.YZ

Numeric values, giving the pairwise covariances between X, Y and Z.

Value

Self-referencing S4-based function objects.

Refer to Function Objects.

Details

Note that the resulting covariance matrix needs to be a positive definite matrix. Also, in the bivariate case, both sd/variance parameters need to be positive, and the absolute correlation needs to be less than one.

Note that the misc3d package needs to be installed and loaded, in order to plot the trivariate normal distribution.

References

Refer to the vignette for an overview, references, theoretical background and better examples.

See Also

Uniform For uniform distributions.

Binomial, Poisson and Categorical For other probability distributions of discrete random variables.

Bimodal, Dirichlet and Nonparametric For other probability distributions of continuous random variables.

Main Plotting Functions

Random Numbers For bivariate and trivariate normal random numbers.

Density Matrices

Examples

Run this code
# NOT RUN {
f <- nbvpdf ()

plot (f)
f (0, 0)
# }

Run the code above in your browser using DataLab