70 :
RiskMeasure<Real>(), plusFunction_(pf), xvar_(0.0), vvar_(0.0), firstReset_(true) {
71 prob_ = ((prob >= 0.0) ? ((prob <= 1.0) ? prob : 0.5) : 0.5);
72 coeff_ = ((coeff >= 0.0) ? ((coeff <= 1.0) ? coeff : 1.0) : 1.0);
75 CVaR( Teuchos::ParameterList &parlist )
76 :
RiskMeasure<Real>(), xvar_(0.0), vvar_(0.0), firstReset_(true) {
77 Teuchos::ParameterList &list
78 = parlist.sublist(
"SOL").sublist(
"Risk Measure").sublist(
"CVaR");
80 Real prob = list.get(
"Confidence Level",0.5);
81 prob_ = ((prob >= 0.0) ? ((prob <= 1.0) ? prob : 0.5) : 0.5);
82 Real coeff = list.get(
"Convex Combination Parameter", 1.0);
83 coeff_ = ((coeff >= 0.0) ? ((coeff <= 1.0) ? coeff : 1.0) : 1.0);
93 dualVector_ = (x0->dual()).clone();
108 void update(
const Real val,
const Real weight) {
109 Real pf = plusFunction_->evaluate(val-xvar_,0);
114 Real pf = plusFunction_->evaluate(val-xvar_,1);
116 Real c = (1.0-
coeff_) + coeff_/(1.0-prob_)*pf;
122 Real pf1 = plusFunction_->evaluate(val-xvar_,1);
123 Real pf2 = plusFunction_->evaluate(val-xvar_,2);
125 Real c = pf2*coeff_/(1.0-
prob_)*(gv-vvar_);
127 c = (1.0-
coeff_) + coeff_/(1.0-prob_)*pf1;
134 sampler.
sumAll(&val,&cvar,1);
135 cvar += coeff_*
xvar_;
143 sampler.
sumAll(&val,&var,1);
146 var *= -coeff_/(1.0-
prob_);
156 sampler.
sumAll(&val,&var,1);
159 var *= coeff_/(1.0-
prob_);
Teuchos::RCP< Vector< Real > > dualVector_
Real getValue(SampleGenerator< Real > &sampler)
void getGradient(Vector< Real > &g, SampleGenerator< Real > &sampler)
void getHessVec(Vector< Real > &hv, SampleGenerator< Real > &sampler)
void update(const Real val, const Real weight)
const Real getStatistic(const int i=0) const
void update(const Real val, const Vector< Real > &g, const Real weight)
Defines the linear algebra or vector space interface.
void sumAll(Real *input, Real *output, int dim) const
void setVector(const Vector< Real > &vec)
Teuchos::RCP< const Vector< Real > > getVector() const
void setStatistic(const Real stat)
CVaR(Real prob, Real coeff, Teuchos::RCP< PlusFunction< Real > > &pf)
Teuchos::RCP< PlusFunction< Real > > plusFunction_
void update(const Real val, const Vector< Real > &g, const Real gv, const Vector< Real > &hv, const Real weight)
void reset(Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x)
void reset(Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x, Teuchos::RCP< Vector< Real > > &v0, const Vector< Real > &v)
virtual void reset(Teuchos::RCP< Vector< Real > > &x0, const Vector< Real > &x)
CVaR(Teuchos::ParameterList &parlist)