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

Provides the interface to implement risk measures. More...

#include <ROL_RiskMeasure.hpp>

Public Member Functions

virtual ~RiskMeasure ()
 
 RiskMeasure (void)
 
void setRiskVectorInfo (const int comp, const int index)
 
int getComponent (void) const
 
int getIndex (void) const
 
virtual void reset (ROL::Ptr< Vector< Real > > &x0, const Vector< Real > &x)
 Reset internal risk measure storage. Called for value and gradient computation. More...
 
virtual void reset (ROL::Ptr< Vector< Real > > &x0, const Vector< Real > &x, ROL::Ptr< Vector< Real > > &v0, const Vector< Real > &v)
 Reset internal risk measure storage. Called for Hessian-times-a-vector computation. More...
 
virtual void update (const Real val, const Real weight)
 Update internal risk measure storage for value computation. More...
 
virtual void update (const Real val, const Vector< Real > &g, const Real weight)
 Update internal risk measure storage for gradient computation. More...
 
virtual 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...
 
virtual Real getValue (SampleGenerator< Real > &sampler)
 Return risk measure value. More...
 
virtual void getGradient (Vector< Real > &g, SampleGenerator< Real > &sampler)
 Return risk measure (sub)gradient. More...
 
virtual void getHessVec (Vector< Real > &hv, SampleGenerator< Real > &sampler)
 Return risk measure Hessian-times-a-vector. More...
 

Protected Attributes

Real val_
 
Real gv_
 
ROL::Ptr< Vector< Real > > g_
 
ROL::Ptr< Vector< Real > > hv_
 
ROL::Ptr< Vector< Real > > dualVector_
 
bool firstReset_
 
int comp_
 
int index_
 

Detailed Description

template<class Real>
class ROL::RiskMeasure< Real >

Provides the interface to implement risk measures.

Let \((\Omega,\mathcal{F},\mathbb{P})\) be a complete space. Here, \(\Omega\) is the set of outcomes, \(\mathcal{F}\subseteq 2^\Omega\) is a \(\sigma\)-algebra of events and \(\mathbb{P}:\mathcal{F}\to[0,1]\) is a probability measure. Moreover, let \(\mathcal{X}\) be a class of random variables. A risk measure is an extended real-valued functional that associates numerical values to random variables, i.e., \(\mathcal{R}:\mathcal{X}\to\mathbb{R}\cup\{+\infty\}\). In most cases, \(\mathcal{X} = L^p(\Omega,\mathcal{F},\mathbb{P})\) for some \(1\le p\le \infty\).

There are a number of classifications for risk measures. One important class are the coherent risk measures. \(\mathcal{R}\) is coherent if it satisfies the following four axioms:

Another useful characterization is law invariance. \(\mathcal{R}\) is law invariant if \(\mathcal{R}(X) = \mathcal{R}(X')\) whenever \(\mathbb{P}(X\le t) = \mathbb{P}(X'\le t)\) for all \(t\in\mathbb{R}\). Law invariant risk measures are only functions of the distribution of the input random variable.

ROL's risk measure base class is written in a way to exploit parallel sampling. General risk measures may depend on global information such as the expected value of a random variable, \(\mathbb{E}[X]\). Thus, ROL::RiskMeasure contains functions to update intermediate information and to compute desired quantities such as risk values, gradients and Hessians applied to vectors.

Definition at line 96 of file ROL_RiskMeasure.hpp.

Constructor & Destructor Documentation

template<class Real >
virtual ROL::RiskMeasure< Real >::~RiskMeasure ( )
inlinevirtual

Definition at line 109 of file ROL_RiskMeasure.hpp.

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

Definition at line 111 of file ROL_RiskMeasure.hpp.

Member Function Documentation

template<class Real >
void ROL::RiskMeasure< Real >::setRiskVectorInfo ( const int  comp,
const int  index 
)
inline
template<class Real >
int ROL::RiskMeasure< Real >::getComponent ( void  ) const
inline

Definition at line 119 of file ROL_RiskMeasure.hpp.

References ROL::RiskMeasure< Real >::comp_.

template<class Real >
int ROL::RiskMeasure< Real >::getIndex ( void  ) const
inline

Definition at line 123 of file ROL_RiskMeasure.hpp.

References ROL::RiskMeasure< Real >::index_.

template<class Real >
virtual void ROL::RiskMeasure< Real >::reset ( ROL::Ptr< 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, \(x\) carries \(x_0\) and any statistics (scalars) associated with the risk measure.

Definition at line 136 of file ROL_RiskMeasure.hpp.

References ROL::RiskMeasure< Real >::dualVector_, ROL::RiskMeasure< Real >::firstReset_, ROL::RiskMeasure< Real >::g_, ROL::RiskMeasure< Real >::gv_, ROL::RiskMeasure< Real >::hv_, ROL::RiskMeasure< Real >::val_, and zero.

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

template<class Real >
virtual void ROL::RiskMeasure< Real >::reset ( ROL::Ptr< Vector< Real > > &  x0,
const Vector< Real > &  x,
ROL::Ptr< Vector< Real > > &  v0,
const Vector< Real > &  v 
)
inlinevirtual

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

  @param[out]  x0 is a user-provided optimization vector
  @param[in]   x  is a (potentially) augmented risk vector
  @param[out]  v0 is a user-provided direction vector
  @param[in]   v  is a (potentially) augmented risk vector

  On input, \form#44 carries \form#416 and any statistics (scalars)
  associated with the risk measure.  Similarly, \form#76 carries

\(v_0\) and any statistics (scalars) associated with the risk measure.

Definition at line 165 of file ROL_RiskMeasure.hpp.

References ROL::RiskMeasure< Real >::reset().

template<class Real >
virtual void ROL::RiskMeasure< 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

Definition at line 180 of file ROL_RiskMeasure.hpp.

References ROL::RiskMeasure< Real >::val_.

template<class Real >
virtual void ROL::RiskMeasure< 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

Definition at line 193 of file ROL_RiskMeasure.hpp.

References ROL::RiskMeasure< Real >::g_.

template<class Real >
virtual void ROL::RiskMeasure< 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

Definition at line 212 of file ROL_RiskMeasure.hpp.

References ROL::RiskMeasure< Real >::hv_.

template<class Real >
virtual Real ROL::RiskMeasure< 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\).

Definition at line 225 of file ROL_RiskMeasure.hpp.

References ROL::SampleGenerator< Real >::sumAll(), and ROL::RiskMeasure< Real >::val_.

template<class Real >
virtual void ROL::RiskMeasure< 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\).

Definition at line 242 of file ROL_RiskMeasure.hpp.

References ROL::RiskMeasure< Real >::dualVector_, ROL::RiskMeasure< Real >::g_, and ROL::SampleGenerator< Real >::sumAll().

template<class Real >
virtual void ROL::RiskMeasure< 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\).

Definition at line 258 of file ROL_RiskMeasure.hpp.

References ROL::RiskMeasure< Real >::dualVector_, ROL::RiskMeasure< Real >::hv_, and ROL::SampleGenerator< Real >::sumAll().

Member Data Documentation

template<class Real >
Real ROL::RiskMeasure< Real >::val_
protected
template<class Real >
Real ROL::RiskMeasure< Real >::gv_
protected

Definition at line 99 of file ROL_RiskMeasure.hpp.

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

template<class Real >
ROL::Ptr<Vector<Real> > ROL::RiskMeasure< Real >::g_
protected
template<class Real >
ROL::Ptr<Vector<Real> > ROL::RiskMeasure< Real >::hv_
protected
template<class Real >
ROL::Ptr<Vector<Real> > ROL::RiskMeasure< Real >::dualVector_
protected
template<class Real >
bool ROL::RiskMeasure< Real >::firstReset_
protected

Definition at line 103 of file ROL_RiskMeasure.hpp.

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

template<class Real >
int ROL::RiskMeasure< Real >::comp_
protected
template<class Real >
int ROL::RiskMeasure< Real >::index_
protected

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