ROL
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
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 Teuchos::RCP< Distribution< Real > > &dist, const int nQuad, const Teuchos::RCP< PlusFunction< Real > > &pf)
 
 SpectralRisk (Teuchos::ParameterList &parlist)
 
 SpectralRisk (const std::vector< Real > &pts, const std::vector< Real > &wts, const Teuchos::RCP< PlusFunction< Real > > &pf)
 
Real computeStatistic (const Vector< Real > &x) const
 
void reset (Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x)
 Reset internal risk measure storage. Called for value and gradient computation. More...
 
void reset (Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x, Teuchos::RCP< Vector< Real > > &v0, const Vector< Real > &v)
 Reset internal risk measure storage. Called for Hessian-times-a-vector computation. More...
 
void update (const Real val, const Real weight)
 Update internal risk measure storage for value computation. More...
 
void update (const Real val, const Vector< Real > &g, const Real weight)
 Update internal risk measure storage for gradient computation. More...
 
void update (const Real val, const Vector< Real > &g, const Real gv, const Vector< Real > &hv, const Real weight)
 Update internal risk measure storage for Hessian-time-a-vector computation. More...
 
Real getValue (SampleGenerator< Real > &sampler)
 Return risk measure value. More...
 
void getGradient (Vector< Real > &g, SampleGenerator< Real > &sampler)
 Return risk measure (sub)gradient. More...
 
void getHessVec (Vector< Real > &hv, SampleGenerator< Real > &sampler)
 Return risk measure Hessian-times-a-vector. More...
 
- Public Member Functions inherited from ROL::RiskMeasure< Real >
virtual ~RiskMeasure ()
 
 RiskMeasure (void)
 

Protected Member Functions

void buildMixedQuantile (const std::vector< Real > &pts, const std::vector< Real > &wts, const Teuchos::RCP< PlusFunction< Real > > &pf)
 
void buildQuadFromDist (std::vector< Real > &pts, std::vector< Real > &wts, const int nQuad, const Teuchos::RCP< 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 (Teuchos::RCP< Distribution< Real > > &dist=Teuchos::null) const
 

Private Attributes

Teuchos::RCP< MixedQuantileQuadrangle< Real > > mqq_
 
Teuchos::RCP< PlusFunction< Real > > plusFunction_
 
std::vector< Real > wts_
 
std::vector< Real > pts_
 

Additional Inherited Members

- Protected Attributes inherited from ROL::RiskMeasure< Real >
Real val_
 
Real gv_
 
Teuchos::RCP< Vector< Real > > g_
 
Teuchos::RCP< Vector< Real > > hv_
 
Teuchos::RCP< Vector< Real > > dualVector_
 
bool firstReset_
 

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::MixedQuantileQuadrangle risk measure. When using derivative-based optimization, the user can provide a smooth approximation of \((\cdot)_+\) using the ROL::PlusFunction class.

Definition at line 89 of file ROL_SpectralRisk.hpp.

Constructor & Destructor Documentation

◆ SpectralRisk() [1/4]

template<class Real>
ROL::SpectralRisk< Real >::SpectralRisk ( void  )
inline

Definition at line 165 of file ROL_SpectralRisk.hpp.

◆ SpectralRisk() [2/4]

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

◆ SpectralRisk() [3/4]

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

◆ SpectralRisk() [4/4]

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

Member Function Documentation

◆ checkInputs()

template<class Real>
void ROL::SpectralRisk< Real >::checkInputs ( Teuchos::RCP< Distribution< Real > > &  dist = Teuchos::null) const
inlineprivate

◆ buildMixedQuantile()

template<class Real>
void ROL::SpectralRisk< Real >::buildMixedQuantile ( const std::vector< Real > &  pts,
const std::vector< Real > &  wts,
const Teuchos::RCP< 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 Teuchos::RCP< Distribution< Real > > &  dist 
) const
inlineprotected

Definition at line 119 of file ROL_SpectralRisk.hpp.

Referenced by ROL::SpectralRisk< Real >::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 145 of file ROL_SpectralRisk.hpp.

Referenced by ROL::SpectralRisk< Real >::SpectralRisk().

◆ computeStatistic()

template<class Real>
Real ROL::SpectralRisk< Real >::computeStatistic ( const Vector< Real > &  x) const
inline

◆ reset() [1/2]

template<class Real>
void ROL::SpectralRisk< Real >::reset ( Teuchos::RCP< Vector< Real > > &  x0,
const Vector< Real > &  x 
)
inlinevirtual

Reset internal risk measure storage. Called for value and gradient computation.

Parameters
[out]x0is a user-provided optimization vector
[in]xis a (potentially) augmented risk vector
   On input, \form#56 carries \form#323 and any statistics (scalars)
   associated with the risk measure. 

Reimplemented from ROL::RiskMeasure< Real >.

Definition at line 220 of file ROL_SpectralRisk.hpp.

References ROL::SpectralRisk< Real >::mqq_.

◆ reset() [2/2]

template<class Real>
void ROL::SpectralRisk< Real >::reset ( Teuchos::RCP< Vector< Real > > &  x0,
const Vector< Real > &  x,
Teuchos::RCP< Vector< Real > > &  v0,
const Vector< Real > &  v 
)
inlinevirtual

Reset internal risk measure storage. Called for Hessian-times-a-vector computation.

Parameters
[out]x0is a user-provided optimization vector
[in]xis a (potentially) augmented risk vector
[out]v0is a user-provided direction vector
[in]vis a (potentially) augmented risk vector
   On input, \form#56 carries \form#323 and any statistics (scalars)
   associated with the risk measure.  Similarly, \form#37 carries
\(v_0\) and any statistics (scalars) associated with the risk measure.

Reimplemented from ROL::RiskMeasure< Real >.

Definition at line 224 of file ROL_SpectralRisk.hpp.

References ROL::SpectralRisk< Real >::mqq_.

◆ update() [1/3]

template<class Real>
void ROL::SpectralRisk< Real >::update ( const Real  val,
const Real  weight 
)
inlinevirtual

Update internal risk measure storage for value computation.

Parameters
[in]valis the value of the random variable objective function at the current sample point
[in]weightis the weight associated with the current sample point

Reimplemented from ROL::RiskMeasure< Real >.

Definition at line 229 of file ROL_SpectralRisk.hpp.

References ROL::SpectralRisk< Real >::mqq_.

◆ update() [2/3]

template<class Real>
void ROL::SpectralRisk< Real >::update ( const Real  val,
const Vector< Real > &  g,
const Real  weight 
)
inlinevirtual

Update internal risk measure storage for gradient computation.

Parameters
[in]valis the value of the random variable objective function at the current sample point
[in]gis the gradient of the random variable objective function at the current sample point
[in]weightis the weight associated with the current sample point

Reimplemented from ROL::RiskMeasure< Real >.

Definition at line 233 of file ROL_SpectralRisk.hpp.

References ROL::SpectralRisk< Real >::mqq_.

◆ update() [3/3]

template<class Real>
void ROL::SpectralRisk< Real >::update ( const Real  val,
const Vector< Real > &  g,
const Real  gv,
const Vector< Real > &  hv,
const Real  weight 
)
inlinevirtual

Update internal risk measure storage for Hessian-time-a-vector computation.

Parameters
[in]valis the value of the random variable objective function at the current sample point
[in]gis the gradient of the random variable objective function at the current sample point
[in]gvis the gradient of the random variable objective function at the current sample point applied to the vector v0
[in]hvis the Hessian of the random variable objective function at the current sample point applied to the vector v0
[in]weightis the weight associated with the current sample point

Reimplemented from ROL::RiskMeasure< Real >.

Definition at line 237 of file ROL_SpectralRisk.hpp.

References ROL::SpectralRisk< Real >::mqq_.

◆ getValue()

template<class Real>
Real ROL::SpectralRisk< Real >::getValue ( SampleGenerator< Real > &  sampler)
inlinevirtual

Return risk measure value.

Parameters
[in]sampleris 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::RiskMeasure< Real >.

Definition at line 242 of file ROL_SpectralRisk.hpp.

References ROL::SpectralRisk< Real >::mqq_.

◆ getGradient()

template<class Real>
void ROL::SpectralRisk< Real >::getGradient ( Vector< Real > &  g,
SampleGenerator< Real > &  sampler 
)
inlinevirtual

Return risk measure (sub)gradient.

Parameters
[out]gis the (sub)gradient of the risk measure
[in]sampleris 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::RiskMeasure< Real >.

Definition at line 246 of file ROL_SpectralRisk.hpp.

References ROL::SpectralRisk< Real >::mqq_.

◆ getHessVec()

template<class Real>
void ROL::SpectralRisk< Real >::getHessVec ( Vector< Real > &  hv,
SampleGenerator< Real > &  sampler 
)
inlinevirtual

Return risk measure Hessian-times-a-vector.

Parameters
[out]hvis the Hessian-times-a-vector of the risk measure
[in]sampleris 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::RiskMeasure< Real >.

Definition at line 250 of file ROL_SpectralRisk.hpp.

References ROL::SpectralRisk< Real >::mqq_.

Member Data Documentation

◆ mqq_

template<class Real>
Teuchos::RCP<MixedQuantileQuadrangle<Real> > ROL::SpectralRisk< Real >::mqq_
private

◆ plusFunction_

template<class Real>
Teuchos::RCP<PlusFunction<Real> > ROL::SpectralRisk< Real >::plusFunction_
private

◆ wts_

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

◆ pts_

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

Definition at line 95 of file ROL_SpectralRisk.hpp.

Referenced by ROL::SpectralRisk< Real >::buildMixedQuantile().


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