com.github.chen0040.glm.links.IdentityLinkFunction Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-glm Show documentation
Show all versions of java-glm Show documentation
Generalized linear models implemented in Java
package com.github.chen0040.glm.links;
/**
* Created by xschen on 14/8/15.
*/
///
/// For the linear link function:
/// The constraint interval is a real line as well
///
/// The linear link function maps constraint interval { b | b \in R } to real line {a | a \in R} by:
/// a = f(b) = b
///
/// The inverse link function maps real line {a | a \in R} to constraint interval { b | b \in R } by:
/// b = g(a) = a
///
/// Generally applicable to the following distribution:
/// 1. Normal: which is the linear-response shrinkedData (linear regressions)
///
public class IdentityLinkFunction extends AbstractLinkFunction {
@Override
public LinkFunction makeCopy(){
IdentityLinkFunction clone = new IdentityLinkFunction();
return clone;
}
///
/// The linear link function maps constraint interval { b | b \in R } to real line {a | a \in R} by:
/// a = f(b) = b
///
/// The constraint interval value
/// The mapped linear line value
@Override
public double GetLink(double b) {
return b;
}
///
/// The inverse link function maps real line {a | a \in R} to constraint interval { b | b \in R } by:
/// b = g(a) = a
///
/// The linear line value
/// The mapped constraint interval value
@Override
public double GetInvLink(double a) {
return a;
}
@Override
public double GetInvLinkDerivative(double real_line_value) {
return 1;
}
}