Skip to content

Commit

Permalink
Minor fix to multivariate normal marginal quantile variance usage
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchelloharawild committed Sep 16, 2024
1 parent 7c3d0eb commit 8be0d60
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
rather than P(X > q) for consistency with all other `cdf()` methods.
* The `quantile()` method for `dist_multivariate_normal()` now correctly gives
the boundaries when `p=0` or `p=1` when `type="equicoordinate"`.
* The `quantile()` method for `dist_multivariate_normal()` now only square roots
the diagonal elements when `type="marginal"`.


## Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion R/dist_multivariate_normal.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ quantile.dist_mvnorm <- function(x, p, type = c("equicoordinate", "marginal"),
type <- match.arg(type)
q <- if (type == "marginal") {
stats::qnorm(p, mean = rep(x[["mu"]], each = length(p)),
sd = rep(diag(sqrt(x[["sigma"]])), each = length(p)), ...)
sd = rep(sqrt(diag(x[["sigma"]])), each = length(p)), ...)
} else {
require_package("mvtnorm")
vapply(p, function(p, ...) {
Expand Down

0 comments on commit 8be0d60

Please sign in to comment.