ROL
|
Provides an interface for spectral risk measures. More...
#include <ROL_SpectralRisk.hpp>
Public Member Functions | |
SpectralRisk (void) | |
SpectralRisk (const ROL::Ptr< Distribution< Real > > &dist, const int nQuad, const ROL::Ptr< PlusFunction< Real > > &pf) | |
SpectralRisk (ROL::ParameterList &parlist) | |
SpectralRisk (const std::vector< Real > &pts, const std::vector< Real > &wts, const ROL::Ptr< PlusFunction< Real > > &pf) | |
void | setStorage (const Ptr< ScalarController< Real >> &value_storage, const Ptr< VectorController< Real >> &gradient_storage) |
void | setHessVecStorage (const Ptr< ScalarController< Real >> &gradvec_storage, const Ptr< VectorController< Real >> &hessvec_storage) |
void | setSample (const std::vector< Real > &point, const Real weight) |
void | resetStorage (bool flag=true) |
Reset internal storage. More... | |
void | resetStorage (UpdateType type) |
void | initialize (const Vector< Real > &x) |
Initialize temporary variables. More... | |
Real | computeStatistic (const Ptr< const std::vector< Real >> &xstat) const override |
Compute statistic. More... | |
void | updateValue (Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol) |
Update internal storage for value computation. More... | |
void | updateGradient (Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol) |
Update internal risk measure storage for gradient computation. More... | |
void | updateHessVec (Objective< Real > &obj, const Vector< Real > &v, const std::vector< Real > &vstat, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol) |
Update internal risk measure storage for Hessian-time-a-vector computation. More... | |
Real | getValue (const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler) |
Return risk measure value. More... | |
void | getGradient (Vector< Real > &g, std::vector< Real > &gstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler) |
Return risk measure (sub)gradient. More... | |
void | getHessVec (Vector< Real > &hv, std::vector< Real > &hvstat, const Vector< Real > &v, const std::vector< Real > &vstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler) |
Return risk measure Hessian-times-a-vector. More... | |
Public Member Functions inherited from ROL::RandVarFunctional< Real > | |
virtual | ~RandVarFunctional () |
RandVarFunctional (void) | |
weight_ (0) | |
void | useStorage (bool storage) |
void | useHessVecStorage (bool storage) |
Protected Member Functions | |
void | buildMixedQuantile (const std::vector< Real > &pts, const std::vector< Real > &wts, const ROL::Ptr< PlusFunction< Real > > &pf) |
void | buildQuadFromDist (std::vector< Real > &pts, std::vector< Real > &wts, const int nQuad, const ROL::Ptr< Distribution< Real > > &dist) const |
void | printQuad (const std::vector< Real > &pts, const std::vector< Real > &wts, const bool print=false) const |
Protected Member Functions inherited from ROL::RandVarFunctional< Real > | |
Real | computeValue (Objective< Real > &obj, const Vector< Real > &x, Real &tol) |
void | computeGradient (Vector< Real > &g, Objective< Real > &obj, const Vector< Real > &x, Real &tol) |
Real | computeGradVec (Vector< Real > &g, Objective< Real > &obj, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
void | computeHessVec (Vector< Real > &hv, Objective< Real > &obj, const Vector< Real > &v, const Vector< Real > &x, Real &tol) |
Private Member Functions | |
void | checkInputs (const ROL::Ptr< Distribution< Real > > &dist=ROL::nullPtr) const |
Private Attributes | |
ROL::Ptr< MixedCVaR< Real > > | mqq_ |
ROL::Ptr< PlusFunction< Real > > | plusFunction_ |
std::vector< Real > | wts_ |
std::vector< Real > | pts_ |
Additional Inherited Members | |
Protected Attributes inherited from ROL::RandVarFunctional< Real > | |
Real | val_ |
Real | gv_ |
Ptr< Vector< Real > > | g_ |
Ptr< Vector< Real > > | hv_ |
Ptr< Vector< Real > > | dualVector_ |
bool | firstReset_ |
std::vector< Real > | point_ |
Real | weight_ |
Provides an interface for spectral risk measures.
Kusuoka's representation for law-invariant risk measures is
\[ \mathcal{R}(X) = \sup_{\mu\in\mathfrak{M}} \int_0^1 \mathrm{CVaR}_{\alpha}(X)\,\mathrm{d}\mu(\alpha) \]
where the conditional value-at-risk (CVaR) with confidence level \(0\le \alpha < 1\) is
\[ \mathrm{CVaR}_\alpha(X) = \inf_{t\in\mathbb{R}} \left\{ t + \frac{1}{1-\alpha} \mathbb{E}\left[(X-t)_+\right] \right\}, \quad (x)_+ = \max\{0,x\}, \]
and \(\mathfrak{M}\) is a subset of distributions on the interval \([0,1)\). By spectral risk measures, we refer to the case where the set \(\mathfrak{M}\) is a singleton. If the distribution \(\mu\in\mathfrak{M}\) is discrete, then the corresponding risk measure is a mixed quantile quadrangle risk measure.
If the distribution of \(X\) is continuous, then \(\mathrm{CVaR}_{\alpha}(X)\) is the conditional expectation of \(X\) exceeding the \(\alpha\)-quantile of \(X\) and the optimal \(t\) is the \(\alpha\)-quantile. Additionally, \(\mathcal{R}\) is a law-invariant coherent risk measure.
ROL implements \(\mathcal{R}\) by approximating the integral with Gauss-Chebyshev quadrature of the first kind. The corresponding quadrature points and weights are then used to construct a ROL::MixedCVaR risk measure. When using derivative-based optimization, the user can provide a smooth approximation of \((\cdot)_+\) using the ROL::PlusFunction class.
Definition at line 55 of file ROL_SpectralRisk.hpp.
|
inline |
Definition at line 132 of file ROL_SpectralRisk.hpp.
|
inline |
Definition at line 134 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::buildMixedQuantile(), ROL::SpectralRisk< Real >::buildQuadFromDist(), and ROL::SpectralRisk< Real >::checkInputs().
|
inline |
Definition at line 147 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::buildMixedQuantile(), ROL::SpectralRisk< Real >::buildQuadFromDist(), ROL::SpectralRisk< Real >::checkInputs(), and ROL::SpectralRisk< Real >::printQuad().
|
inline |
Definition at line 168 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::buildMixedQuantile(), and ROL::SpectralRisk< Real >::checkInputs().
|
inlineprivate |
Definition at line 63 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::plusFunction_.
Referenced by ROL::SpectralRisk< Real >::SpectralRisk().
|
inlineprotected |
Definition at line 77 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_, ROL::SpectralRisk< Real >::plusFunction_, ROL::SpectralRisk< Real >::pts_, and ROL::SpectralRisk< Real >::wts_.
Referenced by ROL::SecondOrderCVaR< Real >::initializeQuad(), ROL::ChebyshevSpectral< Real >::initializeQuad(), and ROL::SpectralRisk< Real >::SpectralRisk().
|
inlineprotected |
Definition at line 85 of file ROL_SpectralRisk.hpp.
Referenced by ROL::SpectralRisk< Real >::SpectralRisk().
|
inlineprotected |
Definition at line 111 of file ROL_SpectralRisk.hpp.
Referenced by ROL::SpectralRisk< Real >::SpectralRisk().
|
inlinevirtual |
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 176 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_, and ROL::RandVarFunctional< Real >::setStorage().
|
inlinevirtual |
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 182 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_, and ROL::RandVarFunctional< Real >::setHessVecStorage().
|
inlinevirtual |
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 188 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_, and ROL::RandVarFunctional< Real >::setSample().
|
inlinevirtual |
Reset internal storage.
[in] | x | is a vector used for initializing storage |
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 193 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_, and ROL::RandVarFunctional< Real >::resetStorage().
|
inlinevirtual |
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 198 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_, and ROL::RandVarFunctional< Real >::resetStorage().
|
inlinevirtual |
Initialize temporary variables.
[in] | x | is a vector used for initializing storage |
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 203 of file ROL_SpectralRisk.hpp.
References ROL::RandVarFunctional< Real >::initialize(), and ROL::SpectralRisk< Real >::mqq_.
|
inlineoverridevirtual |
Compute statistic.
[in] | xstat | is a ROL::Ptr to a std::vector containing the statistic vector |
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 208 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_.
|
inlinevirtual |
Update internal storage for value computation.
[in] | val | is the value of the random variable objective function at the current sample point |
[in] | weight | is the weight associated with the current sample point |
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 212 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_.
|
inlinevirtual |
Update internal risk measure storage for gradient computation.
[in] | val | is the value of the random variable objective function at the current sample point |
[in] | g | is the gradient of the random variable objective function at the current sample point |
[in] | weight | is the weight associated with the current sample point |
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 219 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_.
|
inlinevirtual |
Update internal risk measure storage for Hessian-time-a-vector computation.
[in] | val | is the value of the random variable objective function at the current sample point |
[in] | g | is the gradient of the random variable objective function at the current sample point |
[in] | gv | is the gradient of the random variable objective function at the current sample point applied to the vector v0 |
[in] | hv | is the Hessian of the random variable objective function at the current sample point applied to the vector v0 |
[in] | weight | is the weight associated with the current sample point |
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 226 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_.
|
inlinevirtual |
Return risk measure value.
[in] | sampler | is the ROL::SampleGenerator used to sample the objective function |
Upon return, getValue returns \(\mathcal{R}(f(x_0))\) where \(f(x_0)\) denotes the random variable objective function evaluated at \(x_0\).
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 235 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_.
|
inlinevirtual |
Return risk measure (sub)gradient.
[out] | g | is the (sub)gradient of the risk measure |
[in] | sampler | is the ROL::SampleGenerator used to sample the objective function |
Upon return, getGradient returns \(\theta\in\partial\mathcal{R}(f(x_0))\) where \(f(x_0)\) denotes the random variable objective function evaluated at \(x_0\) and \(\partial\mathcal{R}(X)\) denotes the subdifferential of \(\mathcal{R}\) at \(X\).
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 241 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_.
|
inlinevirtual |
Return risk measure Hessian-times-a-vector.
[out] | hv | is the Hessian-times-a-vector of the risk measure |
[in] | sampler | is the ROL::SampleGenerator used to sample the objective function |
Upon return, getHessVec returns \(\nabla^2 \mathcal{R}(f(x_0))v_0\) (if available) where \(f(x_0)\) denotes the random variable objective function evaluated at \(x_0\).
Reimplemented from ROL::RandVarFunctional< Real >.
Definition at line 249 of file ROL_SpectralRisk.hpp.
References ROL::SpectralRisk< Real >::mqq_.
|
private |
Definition at line 57 of file ROL_SpectralRisk.hpp.
Referenced by ROL::SpectralRisk< Real >::buildMixedQuantile(), ROL::SpectralRisk< Real >::computeStatistic(), ROL::SpectralRisk< Real >::getGradient(), ROL::SpectralRisk< Real >::getHessVec(), ROL::SpectralRisk< Real >::getValue(), ROL::SpectralRisk< Real >::initialize(), ROL::SpectralRisk< Real >::resetStorage(), ROL::SpectralRisk< Real >::setHessVecStorage(), ROL::SpectralRisk< Real >::setSample(), ROL::SpectralRisk< Real >::setStorage(), ROL::SpectralRisk< Real >::updateGradient(), ROL::SpectralRisk< Real >::updateHessVec(), and ROL::SpectralRisk< Real >::updateValue().
|
private |
Definition at line 58 of file ROL_SpectralRisk.hpp.
Referenced by ROL::SpectralRisk< Real >::buildMixedQuantile(), and ROL::SpectralRisk< Real >::checkInputs().
|
private |
Definition at line 60 of file ROL_SpectralRisk.hpp.
Referenced by ROL::SpectralRisk< Real >::buildMixedQuantile().
|
private |
Definition at line 61 of file ROL_SpectralRisk.hpp.
Referenced by ROL::SpectralRisk< Real >::buildMixedQuantile().