dev_calc: Deviance calculation for GLM P-spline fitting.

View source: R/GLM_Signal_2D_support.R

dev_calcR Documentation

Deviance calculation for GLM P-spline fitting.

Description

Calculates the deviance and returns the ML estimated dispersion parameter for a variety of response distributions for P-spline fitting within the GLM framework.

Usage

dev_calc(
  family = "gaussian",
  y,
  mu,
  m_binomial = 0 * y + 1,
  r_gamma = 0 * y + 1
)

Arguments

family

the response distribution, e.g. "gaussian", "binomial", "poisson", "Gamma" distribution. Quotes are needed; default "family = gaussian".

y

the glm response vector of length m.

mu

the P-spline estimated mean for the glm response vector of length m.

m_binomial

a vector of binomial trials having length(y), when family = "binomial". Default is 1 vector.

r_gamma

a vector of gamma shape parameters, when family = "Gamma". Default is 1 vector.

Value

A list with two fields:

dev

the estimated deviance.

dispersion_parm

the ML estimated dispersion parameter.


JOPS documentation built on Sept. 8, 2023, 5:42 p.m.

Related to dev_calc in JOPS...