public abstract class AbstractMathematicalFunction extends java.lang.Object implements EvaluableFunction<java.lang.Double>, DerivableMathematicalFunction, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Integer,ParameterBound> |
parameterBounds |
Modifier | Constructor and Description |
---|---|
protected |
AbstractMathematicalFunction() |
Modifier and Type | Method and Description |
---|---|
Matrix |
getBeta()
This method returns the vector of parameters.
|
abstract Matrix |
getGradient()
This method returns a vector that contains the first derivatives of the function with respect to its parameters.
|
abstract Matrix |
getHessian()
This method returns a matrix that contains the second derivatives of the function with respect to its parameters.
|
int |
getNumberOfParameters()
This method returns the number of parameters involved in the function.
|
int |
getNumberOfVariables()
This method returns the number of variables in the function.
|
double |
getParameterValue(int parameterIndex)
This method retrieve the parameter defined by the parameterName parameter.
|
abstract java.lang.Double |
getValue()
This method provides the result of the function evaluation.
|
double |
getVariableValue(int variableIndex)
This method returns the value of the variable at index variableIndex
|
void |
setBeta(Matrix beta)
This method sets the vector of parameters.
|
void |
setBounds(int parameterIndex,
ParameterBound bound)
This method sets a bound for a particular parameter
|
void |
setParameterValue(int parameterIndex,
double parameterValue)
This method sets the parameter value.
|
void |
setVariableValue(int variableIndex,
double variableValue)
This method sets the variable value associated with this variable name.
|
void |
setX(Matrix x)
This method sets the vector of explanatory variables.
|
protected java.util.Map<java.lang.Integer,ParameterBound> parameterBounds
public void setParameterValue(int parameterIndex, double parameterValue)
parameterIndex
- the parameter indexparameterValue
- the parameter valuepublic double getParameterValue(int parameterIndex)
parameterIndex
- the index of the parameter to be retrievedpublic void setVariableValue(int variableIndex, double variableValue)
variableIndex
- the index of the variablevariableValue
- its value (a double)public double getVariableValue(int variableIndex)
variableIndex
- an integerpublic int getNumberOfParameters()
public int getNumberOfVariables()
public abstract java.lang.Double getValue()
EvaluableFunction
getValue
in interface EvaluableFunction<java.lang.Double>
public abstract Matrix getGradient()
DerivableMathematicalFunction
getGradient
in interface DerivableMathematicalFunction
public abstract Matrix getHessian()
DerivableMathematicalFunction
getHessian
in interface DerivableMathematicalFunction
public void setBounds(int parameterIndex, ParameterBound bound)
parameterIndex
- an Integer instance that defines the parameterbound
- a ParameterBound objectpublic void setX(Matrix x)
x
- a Matrix instancejava.lang.IllegalArgumentException
- if the parameter x is not a row vectorpublic void setBeta(Matrix beta)
beta
- a Matrix instancejava.lang.IllegalArgumentException
- if beta is not a column vectorpublic Matrix getBeta()