method_mvnorm {ggdensity}R Documentation

Bivariate parametric normal HDR estimator

Description

Function used to specify bivariate normal density estimator for get_hdr() and layer functions (e.g. geom_hdr()).

Usage

method_mvnorm()

Details

For more details on the use and implementation of the ⁠method_*()⁠ functions, see vignette("method", "ggdensity").

Examples

# Normal estimator is useful when an assumption of normality is appropriate
set.seed(1)
df <- data.frame(x = rnorm(1e3), y = rnorm(1e3))

ggplot(df, aes(x, y)) +
  geom_hdr(method = method_mvnorm(), xlim = c(-4, 4), ylim = c(-4, 4)) +
  geom_point(size = 1)

# Can also be used with `get_hdr()` for numerical summary of HDRs
res <- get_hdr(df, method = method_mvnorm())
str(res)


[Package ggdensity version 1.0.0 Index]