Calculates the deviance and returns the ML estimated dispersion parameter for a variety of response distributions for P-spline fitting within the GLM framework.
dev_calc(
family = "gaussian",
y,
mu,
m_binomial = 0 * y + 1,
r_gamma = 0 * y + 1
)
A list with two fields:
the estimated deviance.
the ML estimated dispersion parameter.
the response distribution, e.g. "gaussian", "binomial", "poisson", "Gamma"
distribution. Quotes are needed; default "family = gaussian"
.
the glm response vector of length m
.
the P-spline estimated mean for the glm response vector of length m
.
a vector of binomial trials having length(y)
, when family = "binomial"
. Default is 1 vector.
a vector of gamma shape parameters, when family = "Gamma"
. Default is 1 vector.