Skip to content

Commit

Permalink
Vectorise equicoordinate quantiles for multivariate normal
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Sep 15, 2024
1 parent 4f5b42c commit 1410cd1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/dist_multivariate_normal.R
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ quantile.dist_mvnorm <- function(x, p, type = c("equicoordinate", "marginal"),
sd = rep(diag(sqrt(x[["sigma"]])), each = length(p)), ...)
} else {
require_package("mvtnorm")
mvtnorm::qmvnorm(p, mean = x[["mu"]], sigma = x[["sigma"]], ...)$quantile
vapply(p, function(...) mvtnorm::qmvnorm(...)$quantile, numeric(1L), mean = x[["mu"]], sigma = x[["sigma"]], ...)
}

matrix(q, nrow = length(p), ncol = dim(x))
Expand Down

0 comments on commit 1410cd1

Please sign in to comment.