Skip to contents

This is the simplest possible density estimator that is entertainable. It fits a lm model to the data, and uses the variance of the residuals to parameterize a model of the data as \(\mathcal N(y | \beta x, \sigma^2)\).

Usage

lnr_lm_density(data, formula, ...)

Arguments

data

A dataframe to train a learner / learners on.

formula

A regression formula to use inside this learner.

...

Any extra arguments that should be passed to the internal model for model fitting purposes.

Value

a closure (function) that produces density estimates at the newdata given according to the fit model.