
Conditional Normal Density Estimation Given Mean Predictors — with GLMs
Source:R/density_learners.R
lnr_glm_density.RdThis is a step up from the lnr_lm_density in that it uses
a glm for the conditional mean model.
Note that this allows for specification of glm features
like family = ... in the ,.. arguments, and
that's the main advantage over the lnr_lm_density.
Also note that this still differs from using lnr_homoskedastic_density
with mean_lnr = lnr_glm because lnr_homoscedastic_density
uses stats::density to do kernel bandwidth smoothing
on the error distribution of the mean predictions..
Arguments
- data
A dataframe to train a learner / learners on.
- formula
A regression formula to use inside this learner.
- weights
Observation weights; see
?lm- ...
Any extra arguments that should be passed to the internal model for model fitting purposes.