Top Description Inners Fields Constructors Methods
org.apache.commons.math3.analysis.function

public Class Logit

extends Object
implements UnivariateDifferentiableFunction, DifferentiableUnivariateFunction
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.analysis.DifferentiableUnivariateFunction, org.apache.commons.math3.analysis.UnivariateFunction, org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction
Imports
org.apache.commons.math3.analysis.DifferentiableUnivariateFunction, .FunctionUtils, .ParametricUnivariateFunction, .UnivariateFunction, org.apache.commons.math3.analysis.differentiation.DerivativeStructure, .UnivariateDifferentiableFunction, org.apache.commons.math3.exception.DimensionMismatchException, .NullArgumentException, .OutOfRangeException, org.apache.commons.math3.util.FastMath

Deprecated

as a consequence of DifferentiableUnivariateFunction being deprecated. See corresponding docs for further information.

Logit function. It is the inverse of the sigmoid function.
Since
3.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
Logit.Parametric

Parametric function where the input array contains the parameters of the logit function, ordered as follows:

  • Lower bound
  • Higher bound

Field Summary

Modifier and TypeField and Description
private final double
hi

Higher bound.

private final double
lo

Lower bound.

Constructor Summary

AccessConstructor and Description
public
Logit()

Usual logit function, where the lower bound is 0 and the higher bound is 1.

public
Logit(double
Lower bound of the function domain.
lo
,
double
Higher bound of the function domain.
hi
)

Logit function.

Method Summary

Modifier and TypeMethod and Description
public UnivariateFunction
derivative()

Implements org.apache.commons.math3.analysis.DifferentiableUnivariateFunction.derivative.

Deprecated as of 3.1, replaced by value(DerivativeStructure)

Returns the derivative of the function

public double
value(double
Point at which the function value should be computed.
x
)

Implements org.apache.commons.math3.analysis.UnivariateFunction.value.

Compute the value of the function.

private static double

Returns:

the value of the logit function at x.
value
(double
Value at which to compute the logit.
x
,
double
Lower bound.
lo
,
double
Higher bound.
hi
)

public DerivativeStructure
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hiback to summary
private final double hi

Higher bound.

loback to summary
private final double lo

Lower bound.

Constructor Detail

Logitback to summary
public Logit()

Usual logit function, where the lower bound is 0 and the higher bound is 1.

Logitback to summary
public Logit(double lo, double hi)

Logit function.

Parameters
lo:double

Lower bound of the function domain.

hi:double

Higher bound of the function domain.

Method Detail

derivativeback to summary
public UnivariateFunction derivative()

Implements org.apache.commons.math3.analysis.DifferentiableUnivariateFunction.derivative.

Doc from org.apache.commons.math3.analysis.DifferentiableUnivariateFunction.derivative.

Deprecated

as of 3.1, replaced by value(DerivativeStructure)

Returns the derivative of the function

Returns:UnivariateFunction

the derivative function

Annotations
@Deprecated
valueback to summary
public double value(double x) throws OutOfRangeException

Implements org.apache.commons.math3.analysis.UnivariateFunction.value.

Doc from org.apache.commons.math3.analysis.UnivariateFunction.value.

Compute the value of the function.

Parameters
x:double

Point at which the function value should be computed.

Returns:double

the value of the function.

valueback to summary
private static double value(double x, double lo, double hi) throws OutOfRangeException
Parameters
x:double

Value at which to compute the logit.

lo:double

Lower bound.

hi:double

Higher bound.

Returns:double

the value of the logit function at x.

Exceptions
OutOfRangeException:
if x < lo or x > hi.
valueback to summary
public DerivativeStructure value(final DerivativeStructure t) throws OutOfRangeException

Implements org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction.value.

Doc from org.apache.commons.math3.analysis.differentiation.UnivariateDifferentiableFunction.value.

Simple mathematical function.

UnivariateDifferentiableFunction classes compute both the value and the first derivative of the function.

Parameters
t:DerivativeStructure

function input value

Returns:DerivativeStructure

function result

Exceptions
OutOfRangeException:
if parameter is outside of function domain
Since
3.1
org.apache.commons.math3.analysis.function back to summary

public Class Logit.Parametric

extends Object
implements ParametricUnivariateFunction
Class Inheritance
All Implemented Interfaces
org.apache.commons.math3.analysis.ParametricUnivariateFunction

Parametric function where the input array contains the parameters of the logit function, ordered as follows:

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public double[]

Returns:

the gradient vector at x.
gradient
(double
Value at which the gradient must be computed.
x
,
double...
Values for lower and higher bounds.
param
)

Implements org.apache.commons.math3.analysis.ParametricUnivariateFunction.gradient.

Computes the value of the gradient at x.

private void
validateParameters(double[]
Values for lower and higher bounds.
param
)

Validates parameters to ensure they are appropriate for the evaluation of the value(double, double[]) and gradient(double, double[]) methods.

public double

Returns:

the value of the function.
value
(double
Value for which the function must be computed.
x
,
double...
Values of lower bound and higher bounds.
param
)

Implements org.apache.commons.math3.analysis.ParametricUnivariateFunction.value.

Computes the value of the logit at x.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Parametricback to summary
public Parametric()

Method Detail

gradientback to summary
public double[] gradient(double x, double... param) throws NullArgumentException, DimensionMismatchException

Implements org.apache.commons.math3.analysis.ParametricUnivariateFunction.gradient.

Computes the value of the gradient at x. The components of the gradient vector are the partial derivatives of the function with respect to each of the parameters (lower bound and higher bound).

Parameters
x:double

Value at which the gradient must be computed.

param:double[]

Values for lower and higher bounds.

Returns:double[]

the gradient vector at x.

Exceptions
NullArgumentException:
if param is null.
DimensionMismatchException:
if the size of param is not 2.
validateParametersback to summary
private void validateParameters(double[] param) throws NullArgumentException, DimensionMismatchException

Validates parameters to ensure they are appropriate for the evaluation of the value(double, double[]) and gradient(double, double[]) methods.

Parameters
param:double[]

Values for lower and higher bounds.

Exceptions
NullArgumentException:
if param is null.
DimensionMismatchException:
if the size of param is not 2.
valueback to summary
public double value(double x, double... param) throws NullArgumentException, DimensionMismatchException

Implements org.apache.commons.math3.analysis.ParametricUnivariateFunction.value.

Computes the value of the logit at x.

Parameters
x:double

Value for which the function must be computed.

param:double[]

Values of lower bound and higher bounds.

Returns:double

the value of the function.

Exceptions
NullArgumentException:
if param is null.
DimensionMismatchException:
if the size of param is not 2.