Skip to contents

This constructor function can be used to create an instance of a parametric GLM with specific distribution family, returning a new object of NormalGLM, ExpGLM, WeibullGLM or GammaGLM, depending on the value of distr.

Usage

GLM.new(distr, linkinv = identity, params = NA)

Arguments

distr

distribution family

linkinv

inverse link function, defaults to identity function

params

model parameters to use as default (optional)

Value

a new instance of a GLM-subclass

Examples

model <- GLM.new(distr = "normal")
# see examples of GLM-subclasses (e.g. NormalGLM) for how to use such models