Bivariate and trivariate normal distributions.
#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)
Numeric values, giving the means of X, Y and Z.
Positive numeric values, giving the standard deviations of X, Y and Z.
Positive numeric values, giving the variances of X, Y and Z.
Numeric value, giving the correlation between X and Y.
Numeric value, giving the covariance between X and Y.
Numeric values, giving the pairwise correlations between X, Y and Z.
Numeric values, giving the pairwise covariances between X, Y and Z.
Self-referencing S4-based function objects.
Refer to Function Objects.
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.
Refer to the vignette for an overview, references, theoretical background and better examples.
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.
Random Numbers For bivariate and trivariate normal random numbers.
# NOT RUN {
f <- nbvpdf ()
plot (f)
f (0, 0)
# }
Run the code above in your browser using DataLab