Family representing a GLM with custom distribution and link function
Source:R/population.R
custom_family.RdAllows specification of the random component and link function for a response
variable. In principle this could be used to specify any GLM family, but it
is usually easier to use the predefined families, such as gaussian() and
binomial().
Details
A GLM is specified by a combination of:
Random component, i.e. the distribution that Y is drawn from
Link function relating the mean of the random component to the linear predictor
Linear predictor
Using custom_family() we can specify the random component and link
function, while the linear predictor is set in population() when setting up
the population relationships. A family specified this way can be used to
specify a population (via population()), but can't be used to estimate a
model (such as with glm()).
See also
ols_with_error() for the special case of linear regression with
custom error distribution