QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
Parameterized cost function. More...
#include <projectedcostfunction.hpp>
Public Member Functions | |
ProjectedCostFunction (const CostFunction &costFunction, const Array ¶meterValues, const std::vector< bool > &fixParameters) | |
ProjectedCostFunction (const CostFunction &costFunction, const Projection &projection) | |
Public Member Functions inherited from CostFunction | |
virtual | ~CostFunction ()=default |
virtual Real | value (const Array &x) const |
method to overload to compute the cost function value in x More... | |
virtual Array | values (const Array &x) const =0 |
method to overload to compute the cost function values in x More... | |
virtual void | gradient (Array &grad, const Array &x) const |
method to overload to compute grad_f, the first derivative of More... | |
virtual Real | valueAndGradient (Array &grad, const Array &x) const |
method to overload to compute grad_f, the first derivative of More... | |
virtual void | jacobian (Matrix &jac, const Array &x) const |
method to overload to compute J_f, the jacobian of More... | |
virtual Array | valuesAndJacobian (Matrix &jac, const Array &x) const |
method to overload to compute J_f, the jacobian of More... | |
virtual Real | finiteDifferenceEpsilon () const |
Default epsilon for finite difference method : More... | |
Public Member Functions inherited from Projection | |
Projection (const Array ¶meterValues, std::vector< bool > fixParameters=std::vector< bool >()) | |
virtual Array | project (const Array ¶meters) const |
returns the subset of free parameters corresponding More... | |
virtual Array | include (const Array &projectedParameters) const |
returns whole set of parameters corresponding to the set More... | |
virtual | ~Projection ()=default |
CostFunction interface | |
const CostFunction & | costFunction_ |
Real | value (const Array &freeParameters) const override |
method to overload to compute the cost function value in x More... | |
Array | values (const Array &freeParameters) const override |
method to overload to compute the cost function values in x More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Projection | |
void | mapFreeParameters (const Array ¶meterValues) const |
Protected Attributes inherited from Projection | |
Size | numberOfFreeParameters_ = 0 |
const Array | fixedParameters_ |
Array | actualParameters_ |
std::vector< bool > | fixParameters_ |
Parameterized cost function.
This class creates a proxy cost function which can depend on any arbitrary subset of parameters (the other being fixed)
Definition at line 39 of file projectedcostfunction.hpp.
ProjectedCostFunction | ( | const CostFunction & | costFunction, |
const Array & | parameterValues, | ||
const std::vector< bool > & | fixParameters | ||
) |
Definition at line 26 of file projectedcostfunction.cpp.
ProjectedCostFunction | ( | const CostFunction & | costFunction, |
const Projection & | projection | ||
) |
Definition at line 32 of file projectedcostfunction.cpp.
method to overload to compute the cost function value in x
Reimplemented from CostFunction.
Definition at line 37 of file projectedcostfunction.cpp.
method to overload to compute the cost function values in x
Implements CostFunction.
Definition at line 42 of file projectedcostfunction.cpp.
|
private |
Definition at line 55 of file projectedcostfunction.hpp.