Statistical Distributions

dmvnorm(
  x,
  mu = NULL,
  Q,
  detQ = determinant(Q, logarithm = TRUE)$modulus,
  log = TRUE
)

dmvlnorm(
  x,
  mu = NULL,
  Q,
  detQ = determinant(Q, logarithm = TRUE)$modulus,
  log = TRUE
)

dmvnorm_diff(x, y, mu, Q, b, log = TRUE, byrow = FALSE)

dmvlnorm_diff(x, y, mu, Q, log = TRUE, byrow = FALSE)

dnorm_diff(x, y, mu, tau, log = TRUE, byrow = FALSE)

dlnorm_diff(x, y, mu, tau, log = TRUE, byrow = FALSE)

dmatnorm(
  x,
  mu = NULL,
  V,
  U = NULL,
  detV = determinant(V, logarithm = TRUE)$modulus,
  detU = determinant(U, logarithm = TRUE)$modulus,
  log = TRUE
)

dmatnorm_diff(x, y, mu, V, U = NULL, log = TRUE)

dlogitnorm(x, mu, sd, log = FALSE)

rdirich(n, alpha)

rdlnorm(n, meanlog = 0, sdlog = 1)

ddlnorm(x, meanlog = 0, sdlog = 1, log = FALSE)

pdlnorm(x, meanlog = 0, sdlog = 1, lower.tail = TRUE, log.p = FALSE)

rtruncexp(n, rate = 1, a = 0, b = Inf)

dtruncexp(x, rate = 1, a = 0, b = Inf, log = FALSE)

ptruncexp(q, rate = 1, a = 0, b = Inf, lower.tail = TRUE, log.p = FALSE)

qtruncexp(p, rate = 1, a = 0, b = Inf)

Arguments

x, y

vector of quantiles

mu

the mean. The default (NULL)- is the same as an appropriately-dimensioned vector/matrix of all zeros, but a little faster.

detQ, detU, detV

Pre-computed log-determinants

log

Should the log-density be returned?

b

Bounds for the truncated exponential distribution or the multivariate normal canonical representation parameter.

byrow

Should the densities be summed (FALSE, the default) or returned separately by row (TRUE).

tau, Q

the precision (matrix)

V, U

the precision matrices for the matrix-normal distribution

sd

the standard deviation

n

Number of deviates to produce.

alpha

the Dirichlet parameter vector or matrix.

meanlog, sdlog

the parameters of the underlying log-normal distribution.

lower.tail

Should lower tail probabilities be returned (default) or upper?

log.p

Should the log be returned?

rate

the Exponential rate parameter. If zero, a normal distribution is used instead. If negative, the problem is flipped and calculated using -rate.

a

Bounds for the truncated exponential distribution.

q

A quantile

p

A probability

Details

dmvnorm_diff(x, y, mu, Q) is equivalent to (but usually twice as fast as) dmvnorm(x, mu, Q) - dmvnorm(y, mu, Q). Likewise dmatnorm_diff.