ROL
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ROL::CVaR< Real > Class Template Reference

Provides an interface for a convex combination of the expected value and the conditional value-at-risk. More...

#include <ROL_CVaR.hpp>

+ Inheritance diagram for ROL::CVaR< Real >:

Public Member Functions

 CVaR (const Real prob, const Real coeff, const Teuchos::RCP< PlusFunction< Real > > &pf)
 Constructor. More...
 
 CVaR (Teuchos::ParameterList &parlist)
 Constructor. More...
 
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)
 

Private Member Functions

void checkInputs (void) const
 

Private Attributes

Teuchos::RCP< PlusFunction< Real > > plusFunction_
 
Real prob_
 
Real coeff_
 
Teuchos::RCP< Vector< Real > > dualVector_
 
Real xvar_
 
Real vvar_
 
bool firstReset_
 

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::CVaR< Real >

Provides an interface for a convex combination of the expected value and the conditional value-at-risk.

The conditional value-at-risk (also called the average value-at-risk or the expected shortfall) with confidence level \(0\le \beta < 1\) is

\[ \mathcal{R}(X) = \inf_{t\in\mathbb{R}} \left\{ t + \frac{1}{1-\beta} \mathbb{E}\left[(X-t)_+\right] \right\} \]

where \((x)_+ = \max\{0,x\}\). If the distribution of \(X\) is continuous, then \(\mathcal{R}\) is the conditional expectation of \(X\) exceeding the \(\beta\)-quantile of \(X\) and the optimal \(t\) is the \(\beta\)-quantile. Additionally, \(\mathcal{R}\) is a law-invariant coherent risk measure. ROL implements this by augmenting the optimization vector \(x_0\) with the parameter \(t\), then minimizes jointly for \((x_0,t)\).

When using derivative-based optimization, the user can provide a smooth approximation of \((\cdot)_+\) using the ROL::PlusFunction class.

Definition at line 79 of file ROL_CVaR.hpp.

Constructor & Destructor Documentation

◆ CVaR() [1/2]

template<class Real >
ROL::CVaR< Real >::CVaR ( const Real  prob,
const Real  coeff,
const Teuchos::RCP< PlusFunction< Real > > &  pf 
)
inline

Constructor.

Parameters
[in]probis the confidence level
[in]coeffis the convex combination parameter (coeff=0 corresponds to the expected value whereas coeff=1 corresponds to the conditional value-at-risk)
[in]pfis the plus function or an approximation

Definition at line 112 of file ROL_CVaR.hpp.

References ROL::CVaR< Real >::checkInputs().

◆ CVaR() [2/2]

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

Constructor.

Parameters
[in]parlistis a parameter list specifying inputs

parlist should contain sublists "SOL"->"Risk Measure"->"CVaR" and within the "CVaR" sublist should have the following parameters

  • "Confidence Level" (between 0 and 1)
  • "Convex Combination Parameter" (between 0 and 1)
  • A sublist for plus function information.

Definition at line 129 of file ROL_CVaR.hpp.

References ROL::CVaR< Real >::checkInputs(), ROL::CVaR< Real >::coeff_, ROL::CVaR< Real >::plusFunction_, and ROL::CVaR< Real >::prob_.

Member Function Documentation

◆ checkInputs()

template<class Real >
void ROL::CVaR< Real >::checkInputs ( void  ) const
inlineprivate

◆ reset() [1/2]

template<class Real >
void ROL::CVaR< 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 142 of file ROL_CVaR.hpp.

References ROL::CVaR< Real >::dualVector_, ROL::CVaR< Real >::firstReset_, ROL::RiskMeasure< Real >::reset(), and ROL::CVaR< Real >::xvar_.

Referenced by ROL::CVaR< Real >::reset().

◆ reset() [2/2]

template<class Real >
void ROL::CVaR< 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 152 of file ROL_CVaR.hpp.

References ROL::RiskVector< Real >::getStatistic(), ROL::RiskVector< Real >::getVector(), ROL::CVaR< Real >::reset(), and ROL::CVaR< Real >::vvar_.

◆ update() [1/3]

template<class Real >
void ROL::CVaR< 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 160 of file ROL_CVaR.hpp.

References ROL::CVaR< Real >::coeff_, ROL::CVaR< Real >::plusFunction_, ROL::CVaR< Real >::prob_, and ROL::CVaR< Real >::xvar_.

◆ update() [2/3]

template<class Real >
void ROL::CVaR< 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 166 of file ROL_CVaR.hpp.

References ROL::CVaR< Real >::coeff_, ROL::CVaR< Real >::plusFunction_, ROL::CVaR< Real >::prob_, and ROL::CVaR< Real >::xvar_.

◆ update() [3/3]

template<class Real >
void ROL::CVaR< 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 174 of file ROL_CVaR.hpp.

References ROL::CVaR< Real >::coeff_, ROL::CVaR< Real >::plusFunction_, ROL::CVaR< Real >::prob_, ROL::CVaR< Real >::vvar_, and ROL::CVaR< Real >::xvar_.

◆ getValue()

template<class Real >
Real ROL::CVaR< 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 186 of file ROL_CVaR.hpp.

References ROL::CVaR< Real >::coeff_, ROL::SampleGenerator< Real >::sumAll(), and ROL::CVaR< Real >::xvar_.

◆ getGradient()

template<class Real >
void ROL::CVaR< 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 193 of file ROL_CVaR.hpp.

References ROL::CVaR< Real >::coeff_, ROL::CVaR< Real >::dualVector_, ROL::CVaR< Real >::prob_, ROL::RiskVector< Real >::setStatistic(), ROL::RiskVector< Real >::setVector(), and ROL::SampleGenerator< Real >::sumAll().

◆ getHessVec()

template<class Real >
void ROL::CVaR< 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 205 of file ROL_CVaR.hpp.

References ROL::CVaR< Real >::coeff_, ROL::CVaR< Real >::dualVector_, ROL::CVaR< Real >::prob_, ROL::RiskVector< Real >::setStatistic(), ROL::RiskVector< Real >::setVector(), and ROL::SampleGenerator< Real >::sumAll().

Member Data Documentation

◆ plusFunction_

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

◆ prob_

template<class Real >
Real ROL::CVaR< Real >::prob_
private

◆ coeff_

template<class Real >
Real ROL::CVaR< Real >::coeff_
private

◆ dualVector_

template<class Real >
Teuchos::RCP<Vector<Real> > ROL::CVaR< Real >::dualVector_
private

◆ xvar_

template<class Real >
Real ROL::CVaR< Real >::xvar_
private

◆ vvar_

template<class Real >
Real ROL::CVaR< Real >::vvar_
private

Definition at line 88 of file ROL_CVaR.hpp.

Referenced by ROL::CVaR< Real >::reset(), and ROL::CVaR< Real >::update().

◆ firstReset_

template<class Real >
bool ROL::CVaR< Real >::firstReset_
private

Definition at line 90 of file ROL_CVaR.hpp.

Referenced by ROL::CVaR< Real >::reset().


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