Entropy pooling Prior (b)

A new tail view formulation adds a method of the lowering function of each measure that it serves. AbstractEntropyPoolingViewFormulation states the contract. The private page documents the other names of this topic.

PortfolioOptimisers.ep_add_cvar_view! — Function
ep_add_cvar_view!(tvs::AbstractVector, alg::CVaRVF,
                  x::AbstractVector{<:VecNum}, coef::VecNum, op::Symbol, rhs::Number,
                  alpha::Number, w::VecNum, pv::Number, eqn::AbstractString)

Lower one conditional value-at-risk view into the tail view constraint that its formulation needs.

Algorithm

  1. LinearConditionalValueatRiskView checks the three conditions of the Validation section. Then it appends one LinearConditionalValueatRiskViewConstraint that holds x, coef, alpha and rhs.
  2. IntegerConditionalValueatRiskView sorts the loss series of each asset that the view names. The result is the ascending order o. It finds the length sb of the tail window of that asset with ep_sbar.
  3. It keeps the last sb positions of o as ord[k], and the losses at those positions as xw[k].
  4. It appends one IntegerConditionalValueatRiskViewConstraint that holds those windows, coef, alpha, op and rhs.
  5. SequentialTailView orients the view and splits its assets with ep_sequential_sides. It builds a SequentialConditionalValueatRiskViewConstraint with an empty surrogate row. It reads the first row at the prior w with ep_sequential_start, and appends the constraint.

Arguments

  • tvs: The vector of tail view constraints, to which the function appends.
  • alg: The formulation of the view.
  • x: The loss series of each asset that the view names.
  • coef: The coefficient that the view gives the CVaR of each asset.
  • op: The comparison operator of the view.
  • rhs: The target value of the view.
  • alpha: The significance level of the view.
  • w: The prior probability weights.
  • pv: The prior value of the left hand side of the view.
  • eqn: The equation of the view, for the error messages.

Validation

  • LinearConditionalValueatRiskView needs coefficients of one sign, an operator other than <=, and, for an equality, a target at or above the prior value of the left hand side.

Returns

  • nothing: The function mutates tvs in-place.

Related

source
PortfolioOptimisers.ep_add_evar_view! — Function
ep_add_evar_view!(epc::AbstractDict, tvs::AbstractVector,
                  alg::EVaRVF,
                  x::AbstractVector{<:VecNum}, coef::VecNum, alpha::Number, op::Symbol,
                  rhs::Number, w::VecNum, zstar::VecNum, pv::Number, eqn::AbstractString;
                  args::Tuple = (), kwargs::NamedTuple = (;),
                  zlo_frac::Option{<:Number} = nothing)

Lower one entropic value-at-risk view into the constraints that its formulation needs.

ConicEntropicValueatRiskView and SequentialTailView each make one tail view constraint. GridTailView makes linear rows on the posterior probabilities for the lower-bound half of the view, and a tail view constraint for the upper-bound half. So an equality view gets both.

Algorithm

  1. ConicEntropicValueatRiskView checks the three conditions of the Validation section. Then it appends one ConicEntropicValueatRiskViewConstraint that holds x, coef, alpha and rhs.
  2. GridTailView checks that the view names one asset. It normalises w to sum to one, which gives wi.
  3. It builds the grid z of dual variables with ep_evar_grid.
  4. It keeps the points whose row is finite, as keep, and raises an error if keep is empty. For the upper-bound half, it keeps only the points whose bound is positive, and raises an error if no point has a positive bound.
  5. For the lower-bound half of the view, it builds the row of each kept point with ep_evar_grid_row. It multiplies the row by minus one, so that the row has the <= sense of the key :ineq, and adds the row to epc under that key with add_ep_constraint!.
  6. For the upper-bound half of the view, it appends one GridEntropicValueatRiskViewConstraint that holds x, the kept grid, alpha, rhs and the big-M multiplier M.
  7. SequentialTailView orients the view and splits its assets with ep_sequential_sides. It builds a SequentialEntropicValueatRiskViewConstraint with an empty surrogate row. It reads the first row at the prior w with ep_sequential_start, and appends the constraint.

Arguments

  • epc: The dictionary of entropy pooling constraints, from keys to (lhs, rhs) pairs.
  • tvs: The vector of tail view constraints, to which the function appends.
  • alg: The formulation of the view. A grid formulation also holds the number of steps and the tolerance of the anchor. A sequential formulation also holds the number of re-solves and their tolerance.
  • x: The loss series of each asset that the view names.
  • coef: The coefficient that the view gives the EVaR of each asset.
  • alpha: The significance level of the view.
  • op: The comparison operator of the view.
  • rhs: The target value of the view.
  • w: The prior probability weights. The search for the centre of the grid starts from them. A sequential view reads its first surrogate row at them.
  • zstar: The dual variable that attains the prior EVaR of each asset.
  • pv: The prior value of the left hand side of the view.
  • eqn: The equation of the view, for the error messages.
  • args: Additional positional arguments passed to the optimisation function.
  • kwargs: Additional keyword arguments passed to the optimisation function.
  • zlo_frac: The lower end of the bracket of the dual variable, as a fraction of the upper end, which goes to ep_evar.

Validation

  • ConicEntropicValueatRiskView needs coefficients of one sign, an operator other than <=, and, for an equality, a target at or above the prior value of the left hand side.
  • GridTailView needs one asset. It also needs at least one grid point whose row is finite and, if the view has an upper-bound half, whose bound is positive. ep_evar_grid_row overflows at a dual variable near zero, and its bound underflows to zero there. Part of the grid is near zero when pct goes near one. All of the grid is near zero when alpha * T is less than one, because the minimiser of ep_evar is then at the end of its bracket. The function drops these points, and raises an error if it keeps no point.

Returns

  • nothing: The function mutates epc and tvs in-place.

Related

source
PortfolioOptimisers.ep_add_rlvar_view! — Function
ep_add_rlvar_view!(epc::AbstractDict, tvs::AbstractVector,
                   alg::RLVaRVF,
                   x::AbstractVector{<:VecNum}, coef::VecNum, alpha::Number,
                   kappa::Number, op::Symbol, rhs::Number, w::VecNum, zstar::VecNum,
                   pv::Number, eqn::AbstractString; args::Tuple = (),
                   kwargs::NamedTuple = (;),
                   bracket::Option{<:RelativisticValueatRiskViewBracket} = nothing)

Lower one relativistic value-at-risk view into the constraints that its formulation needs.

ConicRelativisticValueatRiskView and SequentialTailView each make one tail view constraint. GridTailView makes linear rows on the posterior probabilities for the lower-bound half of the view, and a tail view constraint for the upper-bound half. So an equality view gets both.

Algorithm

  1. ConicRelativisticValueatRiskView checks the three conditions of the Validation section. Then it appends one ConicRelativisticValueatRiskViewConstraint that holds x, coef, alpha, kappa and rhs.
  2. GridTailView checks that the view names one asset. It normalises w to sum to one, which gives wi.
  3. It builds the grid t, z of primal points with ep_rlvar_grid.
  4. It keeps the points whose row is finite, as keep, and raises an error if keep is empty. For the upper-bound half, it keeps only the points whose bound is positive, and raises an error if no point has a positive bound.
  5. For the lower-bound half of the view, it builds the row of each kept point with ep_rlvar_grid_row. It multiplies the row by minus one, so that the row has the <= sense of the key :ineq, and adds the row to epc under that key with add_ep_constraint!.
  6. For the upper-bound half of the view, it appends one GridRelativisticValueatRiskViewConstraint that holds x, the kept grid, alpha, kappa, rhs and the big-M multiplier M.
  7. SequentialTailView orients the view and splits its assets with ep_sequential_sides. It builds a SequentialRelativisticValueatRiskViewConstraint with an empty surrogate row. It reads the first row at the prior w with ep_sequential_start, and appends the constraint.

Arguments

  • epc: The dictionary of entropy pooling constraints, from keys to (lhs, rhs) pairs.
  • tvs: The vector of tail view constraints, to which the function appends.
  • alg: The formulation of the view. A grid formulation also holds the number of steps and the tolerance of the anchor. A sequential formulation also holds the number of re-solves and their tolerance.
  • x: The loss series of each asset that the view names.
  • coef: The coefficient that the view gives the RLVaR of each asset.
  • alpha: The significance level of the view.
  • kappa: The deformation parameter of the view.
  • op: The comparison operator of the view.
  • rhs: The target value of the view.
  • w: The prior probability weights. The search for the centre of the grid starts from them. If that search does not converge, they set the shift of each grid point. A sequential view reads its first surrogate row at them.
  • zstar: The dual variable that attains the prior RLVaR of each asset.
  • pv: The prior value of the left hand side of the view. With rhs, it sets the translation of a grid that has its centre at the prior.
  • eqn: The equation of the view, for the error messages.
  • args: Additional positional arguments passed to the optimisation function.
  • kwargs: Additional keyword arguments passed to the optimisation function.
  • bracket: The spans of the searches, which go to ep_rlvar and ep_rlvar_shift.

Validation

  • ConicRelativisticValueatRiskView needs coefficients of one sign, an operator other than <=, and, for an equality, a target at or above the prior value of the left hand side.
  • GridTailView needs one asset. It also needs at least one grid point whose row is finite and, if the view has an upper-bound half, whose bound is positive. ep_rlvar_tail overflows at a dual variable near zero, and the grid is near zero when kappa goes near one. The bound rhs - t - z * ln_kappa(1 / (alpha * T)) of a point is at or below zero when the target is below the value that the point can reach. The function drops these points, and raises an error if it keeps no point.

Returns

  • nothing: The function mutates epc and tvs in-place.

Related

source