Skip to contents

Creates a model based on a Gaussian (normal) distribution. This parametric model is useful for detecting outliers and identifying multiple modes in data.

Usage

bs_model_gaussian(mu = NULL, sigma = NULL, fit_from_data = TRUE, name = NULL)

Arguments

mu

Mean of the Gaussian. If NULL, estimated from data.

sigma

Standard deviation. If NULL, estimated from data.

fit_from_data

Logical; estimate parameters from data?

name

Optional name for the model

Value

A bs_model_gaussian object

Details

The Gaussian model assumes data is drawn from a normal distribution. Points far from the mean (in terms of standard deviations) will have low likelihood and thus create high surprise when this model has probability mass.

This model is particularly useful for:

  • Detecting spatial outliers

  • Identifying multi-modal distributions

  • Combating renormalization bias (outliers get suppressed in dynamic visualizations)

Examples

# Gaussian model with parameters fit from data
model <- bs_model_gaussian()

# Gaussian model with fixed parameters
model <- bs_model_gaussian(mu = 100, sigma = 20)

# Use in model space with other models
population <- c(10000, 50000, 100000, 25000)
space <- model_space(
  bs_model_uniform(),
  bs_model_baserate(population),
  bs_model_gaussian()
)