Link functions
Link functions
A link function \(g(x)\) is a smooth, monotonic function of \(x\).
For all link functions, we implement
- the link \(g(x)\)
- the inverse \(g^{-1}(x)\)
- the derivative of the link function \(\frac{\partial g(x)}{\partial x}\).
- the first derivative of the inverse of the link function \(\frac{\partial g(x)^{-1}}{\partial x}\). The choice of the inverse is justified by Equation (7) in Hirsch, Berrisch & Ziel (2024).
The link functions implemented in ROLCH
implemenent these as class methods each. Currently, we have implemented the identity-link, log-link and shifted log-link functions.
Shifted Link Functions
Some link functions implement shifted versions. The shifted link function is implemented in the sense that the shift is added to the inverse transformation. This way, we can ensure that distribution parameters can be modelled on the continuous space of the \(\eta = g(\theta)\), but in the inverse transform fullfill certain additional constraints. A common example is the \(t\) distribution, where we can use a LogShift2Link
or SqrtShift2Link
to ensure that \(\hat{\theta} = g^-1(\eta) > 2\) and the variance exists.
Base Class
rolch.abc.LinkFunction
Bases: ABC
The base class for the link functions.
inverse
abstractmethod
Calculate the inverse of the link function
inverse_derivative
abstractmethod
Calculate the first derivative for the inverse link function
link_derivative
abstractmethod
Calculate the first derivative of the link function
API Reference
rolch.link.IdentityLink
Log-Link Functions
rolch.link.LogLink
rolch.link.LogShiftValueLink
Bases: LinkFunction
The Log-Link function shifted to a value \(v\).
This link function is defined as \(g(x) = \log(x - v)\). It can be used to ensure that certain distribution paramters don't fall below lower bounds, e.g. ensuring that the degrees of freedom of a Student's t distribtuion don't fall below 2, hence ensuring that the variance exists.
rolch.link.LogShiftTwoLink
Bases: LogShiftValueLink
The Log-Link function shifted to 2.
This link function is defined as \(g(x) = \log(x - 2)\). It can be used to ensure that certain distribution paramters don't fall below lower bounds, e.g. ensuring that the degrees of freedom of a Student's t distribtuion don't fall below 2, hence ensuring that the variance exists.
rolch.link.LogIdentLink
Bases: LinkFunction
The Logident Link function.
The LogIdent Link function has been introduced by Narajewski & Ziel 2020 and can be used to avoid the exponential inverse for large values while keeping the log-behaviour in small ranges. This can stabilize the estimation procedure.
Square Root Link Functions
rolch.link.SqrtLink
Bases: LinkFunction
The square root Link function.
The square root link function is defined as \(\(g(x) = \sqrt(x)\)\).
rolch.link.SqrtShiftValueLink
Bases: LinkFunction
The Sqrt-Link function shifted to a value \(v\).
This link function is defined as \(\(g(x) = \sqrt(x - v)\)\). It can be used to ensure that certain distribution paramters don't fall below lower bounds, e.g. ensuring that the degrees of freedom of a Student's t distribtuion don't fall below 2, hence ensuring that the variance exists.
rolch.link.SqrtShiftTwoLink
Bases: SqrtShiftValueLink
The Sqrt-Link function shifted to 2.
This link function is defined as \(\(g(x) = \sqrt(x - 2)\)\). It can be used to ensure that certain distribution paramters don't fall below lower bounds, e.g. ensuring that the degrees of freedom of a Student's t distribtuion don't fall below 2, hence ensuring that the variance exists.