lpRR | R Documentation |
Computes the log-likelihood (contributions) of interval-censored observations from multivariate normal distributions with reduced rank structure and evaluates corresponding score functions.
lpRR(lower, upper, mean = 0, B, D = rep(1, nrow(B)),
Z, weights = 1 / ncol(Z), log.p = TRUE)
slpRR(lower, upper, mean = 0, B, D = rep(1, nrow(B)),
Z, weights = 1 / ncol(Z), log.p = TRUE)
lower |
vector of lower limits (one element for each dimension, |
upper |
vector of upper limits (one element for each dimension, |
mean |
vector of means (one element for each dimension, length is
recycled to length of |
B |
matrix of dimension |
D |
vector of |
Z |
matrix of standard normal random variables, with |
weights |
optional weights. |
log.p |
logical. By default, log-probabilities are returned. |
Evaluates the multivariate normal log-likelihood defined by means
,
B
and D
when the covariance is Sigma = B B^\top + D
over boxes defined by lower
and upper
. Details are given
in Genz and Bretz (2009, Chapter 2.3.1.).
slpmvnorm
computes
the corresponding score functions with respect to lower
,
upper
, mean
, B
and D
.
More details can be found in the lmvnorm_src
package vignette.
The log-likelihood (log.p = TRUE
) or corresponding probability.
slpRR
return the scores.
Genz, A. and Bretz, F. (2009), Computation of Multivariate Normal and t Probabilities. Lecture Notes in Statistics, Vol. 195. Springer-Verlag, Heidelberg.
vignette("lmvnorm_src", package = "mvtnorm")
J <- 6
K <- 3
B <- matrix(rnorm(J * K), nrow = J)
D <- runif(J)
S <- tcrossprod(B) + diag(D)
a <- -(2 + runif(J))
b <- 2 + runif(J)
M <- 1e4
Z <- matrix(rnorm(K * M), nrow = K)
lpRR(lower = a, upper = b, B = B, D = D, Z = Z)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.