Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dist.Normal.Wishart

Normal-Wishart Distribution


Description

These functions provide the density and random number generation for the normal-Wishart distribution.

Usage

dnormwishart(mu, mu0, lambda, Omega, S, nu, log=FALSE) 
rnormwishart(n=1, mu0, lambda, S, nu)

Arguments

mu

This is data or parameters in the form of a vector of length k or a matrix with k columns.

mu0

This is mean vector mu[0] with length k or matrix with k columns.

lambda

This is a positive-only scalar.

n

This is the number of random draws.

nu

This is the scalar degrees of freedom nu.

Omega

This is a k x k precision matrix Omega.

S

This is the symmetric, positive-semidefinite, k x k scale matrix S.

log

Logical. If log=TRUE, then the logarithm of the density is returned.

Details

  • Application: Continuous Multivariate

  • Density: p(mu, Omega) = N(mu | mu[0], (lambda Omega)^(-1)) W(Omega | nu, S)

  • Inventors: Unknown

  • Notation 1: (mu, Omega) ~ NW(mu[0], lambda, S, nu)

  • Notation 2: p(mu, Omega) = NW(mu, Omega | mu[0], lambda, S, nu)

  • Parameter 1: location vector mu[0]

  • Parameter 2: lambda > 0

  • Parameter 3: symmetric, positive-semidefinite k x k scale matrix S

  • Parameter 4: degrees of freedom nu >= k

  • Mean: Unknown

  • Variance: Unknown

  • Mode: Unknown

The normal-Wishart distribution, or Gaussian-Wishart distribution, is a multivariate four-parameter continuous probability distribution. It is the conjugate prior of a multivariate normal distribution with unknown mean and precision matrix.

Value

dnormwishart gives the density and rnormwishart generates random deviates and returns a list with two components.

Author(s)

See Also

Examples

library(LaplacesDemon)
K <- 3
mu <- rnorm(K)
mu0 <- rnorm(K)
nu <- K + 1
S <- diag(K)
lambda <- runif(1) #Real scalar
Omega <- as.positive.definite(matrix(rnorm(K^2),K,K))
x <- dnormwishart(mu, mu0, lambda, Omega, S, nu, log=TRUE)
out <- rnormwishart(n=10, mu0, lambda, S, nu)
joint.density.plot(out$mu[,1], out$mu[,2], color=TRUE)

LaplacesDemon

Complete Environment for Bayesian Inference

v16.1.4
MIT + file LICENSE
Authors
Byron Hall [aut], Martina Hall [aut], Statisticat, LLC [aut], Eric Brown [ctb], Richard Hermanson [ctb], Emmanuel Charpentier [ctb], Daniel Heck [ctb], Stephane Laurent [ctb], Quentin F. Gronau [ctb], Henrik Singmann [cre]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.