ROL
ROL::SpectralRisk< Real > Class Template Reference

Provides an interface for spectral risk measures. More...

#include <ROL_SpectralRisk.hpp>

Inheritance diagram for ROL::SpectralRisk< Real >:

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) override
void setHessVecStorage (const Ptr< ScalarController< Real > > &gradvec_storage, const Ptr< VectorController< Real > > &hessvec_storage) override
void setSample (const std::vector< Real > &point, const Real weight) override
void resetStorage (bool flag=true) override
void resetStorage (UpdateType type) override
void initialize (const Vector< Real > &x) override
Real computeStatistic (const Ptr< const std::vector< Real > > &xstat) const override
void updateValue (Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol) override
void updateGradient (Objective< Real > &obj, const Vector< Real > &x, const std::vector< Real > &xstat, Real &tol) override
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) override
Real getValue (const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler) override
void getGradient (Vector< Real > &g, std::vector< Real > &gstat, const Vector< Real > &x, const std::vector< Real > &xstat, SampleGenerator< Real > &sampler) override
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) override

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

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_

Detailed Description

template<class Real>
class ROL::SpectralRisk< Real >

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.

Constructor & Destructor Documentation

◆ SpectralRisk() [1/4]

◆ SpectralRisk() [2/4]

template<class Real>
ROL::SpectralRisk< Real >::SpectralRisk ( const ROL::Ptr< Distribution< Real > > & dist,
const int nQuad,
const ROL::Ptr< PlusFunction< Real > > & pf )
inline

Definition at line 134 of file ROL_SpectralRisk.hpp.

References buildMixedQuantile(), buildQuadFromDist(), and checkInputs().

◆ SpectralRisk() [3/4]

template<class Real>
ROL::SpectralRisk< Real >::SpectralRisk ( ROL::ParameterList & parlist)
inline

◆ SpectralRisk() [4/4]

template<class Real>
ROL::SpectralRisk< Real >::SpectralRisk ( const std::vector< Real > & pts,
const std::vector< Real > & wts,
const ROL::Ptr< PlusFunction< Real > > & pf )
inline

Definition at line 168 of file ROL_SpectralRisk.hpp.

References buildMixedQuantile(), and checkInputs().

Member Function Documentation

◆ checkInputs()

template<class Real>
void ROL::SpectralRisk< Real >::checkInputs ( const ROL::Ptr< Distribution< Real > > & dist = ROL::nullPtr) const
inlineprivate

Definition at line 63 of file ROL_SpectralRisk.hpp.

References plusFunction_.

Referenced by SpectralRisk(), SpectralRisk(), and SpectralRisk().

◆ buildMixedQuantile()

template<class Real>
void ROL::SpectralRisk< Real >::buildMixedQuantile ( const std::vector< Real > & pts,
const std::vector< Real > & wts,
const ROL::Ptr< PlusFunction< Real > > & pf )
inlineprotected

◆ buildQuadFromDist()

template<class Real>
void ROL::SpectralRisk< Real >::buildQuadFromDist ( std::vector< Real > & pts,
std::vector< Real > & wts,
const int nQuad,
const ROL::Ptr< Distribution< Real > > & dist ) const
inlineprotected

Definition at line 85 of file ROL_SpectralRisk.hpp.

Referenced by SpectralRisk(), and SpectralRisk().

◆ printQuad()

template<class Real>
void ROL::SpectralRisk< Real >::printQuad ( const std::vector< Real > & pts,
const std::vector< Real > & wts,
const bool print = false ) const
inlineprotected

Definition at line 111 of file ROL_SpectralRisk.hpp.

Referenced by SpectralRisk().

◆ setStorage()

template<class Real>
void ROL::SpectralRisk< Real >::setStorage ( const Ptr< ScalarController< Real > > & value_storage,
const Ptr< VectorController< Real > > & gradient_storage )
inlineoverride

Definition at line 176 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ setHessVecStorage()

template<class Real>
void ROL::SpectralRisk< Real >::setHessVecStorage ( const Ptr< ScalarController< Real > > & gradvec_storage,
const Ptr< VectorController< Real > > & hessvec_storage )
inlineoverride

Definition at line 182 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ setSample()

template<class Real>
void ROL::SpectralRisk< Real >::setSample ( const std::vector< Real > & point,
const Real weight )
inlineoverride

Definition at line 188 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ resetStorage() [1/2]

template<class Real>
void ROL::SpectralRisk< Real >::resetStorage ( bool flag = true)
inlineoverride

Definition at line 193 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ resetStorage() [2/2]

template<class Real>
void ROL::SpectralRisk< Real >::resetStorage ( UpdateType type)
inlineoverride

Definition at line 198 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ initialize()

template<class Real>
void ROL::SpectralRisk< Real >::initialize ( const Vector< Real > & x)
inlineoverride

Definition at line 203 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ computeStatistic()

template<class Real>
Real ROL::SpectralRisk< Real >::computeStatistic ( const Ptr< const std::vector< Real > > & xstat) const
inlineoverride

Definition at line 208 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ updateValue()

template<class Real>
void ROL::SpectralRisk< Real >::updateValue ( Objective< Real > & obj,
const Vector< Real > & x,
const std::vector< Real > & xstat,
Real & tol )
inlineoverride

Definition at line 212 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ updateGradient()

template<class Real>
void ROL::SpectralRisk< Real >::updateGradient ( Objective< Real > & obj,
const Vector< Real > & x,
const std::vector< Real > & xstat,
Real & tol )
inlineoverride

Definition at line 219 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ updateHessVec()

template<class Real>
void ROL::SpectralRisk< Real >::updateHessVec ( Objective< Real > & obj,
const Vector< Real > & v,
const std::vector< Real > & vstat,
const Vector< Real > & x,
const std::vector< Real > & xstat,
Real & tol )
inlineoverride

Definition at line 226 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ getValue()

template<class Real>
Real ROL::SpectralRisk< Real >::getValue ( const Vector< Real > & x,
const std::vector< Real > & xstat,
SampleGenerator< Real > & sampler )
inlineoverride

Definition at line 235 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ getGradient()

template<class Real>
void ROL::SpectralRisk< Real >::getGradient ( Vector< Real > & g,
std::vector< Real > & gstat,
const Vector< Real > & x,
const std::vector< Real > & xstat,
SampleGenerator< Real > & sampler )
inlineoverride

Definition at line 241 of file ROL_SpectralRisk.hpp.

References mqq_.

◆ getHessVec()

template<class Real>
void ROL::SpectralRisk< Real >::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 )
inlineoverride

Definition at line 249 of file ROL_SpectralRisk.hpp.

References mqq_.

Member Data Documentation

◆ mqq_

◆ plusFunction_

template<class Real>
ROL::Ptr<PlusFunction<Real> > ROL::SpectralRisk< Real >::plusFunction_
private

Definition at line 58 of file ROL_SpectralRisk.hpp.

Referenced by buildMixedQuantile(), and checkInputs().

◆ wts_

template<class Real>
std::vector<Real> ROL::SpectralRisk< Real >::wts_
private

Definition at line 60 of file ROL_SpectralRisk.hpp.

Referenced by buildMixedQuantile().

◆ pts_

template<class Real>
std::vector<Real> ROL::SpectralRisk< Real >::pts_
private

Definition at line 61 of file ROL_SpectralRisk.hpp.

Referenced by buildMixedQuantile().


The documentation for this class was generated from the following file: