All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.chen0040.glm.links.IdentityLinkFunction Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
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;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy