# Interface Model

All Superinterfaces:
`Serializable`

public interface Model extends Serializable
The GLM model specification. The GLM consists of three elements:
1. An exponential family of probability distributions.
2. A linear predictor.
3. A link function provides the relationship between the linear predictor and the mean of the distribution function.
This class specifies the distribution and link function in the model.

An overdispersed exponential family of distributions is a generalization of an exponential family and the exponential dispersion model of distributions and includes those families of probability distributions, parameterized by θ and τ. The parameter θ is related to the mean of the distribution. The dispersion parameter τ typically is known and is usually related to the variance of the distribution.

There are many commonly used link functions, and their choice is informed by several considerations. There is always a well-defined canonical link function which is derived from the exponential of the response's density function. However, in some cases it makes sense to try to match the domain of the link function to the range of the distribution function's mean, or use a non-canonical link function for algorithmic purposes.

• ## Method Summary

Modifier and Type
Method
Description
`double`
```deviance(double[] y, double[] mu, double[] residuals)```
The deviance function.
`double`
`dlink(double mu)`
The derivative of link function.
`double`
`invlink(double eta)`
The inverse of link function (aka the mean function).
`double`
`link(double mu)`
`double`
```logLikelihood(double[] y, double[] mu)```
The log-likelihood function.
`double`
`mustart(double y)`
The function to estimates the starting value of mean given y.
`double`
```nullDeviance(double[] y, double mu)```
The NULL deviance function.
`double`
`variance(double mu)`
The variance function.
• ## Method Details

The link function. For the most common distributions, the mean μ is one of the parameters in the standard form of the distribution's density function, and then the link function maps the density function into its canonical form.
Parameters:
`mu` - the mean of the distribution function.
Returns:
the linear predictor.

The inverse of link function (aka the mean function).
Parameters:
`eta` - the linear predictor. The linear predictor is the quantity which incorporates the independent variables into the model.
Returns:
the mean.

The derivative of link function.
Parameters:
`mu` - the mean of the distribution function.
Returns:
the derivative of link function.
• ### variance

double variance(double mu)
The variance function.
Parameters:
`mu` - the mean of the distribution function.
Returns:
the variance function value.
• ### deviance

double deviance(double[] y, double[] mu, double[] residuals)
The deviance function.
Parameters:
`y` - the responsible variable.
`mu` - the mean of the distribution function.
`residuals` - the residuals.
Returns:
the deviance function value.
• ### nullDeviance

double nullDeviance(double[] y, double mu)
The NULL deviance function.
Parameters:
`y` - the responsible variable.
`mu` - the mean of the distribution function.
Returns:
the null deviance function value.
• ### logLikelihood

double logLikelihood(double[] y, double[] mu)
The log-likelihood function.
Parameters:
`y` - the responsible variable.
`mu` - the mean of the distribution function.
Returns:
the log-likelihood.
• ### mustart

double mustart(double y)
The function to estimates the starting value of mean given y.
Parameters:
`y` - the responsible variable.
Returns:
the starting value of mean.