Entropy Pooling

PortfolioOptimisers.RhoParsingResultType
struct RhoParsingResult{__T_vars, __T_coef, __T_op, __T_rhs, __T_eqn, __T_ij} <: AbstractParsingResult

Carries a parsed correlation or covariance view together with the asset pairs it names.

It extends ParsingResult with an ij field, which holds one index pair per term of the view, so a downstream routine can place the view in the covariance matrix without parsing the equation again.

Fields

  • vars: Variable names in the parsed constraint expression.
  • coef: Coefficients corresponding to the constraint variables.
  • op: Comparison operator (==, <=, or >=).
  • rhs: Right-hand side of the constraint. A view over a single asset pair carries one value. A view over a pair of groups carries one value per spanned pair, in the order of ij.
  • eqn: Formatted string representation of the constraint equation.
  • ij: Pair of asset indices for correlation-based constraints.

Details

  • Produced by correlation view parsing routines, typically when the constraint involves asset pairs (e.g., "(A, B) == 0.5").
  • The ij field enables downstream routines to map parsed correlation views to the appropriate entries in the correlation matrix.
  • A view over a pair of groups spans one asset pair per element of its ij entry, and emits one constraint row per pair. Its rhs is therefore a vector of the same length, one right-hand side per row. A view over a single asset pair keeps a scalar rhs.
  • Used internally for entropy pooling, Black-Litterman, and other advanced portfolio models that support correlation views.

Related

source
PortfolioOptimisers.H0_EntropyPoolingType
struct H0_EntropyPooling <: AbstractEntropyPoolingAlgorithm

Enforces every view in a single entropy pooling optimisation.

This is the original formulation. It solves once, so it is the cheapest of the three algorithms, and it pins nothing: a higher moment view is free to move a lower moment of the same asset.

Related

References

  • [80] A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
source
PortfolioOptimisers.H1_EntropyPoolingType
struct H1_EntropyPooling <: AbstractEntropyPoolingAlgorithm

Enforces the views in stages, and starts every stage from the prior probabilities.

Each stage carries the constraints of the stages before it, so the posterior is the projection of the prior onto the whole view set. This is the first of the two sequential heuristics.

Related

References

  • [81] A. Vorobets. Sequential entropy pooling heuristics. Available at SSRN 3936392 (2021).
source
PortfolioOptimisers.H2_EntropyPoolingType
struct H2_EntropyPooling <: AbstractEntropyPoolingAlgorithm

Enforces the views in stages, and starts every stage from the previous stage's probabilities.

Each stage carries the constraints of the stages before it, so the view set is the same as H1_EntropyPooling's. What differs is the reference distribution: each stage projects the stage before it rather than the prior. This is the second of the two sequential heuristics.

Related

References

  • [81] A. Vorobets. Sequential entropy pooling heuristics. Available at SSRN 3936392 (2021).
source
PortfolioOptimisers.LogEntropyPoolingType
struct LogEntropyPooling <: AbstractEntropyPoolingOptAlgorithm

Evaluates the entropy pooling objective in log space.

It carries the logarithms of the probabilities throughout, so it never exponentiates an intermediate quantity. Prefer it when a prior probability is small enough that the exponential form loses precision. It minimises the same Kullback-Leibler divergence as ExpEntropyPooling and reaches the same posterior.

Related

References

  • [80] A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
source
PortfolioOptimisers.ExpEntropyPoolingType
struct ExpEntropyPooling <: AbstractEntropyPoolingOptAlgorithm

Evaluates the entropy pooling objective through the exponential of the dual variables.

It recovers each posterior probability from the prior one and the dual variables directly, without carrying logarithms. It minimises the same Kullback-Leibler divergence as LogEntropyPooling and reaches the same posterior.

Related

References

  • [80] A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
source
PortfolioOptimisers.ConditionalValueatRiskEntropyPoolingType
struct ConditionalValueatRiskEntropyPooling{__T_args, __T_kwargs} <: AbstractEntropyPoolingOptimiser

Root-finds the value at risk level that meets a single conditional value-at-risk view.

The recursive route of MeucciEntropyPoolingPrior writes no CVaR constraint. It hunts the level instead: for each candidate it rebuilds the positive-part rows, re-solves the whole entropy pooling problem, and reads the tail mass off the posterior. This type holds the arguments of the Roots.jl call that drives the hunt. Where a group carries more than one view, OptimEntropyPooling takes over through the dm_opt field.

Fields

  • args: Additional positional arguments passed to the optimisation function.
  • kwargs: Additional keyword arguments passed to the optimisation function.

Constructors

ConditionalValueatRiskEntropyPooling(;    args::Tuple = (Roots.Brent(),),    kwargs::NamedTuple = (;)) -> ConditionalValueatRiskEntropyPooling

Keywords correspond to the struct's fields.

Examples

julia> ConditionalValueatRiskEntropyPooling()ConditionalValueatRiskEntropyPooling    args ┼ Tuple{Roots.Brent}: (Roots.Brent(),)  kwargs ┴ @NamedTuple{}: NamedTuple()

Related

References

  • [82] A. Meucci, D. Ardia and S. Keel. Fully flexible extreme views. The Journal of Risk 14, 39–49 (2011).
source
PortfolioOptimisers.OptimEntropyPoolingType
struct OptimEntropyPooling{__T_args, __T_kwargs, __T_sc1, __T_sc2, __T_alg, __T_err} <: AbstractEntropyPoolingOptimiser

Solves the dual of the entropy pooling problem with Optim.jl.

The dual has one variable per constraint rather than one per observation, and it is box constrained, so it is the cheaper route wherever the views reduce to rows of the constraint set. It has no room for an auxiliary variable, so it cannot express a tail view: use JuMPEntropyPooling there. It drives Optim.jl and takes either optimisation algorithm.

Fields

  • args: Additional positional arguments passed to the optimisation function.
  • kwargs: Additional keyword arguments passed to the optimisation function.
  • sc1: Scaling parameter for the objective function.
  • sc2: Scaling parameter for constraint penalties.
  • alg: Entropy pooling optimisation algorithm.
  • err: Tracking error tolerance. Only used when there are multiple cvar views. If nothing, the L2 norm is used.

Constructors

OptimEntropyPooling(;    args::Tuple = (),    kwargs::NamedTuple = (;),    sc1::Number = 1,    sc2::Number = 1e3,    alg::AbstractEntropyPoolingOptAlgorithm = ExpEntropyPooling(),    err::Option{<:NormError} = nothing) -> OptimEntropyPooling

Keywords correspond to the struct's fields.

Validation

  • sc1 >= 0.
  • sc2 >= 0.

Examples

julia> OptimEntropyPooling()OptimEntropyPooling    args ┼ Tuple{}: ()  kwargs ┼ @NamedTuple{}: NamedTuple()     sc1 ┼ Int64: 1     sc2 ┼ Float64: 1000.0     alg ┼ ExpEntropyPooling()     err ┴ nothing

Related

References

  • [80] A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
source
PortfolioOptimisers.JuMPEntropyPoolingType
struct JuMPEntropyPooling{__T_slv, __T_sc1, __T_sc2, __T_so, __T_alg} <: AbstractEntropyPoolingOptimiser

Solves the primal of the entropy pooling problem with JuMP.jl.

The primal carries one variable per observation and writes the divergence as a relative entropy cone. It is the only route that expresses a tail view, because a tail view needs auxiliary variables that the dual has no room for. It drives JuMP.jl and takes either optimisation algorithm.

Fields

  • slv: Solver or vector of solvers.
  • sc1: Scaling parameter for the objective function.
  • sc2: Scaling parameter for constraint penalties.
  • so: Objective scale factor.
  • alg: Entropy pooling optimisation algorithm.

Constructors

JuMPEntropyPooling(;    slv::Slv_VecSlv,    sc1::Number = 1,    sc2::Number = 1e5,    so::Number = 1,    alg::AbstractEntropyPoolingOptAlgorithm = ExpEntropyPooling()) -> JuMPEntropyPooling

Keywords correspond to the struct's fields.

Validation

  • If slv is a vector, !isempty(slv).
  • sc1 >= 0
  • sc2 >= 0
  • so >= 0

Examples

julia> JuMPEntropyPooling(; slv = Solver(; name = :fake_solver, solver = :MySolver))JuMPEntropyPooling  slv ┼ Solver      │          name ┼ Symbol: :fake_solver      │        solver ┼ Symbol: :MySolver      │      settings ┼ nothing      │     check_sol ┼ @NamedTuple{}: NamedTuple()      │   add_bridges ┴ Bool: true  sc1 ┼ Int64: 1  sc2 ┼ Float64: 100000.0   so ┼ Int64: 1  alg ┴ ExpEntropyPooling()

Related

References

  • [80] A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
source
PortfolioOptimisers.AbstractEntropyPoolingOptimiserType
abstract type AbstractEntropyPoolingOptimiser <: AbstractEstimator

Abstract supertype for the optimisers that solve an entropy pooling problem.

A subtype names the numerical route to the posterior probabilities: which package drives the solve, and whether it solves the dual or the primal.

Related

source
PortfolioOptimisers.AbstractEntropyPoolingAlgorithmType
abstract type AbstractEntropyPoolingAlgorithm <: AbstractAlgorithm

Abstract supertype for the algorithms that decide how the views of an entropy pooling problem reach the optimiser.

A subtype states whether every view is enforced in one optimisation or in stages, from the lower moments to the higher ones, and which probabilities each stage starts from.

Related

References

  • [80] A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
  • [81] A. Vorobets. Sequential entropy pooling heuristics. Available at SSRN 3936392 (2021).
source
PortfolioOptimisers.AbstractEntropyPoolingOptAlgorithmType
abstract type AbstractEntropyPoolingOptAlgorithm <: AbstractAlgorithm

Abstract supertype for the algorithms that decide how an entropy pooling optimiser evaluates its objective.

Every subtype minimises the same Kullback-Leibler divergence of the posterior probabilities from the prior ones. They differ only in the arithmetic that evaluates it, so they answer the same problem with the same posterior.

Related

References

  • [80] A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
source
PortfolioOptimisers.add_ep_constraint!Function
add_ep_constraint!(epc::AbstractDict, lhs::MatNum, rhs::VecNum, key::Symbol)

Add an entropy pooling view constraint to the constraint dictionary.

add_ep_constraint! normalises and adds a constraint to the entropy pooling constraint dictionary epc. If a constraint with the same key already exists, it concatenates the new constraint to the existing one. This function is used internally to build the set of linear constraints for entropy pooling optimisation.

Arguments

  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • lhs: Left-hand side constraint matrix.
  • rhs: Right-hand side constraint vector.
  • key: Constraint type key (:eq, :ineq, :feq, :cvar_eq).

Returns

  • nothing: The function mutates epc in-place.

Related

source
PortfolioOptimisers.replace_prior_viewsFunction
replace_prior_views(res::ParsingResult, pr::AbstractPriorResult, sets::UniverseSets,
                    key::Symbol; alpha::Option{<:Number} = nothing,
                    strict::Bool = false)

Replace prior references in view parsing results with their corresponding prior values.

replace_prior_views scans a parsed view constraint ParsingResult for references to prior values (e.g., prior(A)), and replaces them with the actual prior value from the provided prior result object. This ensures that prior-based terms in view constraints are treated as constants and not as variables in the optimisation. If an asset referenced in a prior is not found in the asset set, a warning is issued (or an error if strict=true). If all variables in the view are prior references, an error is thrown.

Arguments

  • res: Parsed view constraint containing variables and coefficients.

  • pr: Prior result object containing prior values.

  • sets: Asset set mapping asset names to indices.

  • key: Moment type key (:mu, :var, :cvar, etc.).

  • alpha: Optional confidence level for VaR/CVaR views.

  • strict: If true, throws error for missing assets; otherwise, issue warnings.

Returns

  • res::ParsingResult: Updated parsing result with prior references replaced by their values.

Details

  • Prior references are matched using the pattern prior(<asset>).
  • The right-hand side of the constraint is adjusted by subtracting the prior value times its coefficient.
  • Variables corresponding to prior references are removed from the constraint.
  • Throws an error if no non-prior variables remain.

Related

source
replace_prior_views(res::VecPR, args...; kwargs...)

Broadcast prior reference replacement across multiple view constraints.

replace_prior_views applies replace_prior_views to each element of a vector of parsed view constraints, replacing prior references with their corresponding prior values.

Arguments

Returns

  • res::Vector{<:ParsingResult}: Vector of updated parsing results with prior references replaced by their values.

Related

source
PortfolioOptimisers.replace_coprior_viewsFunction
replace_coprior_views(res::ParsingResult, pr::AbstractPriorResult, sets::UniverseSets, key::Symbol;
                      strict::Bool = false)

Replace correlation prior references in view parsing results with their corresponding prior values.

replace_coprior_views scans a parsed correlation view constraint (ParsingResult) for references to prior values (e.g., prior(A, B)), and replaces them with the actual prior correlation value from the provided prior result object. This ensures that prior-based terms in correlation view constraints are treated as constants and not as variables in the optimisation. If an asset referenced in a prior is not found in the asset set, a warning is issued (or an error if strict=true). If all variables in the view are prior references, an error is thrown.

Arguments

  • res: Parsed correlation view constraint containing variables and coefficients.
  • pr: Prior result object containing prior correlation values.
  • sets: Asset set mapping asset names to indices.
  • key: Symbol representing whether it's a correlation or covariance view.
  • strict: If true, throws error for missing assets; otherwise, issue warnings.

Returns

  • res::RhoParsingResult: Updated parsing result with prior references replaced by their values and correlation indices.

Details

  • Prior references are matched using the pattern prior(<asset1>, <asset2>).
  • The right-hand side of the constraint is adjusted by subtracting the prior value times its coefficient.
  • A prior(gA, gB) reference over a pair of groups resolves to one value per spanned asset pair, so the right-hand side becomes a vector of that length. The view emits one constraint row per pair, and each row takes its own entry.
  • Variables corresponding to prior references are removed from the constraint.
  • Throws an error if no non-prior variables remain.
  • Returns a RhoParsingResult containing the updated variables, coefficients, operator, right-hand side, equation string, and correlation indices.

Related

source
replace_coprior_views(res::VecPR, args...; kwargs...)

Broadcast prior reference replacement across multiple view constraints.

replace_coprior_views applies replace_coprior_views to each element of a vector of parsed view constraints, replacing prior references with their corresponding prior values.

Arguments

Returns

  • res::Vector{<:ParsingResult}: Vector of updated parsing results with prior references replaced by their values.

Related

source
PortfolioOptimisers.get_pr_valueFunction
get_pr_value(pr::AbstractPriorResult, i::Integer, ::Val{:mu}, args...)

Extract the mean (expected return) for asset i from a prior result.

get_pr_value returns the mean value for the asset indexed by i from the prior result object pr. This method is used internally to replace prior references in view constraints and for moment extraction in entropy pooling and other prior-based routines.

Arguments

  • pr: Prior result containing asset return information.
  • i: Index of the asset.
  • ::Val{:mu}: Dispatch tag for mean extraction.
  • args...: Additional arguments (ignored).

Returns

  • mu::Number: Mean (expected return) for asset i.

Related

source
get_pr_value(pr::AbstractPriorResult, i::Integer, ::Val{:var}, alpha::Number)

Extract the Value-at-Risk (VaR) for asset i from a prior result.

get_pr_value computes the VaR at confidence level alpha for the asset indexed by i from the prior result object pr. This method uses the asset return samples in pr and applies the VaR calculation, typically using the empirical quantile.

Arguments

  • pr: Prior result containing asset return information.
  • i: Index of the asset.
  • ::Val{:var}: Dispatch tag for VaR extraction.
  • alpha: Confidence level (e.g., 0.05 for 5% VaR).

Returns

  • var::Number: Value-at-Risk for asset i at level alpha.

Related

source
get_pr_value(pr::AbstractPriorResult, i::Integer, ::Val{:cvar}, alpha::Number)

Compute the Conditional Value-at-Risk (CVaR) for asset i from a prior result.

get_pr_value extracts the CVaR at confidence level alpha for the asset indexed by i from the prior result object pr. This method assumes the prior result contains the necessary asset return information (mean, covariance, or samples) to compute CVaR, typically under a normality assumption.

Arguments

  • pr: Prior result containing asset return information.
  • i: Index of the asset.
  • ::Val{:cvar}: Dispatch tag for CVaR computation.
  • alpha: Confidence level.

Returns

  • cvar::Number: Conditional Value-at-Risk for asset i at level alpha.

Related

source
get_pr_value(pr::AbstractPriorResult, i::Integer, ::Val{:sigma}, args...)

Extract the variance for asset i from a prior result.

get_pr_value returns the variance (diagonal element of the covariance matrix) for the asset indexed by i from the prior result object pr. This method is used internally to replace prior references in view constraints and for moment extraction in entropy pooling and other prior-based routines.

Arguments

  • pr: Prior result containing asset return information.
  • i: Index of the asset.
  • ::Val{:sigma}: Dispatch tag for variance extraction.
  • args...: Additional arguments (ignored).

Returns

  • sigma::Number: Variance for asset i.

Related

source
get_pr_value(pr::AbstractPriorResult, i::Integer, j::Integer, ::Val{:rho}, args...)
get_pr_value(pr::AbstractPriorResult, i::Integer, j::Integer, ::Val{:cov}, args...)

Extract the prior correlation or covariance between assets i and j from a prior result.

get_pr_value returns the entry of the prior correlation or covariance matrix that the dispatch tag names. These methods are used internally to replace prior(a, b) references in correlation and covariance view constraints.

Arguments

  • pr: Prior result containing asset return information.
  • i: Index of the first asset.
  • j: Index of the second asset.
  • ::Val{:rho}: Dispatch tag for correlation extraction.
  • ::Val{:cov}: Dispatch tag for covariance extraction.
  • args...: Additional arguments (ignored).

Returns

  • val::Number: Correlation coefficient or covariance between assets i and j.

Related

source
get_pr_value(pr::AbstractPriorResult, i::VecInt, j::VecInt, ::Val{:rho}, args...)
get_pr_value(pr::AbstractPriorResult, i::VecInt, j::VecInt, ::Val{:cov}, args...)

Extract the prior correlations or covariances of the asset pairs that two groups span.

get_pr_value returns one value per spanned pair, in the order of zip(i, j). A view over a pair of groups emits one constraint row per spanned pair, so a prior(gA, gB) reference inside such a view must give the row that pair's own prior value. These methods are used internally to replace prior(gA, gB) references in correlation and covariance view constraints.

Arguments

  • pr: Prior result containing asset return information.
  • i: Vector of indices for the first asset group.
  • j: Vector of indices for the second asset group.
  • ::Val{:rho}: Dispatch tag for correlation extraction.
  • ::Val{:cov}: Dispatch tag for covariance extraction.
  • args...: Additional arguments (ignored).

Returns

  • val::Vector{<:Number}: Correlation or covariance of each spanned pair, one entry per element of zip(i, j).

Related

source
get_pr_value(pr::AbstractPriorResult, i::Integer, ::Val{:skew}, args...)

Extract the skewness for asset i from a prior result.

get_pr_value returns the skewness of the asset indexed by i from the prior result object pr. This method is used internally to replace prior references in view constraints and for higher moment extraction in entropy pooling and other prior-based routines.

Arguments

  • pr: Prior result containing asset return information.
  • i: Index of the asset.
  • ::Val{:skew}: Dispatch tag for skewness extraction.
  • args...: Additional arguments (ignored).

Returns

  • skew::Number: Skewness for asset i.

Related

source
get_pr_value(pr::AbstractPriorResult, i::Integer, ::Val{:kurtosis}, args...)

Extract the kurtosis for asset i from a prior result.

get_pr_value returns the kurtosis of the asset indexed by i from the prior result object pr. This method is used internally to replace prior references in view constraints and for higher moment extraction in entropy pooling and other prior-based routines.

Arguments

  • pr: Prior result containing asset return information.
  • i: Index of the asset.
  • ::Val{:kurtosis}: Dispatch tag for kurtosis extraction.
  • args...: Additional arguments (ignored).

Returns

  • kurtosis::Number: Kurtosis for asset i.

Related

source
get_pr_value(pr::AbstractPriorResult, i::Integer, ::Val{:evar}, alpha::Number)

Extract the Entropic Value-at-Risk (EVaR) for asset i from a prior result.

get_pr_value computes the EVaR at confidence level alpha for the asset indexed by i from the prior result object pr, by minimising the scalar objective of the sample EVaR formula with ep_evar.

Arguments

  • pr: Prior result containing asset return information.
  • i: Index of the asset.
  • ::Val{:evar}: Dispatch tag for EVaR extraction.
  • alpha: Confidence level (e.g. 0.05 for 5% EVaR).

Returns

  • evar::Number: Entropic Value-at-Risk for asset i at level alpha.

Related

source
PortfolioOptimisers.ep_mu_views!Function
ep_mu_views!(mu_views::Nothing, args...; kwargs...)

Do nothing when no mean view constraints are specified.

ep_mu_views! is an internal API compatibility method that does nothing when mean view constraints (mu_views) are not provided (mu_views = nothing). This allows higher-level entropy pooling routines to uniformly call ep_mu_views! without special-casing the absence of mean views.

Arguments

  • mu_views::Nothing: Indicates that no mean view constraints are specified.
  • args...: Additional positional arguments (ignored).
  • kwargs...: Additional keyword arguments (ignored).

Returns

  • nothing.

Related

source
ep_mu_views!(mu_views::LinearConstraintEstimator, epc::AbstractDict,
             pr::AbstractPriorResult, sets::UniverseSets; strict::Bool = false)

Parse and add mean (expected return) view constraints to the entropy pooling constraint dictionary.

ep_mu_views! parses mean view equations from a LinearConstraintEstimator, replaces any prior references with their actual values, and constructs the corresponding linear constraints for entropy pooling. The constraints are then added to the entropy pooling constraint dictionary epc. This method is used internally by entropy pooling routines to enforce mean views in the optimisation.

Arguments

  • mu_views: Mean view constraints.
  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • pr: Prior result containing asset return information.
  • sets: Asset set mapping asset names to indices.
  • strict: If true, throws error for missing assets; otherwise, issue warnings.

Returns

  • nothing: The function mutates epc in-place.

Details

  • Parses view equations and replaces groupings by assets.
  • Replaces prior references in views with their actual prior values.
  • Converts parsed views to linear constraints and adds them to epc.
  • Supports both equality and fixed equality constraints.

Related

source
PortfolioOptimisers.fix_mu!Function
fix_mu!(epc::AbstractDict, fixed::AbstractVector, to_fix::BitVector,
        pr::AbstractPriorResult)

Add constraints to fix the mean of specified assets in entropy pooling.

fix_mu! identifies assets in to_fix that are not yet fixed (i.e., not present in fixed), and adds constraints to the entropy pooling constraint dictionary epc to fix their mean to the prior value. This ensures that higher moment views (e.g., variance, skewness, kurtosis, correlation) do not inadvertently alter the mean of these assets. The function updates fixed in-place to reflect the newly fixed assets.

Arguments

  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • fixed: Boolean vector indicating which assets have their mean fixed.
  • to_fix: Boolean vector indicating which assets should have their mean fixed.
  • pr: Prior result containing asset return information.

Returns

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

Details

  • Adds a fixed equality constraint (:feq) for each asset in to_fix that is not yet fixed.
  • Uses the prior mean values from pr.mu for the constraint right-hand side.

Related

source
PortfolioOptimisers.AbstractEntropyPoolingViewEstimatorType
abstract type AbstractEntropyPoolingViewEstimator <: AbstractEstimator

Abstract supertype for the estimators that carry a group of entropy pooling views together with the settings those views are read under.

A significance level is a property of a view, not of the estimator that holds it: the value at risk at 1% and at 10% are different statistics of the same series. An estimator of this family pairs a group of view equations with the settings they are read under, so one entropy pooling estimator can hold views stated at several levels.

Related

source
PortfolioOptimisers.ValueatRiskViewType
struct ValueatRiskView{__T_views, __T_alpha} <: AbstractEntropyPoolingViewEstimator

A group of value-at-risk views, with the significance level they are read under.

Unlike a conditional or entropic value at risk view, a value at risk view is linear in the posterior probabilities: it reduces to rows of the constraint set through add_ep_constraint!, so it needs no auxiliary variable, admits no choice of formulation, and reaches OptimEntropyPooling as readily as JuMPEntropyPooling. That is why this estimator carries a level and nothing else.

Fields

  • views: Value-at-risk view constraints estimator.
  • alpha: Significance level the views this estimator holds are read under.

Constructors

ValueatRiskView(;    views::LinearConstraintEstimator,    alpha::Number = 0.05) -> ValueatRiskView

Keywords correspond to the struct's fields.

Validation

  • 0 < alpha < 1.

Details

  • A prior(...) reference inside views is replaced by the prior VaR at this view's alpha, so a view stated against the prior moves with the level.
  • Accepts == and >= alone, one asset per view, with a unit coefficient and a non-negative target.

Examples

julia> ValueatRiskView(; alpha = 0.01, views = LinearConstraintEstimator(; val = "A >= 0.05"))ValueatRiskView  views ┼ LinearConstraintEstimator        │   val ┼ String: "A >= 0.05"        │   key ┴ nothing  alpha ┴ Float64: 0.01

Related

References

  • [80] A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
source
PortfolioOptimisers.AbstractEntropyPoolingViewFormulationType
abstract type AbstractEntropyPoolingViewFormulation <: AbstractAlgorithm

Abstract supertype for the formulations that express a tail view inside an entropy pooling problem.

A tail view constrains a quantile-based risk measure of the posterior distribution. Unlike a mean, variance or correlation view, it is not a linear function of the posterior probabilities, so each measure admits more than one way of writing it as a solvable program. The concrete subtypes name those ways.

Related

References

  • [1] D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
source
PortfolioOptimisers.LinearConditionalValueatRiskViewType
struct LinearConditionalValueatRiskView <: AbstractConditionalValueatRiskViewFormulation

Linear formulation of a conditional value-at-risk view [1].

LinearConditionalValueatRiskView writes the view through the dual representation of CVaR. It adds $T$ continuous variables and no integer variable, so it is the cheapest of the two CVaR formulations, and it is exact.

Mathematical definition

Let $\boldsymbol{x}$ be the loss series of the asset the view names, $\boldsymbol{w}$ the posterior probabilities, $\alpha$ the significance level and $\bar{c}$ the target. The view $\mathrm{CVaR}_{\alpha}(X) \geq \bar{c}$ is written as:

\[\begin{align} &\nu_{j} \geq 0\,, &\forall\, j = 1,\ldots,T\\ &\nu_{j} \leq \dfrac{w_{j}}{\alpha}\,, &\forall\, j = 1,\ldots,T\\ &\sum_{j=1}^{T} \nu_{j} = 1\\ &\sum_{j=1}^{T} \nu_{j} x_{j} \geq \bar{c}\,. \end{align}\]

Where $\boldsymbol{\nu}$ is the vector of weights that attains the CVaR. The constraint set is feasible if and only if $\mathrm{CVaR}_{\alpha}(X) \geq \bar{c}$, so a lower-bound view is exact.

Scope

  • Operators: >= and ==.
  • One asset per view, with a positive coefficient.
  • An equality view needs a target greater than or equal to the prior CVaR of the asset. Below the prior CVaR the constraint is slack at the prior, so the entropy minimiser leaves the prior untouched and the view is not met. Use IntegerConditionalValueatRiskView there.

Examples

julia> LinearConditionalValueatRiskView()LinearConditionalValueatRiskView()

Related

References

  • [1] D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
source
PortfolioOptimisers.IntegerConditionalValueatRiskViewType
struct IntegerConditionalValueatRiskView{__T_sbar} <: AbstractConditionalValueatRiskViewFormulation

Integer formulation of a conditional value-at-risk view [1].

IntegerConditionalValueatRiskView writes the view through the ordered weights representation of CVaR, selecting the tail of the posterior with a monotone binary vector. It expresses every comparison operator and any linear combination of per-asset CVaRs, at the cost of sbar binary variables per asset named by the view. It needs a solver that handles mixed-integer exponential cone programs.

Fields

  • sbar: Number of largest losses considered by the integer conditional value-at-risk formulation. An Integer is a count, a fraction in (0, 1] is a fraction of the observations, and nothing applies the rule of thumb.

Mathematical definition

Let $x_{[1]} \leq x_{[2]} \leq \ldots \leq x_{[\bar{s}]}$ be the $\bar{s}$ largest losses of the asset sorted in ascending order, so the largest loss is last, $w_{[j]}$ the posterior probability of the observation in position $j$, and $\alpha$ the significance level:

\[\begin{align} &y_{j} \leq y_{j+1}\,, &\forall\, j = 1,\ldots,\bar{s}-1\\ &q_{j} \leq y_{j}\,, &\forall\, j = 1,\ldots,\bar{s}\\ &q_{j} \leq w_{[j]}\,, &\forall\, j = 1,\ldots,\bar{s}\\ &q_{j} \geq w_{[j]} - (1 - y_{j})\,, &\forall\, j = 1,\ldots,\bar{s}\\ &q_{j} \geq 0\,, &\forall\, j = 1,\ldots,\bar{s}\\ &\alpha = \sum_{j=1}^{\bar{s}} q_{j}\\ &\boldsymbol{y} \in \{0,1\}^{\bar{s}}\\ &\mathrm{CVaR}_{\alpha}(X) = \dfrac{1}{\alpha} \sum_{j=1}^{\bar{s}} q_{j} x_{[j]}\,. \end{align}\]

The auxiliary vector $\boldsymbol{q}$ carries $q_{j} = w_{[j]} y_{j}$, and $\boldsymbol{y}$ marks the observations that enter the tail. The monotonicity constraint makes the marked set a suffix of the ascending order, which is what makes the expression the CVaR rather than the mean of an arbitrary subset of probability $\alpha$.

Details

  • sbar trades exactness for solve time. sbar = T is always exact. A smaller sbar is exact whenever the posterior puts at least $\alpha$ of its mass on the sbar largest losses, and infeasible otherwise.
  • If nothing, sbar is max(2 * s, ceil(Int, 2 * alpha * T)) capped at T, where s is the number of positions, counted from the largest loss, at which the prior probabilities first reach alpha. This follows the rule of thumb of [1]: a view above the prior CVaR needs about s positions, a view below it needs more.
  • Raise sbar when the solve reports infeasibility.

Constructors

IntegerConditionalValueatRiskView(;    sbar::Option{<:Number} = nothing) -> IntegerConditionalValueatRiskView

Keywords correspond to the struct's fields.

Validation

  • If sbar is an Integer, sbar >= 1.
  • If sbar is not an Integer, 0 < sbar < 1. Use an Integer to name the whole sample.

Examples

julia> IntegerConditionalValueatRiskView()IntegerConditionalValueatRiskView  sbar ┴ nothing

Related

References

  • [1] D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
source
PortfolioOptimisers.ConicEntropicValueatRiskViewType
struct ConicEntropicValueatRiskView <: AbstractEntropicValueatRiskViewFormulation

Exponential cone formulation of an entropic value-at-risk view [1].

ConicEntropicValueatRiskView writes the view through the dual representation of EVaR. It adds $T$ continuous variables and one relative entropy cone, and it is exact.

Mathematical definition

Let $\boldsymbol{x}$ be the loss series of the asset the view names, $\boldsymbol{w}$ the posterior probabilities, $\alpha$ the significance level and $\bar{e}$ the target. The view $\mathrm{EVaR}_{\alpha}(X) \geq \bar{e}$ is written as:

\[\begin{align} &0 \leq \nu_{j} \leq 1\,, &\forall\, j = 1,\ldots,T\\ &\sum_{j=1}^{T} \nu_{j} \ln\left(\dfrac{\nu_{j}}{w_{j}}\right) \leq \ln\left(\dfrac{1}{\alpha}\right)\\ &\sum_{j=1}^{T} \nu_{j} = 1\\ &\sum_{j=1}^{T} \nu_{j} x_{j} \geq \bar{e}\,. \end{align}\]

Where $\boldsymbol{\nu}$ is the vector of weights that attains the EVaR. The relative entropy budget is the dual description of EVaR, so the constraint set is feasible if and only if $\mathrm{EVaR}_{\alpha}(X) \geq \bar{e}$.

Scope

  • Operators: >= and ==.
  • One asset per view, with a positive coefficient.
  • An equality view needs a target greater than or equal to the prior EVaR of the asset. Use GridEntropicValueatRiskView below it.

Examples

julia> ConicEntropicValueatRiskView()ConicEntropicValueatRiskView()

Related

References

  • [1] D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
source
PortfolioOptimisers.GridEntropicValueatRiskViewType
struct GridEntropicValueatRiskView{__T_pct, __T_K, __T_M} <: AbstractEntropicValueatRiskViewFormulation

Grid formulation of an entropic value-at-risk view [1].

GridEntropicValueatRiskView writes the view on a grid of values of the EVaR dual variable, built around the value that attains the prior EVaR of the asset. A lower-bound view is a set of linear constraints and needs no integer variable. An upper-bound or equality view selects one grid point with a binary vector and a big-$M$ relaxation, and needs a solver that handles mixed-integer exponential cone programs.

Fields

  • pct: Fractional half-width of the grid of entropic value-at-risk dual variables, centred on the value that attains the prior entropic value-at-risk.
  • K: Number of points of the grid of entropic value-at-risk dual variables. Must be odd.
  • M: Big-M constant of the grid entropic value-at-risk formulation.

Mathematical definition

The sample EVaR is the value of a scalar minimisation:

\[\mathrm{EVaR}_{\alpha}(X) = \min_{z > 0} \; z \ln\left(\dfrac{\sum_{j=1}^{T} w_{j} \exp(x_{j}/z)}{\alpha}\right)\,.\]

So $\mathrm{EVaR}_{\alpha}(X) \geq \bar{e}$ holds exactly when the objective is at or above $\bar{e}$ at every $z$, and $\mathrm{EVaR}_{\alpha}(X) \leq \bar{e}$ holds when it is at or below $\bar{e}$ at some $z$. On a grid $\bar{z}_{1},\ldots,\bar{z}_{K}$ that gives, for a lower-bound view:

\[\dfrac{\sum_{j=1}^{T} w_{j} \exp(x_{j}/\bar{z}_{k})}{\exp(\bar{e}/\bar{z}_{k})} \geq \alpha\,, \quad \forall\, k = 1,\ldots,K\]

and for an upper-bound view, with $\boldsymbol{y}$ a binary selector and $M$ a big constant:

\[\begin{align} &\boldsymbol{1}^{\intercal} \boldsymbol{y} = 1\\ &\dfrac{\sum_{j=1}^{T} w_{j} \exp(x_{j}/\bar{z}_{k})}{\exp(\bar{e}/\bar{z}_{k})} \leq \alpha + M(1 - y_{k})\,, &\forall\, k = 1,\ldots,K\\ &\boldsymbol{y} \in \{0,1\}^{K}\,. \end{align}\]

An equality view carries both blocks.

Details

  • The grid is K equidistant points spanning zstar * (1 - pct) to zstar * (1 + pct), where zstar attains the prior EVaR of the asset. K is odd so zstar sits in the middle.
  • The answer is approximate in both directions. A lower-bound view holds at the grid points and may fall short between them; an upper-bound view holds at one grid point and may be conservative. Widen pct or raise K when the posterior value misses the target, and prefer ConicEntropicValueatRiskView whenever the view admits it.
  • Rows are scaled by their largest coefficient before they reach the model, so the default M is far above the largest attainable violation.

Constructors

GridEntropicValueatRiskView(;    pct::Number = 0.5,    K::Integer = 11,    M::Number = 10) -> GridEntropicValueatRiskView

Keywords correspond to the struct's fields.

Validation

  • 0 < pct < 1.
  • K >= 1 and isodd(K).
  • M > 0.

Examples

julia> GridEntropicValueatRiskView()GridEntropicValueatRiskView  pct ┼ Float64: 0.5    K ┼ Int64: 11    M ┴ Int64: 10

Related

References

  • [1] D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
source
PortfolioOptimisers.AbstractEntropyPoolingTailViewEstimatorType
abstract type AbstractEntropyPoolingTailViewEstimator <: AbstractEntropyPoolingViewEstimator

Abstract supertype for the estimators that carry a group of tail views together with the settings those views are read under.

A significance level is a property of a view, not of the estimator that holds it: the conditional value at risk at 1% and at 10% are different statistics of the same series. An estimator of this family pairs a group of view equations with the level and the formulation they take, so one EntropyPoolingPrior can hold views stated at several levels.

Related

References

  • [1] D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
source
PortfolioOptimisers.ConditionalValueatRiskViewType
struct ConditionalValueatRiskView{__T_views, __T_alpha, __T_alg} <: AbstractEntropyPoolingTailViewEstimator

A group of conditional value-at-risk views, with the significance level and formulation they are read under.

Fields

  • views: Tail view constraints estimator.
  • alpha: Significance level the views this estimator holds are read under.
  • alg: Formulation used to express each view this estimator holds. A single formulation applies to every view, a vector supplies one per view, and nothing lets each view take the cheapest formulation that expresses it exactly.

Constructors

ConditionalValueatRiskView(;    views::LinearConstraintEstimator,    alpha::Number = 0.05,    alg::Option{<:CVaRVF_VecCVaRVF} = nothing) -> ConditionalValueatRiskView

Keywords correspond to the struct's fields.

Validation

  • 0 < alpha < 1.
  • If alg is a vector, !isempty(alg).

Details

  • alg left nothing lets each view in the group take the cheapest formulation that expresses it exactly.
  • A prior(...) reference inside views is replaced by the prior CVaR at this view's alpha, so a view stated against the prior moves with the level.

Examples

julia> ConditionalValueatRiskView(; alpha = 0.01,                                  views = LinearConstraintEstimator(; val = "A >= 0.07"))ConditionalValueatRiskView  views ┼ LinearConstraintEstimator        │   val ┼ String: "A >= 0.07"        │   key ┴ nothing  alpha ┼ Float64: 0.01    alg ┴ nothing

Related

References

  • [1] D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
source
PortfolioOptimisers.EntropicValueatRiskViewType
struct EntropicValueatRiskView{__T_views, __T_alpha, __T_alg} <: AbstractEntropyPoolingTailViewEstimator

A group of entropic value-at-risk views, with the significance level and formulation they are read under.

Fields

  • views: Tail view constraints estimator.
  • alpha: Significance level the views this estimator holds are read under.
  • alg: Formulation used to express each view this estimator holds. A single formulation applies to every view, a vector supplies one per view, and nothing lets each view take the cheapest formulation that expresses it exactly.

Constructors

EntropicValueatRiskView(;    views::LinearConstraintEstimator,    alpha::Number = 0.05,    alg::Option{<:EVaRVF_VecEVaRVF} = nothing) -> EntropicValueatRiskView

Keywords correspond to the struct's fields.

Validation

  • 0 < alpha < 1.
  • If alg is a vector, !isempty(alg).

Details

  • alg left nothing lets each view in the group take the cheapest formulation that expresses it exactly.
  • alg is where the grid of dual variables and the big-M constant live: a GridEntropicValueatRiskView in this field gives these views their own pct, K and M, so views at different significance levels can take different grids.
  • A prior(...) reference inside views is replaced by the prior EVaR at this view's alpha.

Examples

julia> EntropicValueatRiskView(; alpha = 0.01,                               views = LinearConstraintEstimator(; val = "A <= 0.09"),                               alg = GridEntropicValueatRiskView(; pct = 0.8, K = 21))EntropicValueatRiskView  views ┼ LinearConstraintEstimator        │   val ┼ String: "A <= 0.09"        │   key ┴ nothing  alpha ┼ Float64: 0.01    alg ┼ GridEntropicValueatRiskView        │   pct ┼ Float64: 0.8        │     K ┼ Int64: 21        │     M ┴ Int64: 10

Related

References

  • [1] D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
source
PortfolioOptimisers.ep_var_views!Function
ep_var_views!(var_views::Nothing, args...; kwargs...)

Do nothing when no value at risk (VaR) view constraints are specified.

ep_var_views! is an internal API compatibility method that does nothing when value at risk (VaR) view constraints (var_views) are not provided (var_views = nothing). This allows higher-level entropy pooling routines to uniformly call ep_var_views! without special-casing the absence of value at risk (VaR) views.

Arguments

  • var_views::Nothing: Indicates that no value at risk (VaR) view constraints are specified.
  • args...: Additional positional arguments (ignored).
  • kwargs...: Additional keyword arguments (ignored).

Returns

  • nothing.

Related

source
ep_var_views!(var_views::LinearConstraintEstimator, epc::AbstractDict,
              pr::AbstractPriorResult, sets::UniverseSets, alpha::Number; strict::Bool = false)

Parse and add value at risk (VaR) view constraints to the entropy pooling constraint dictionary.

ep_var_views! parses VaR view equations from a LinearConstraintEstimator, replaces any prior references with their actual values, and constructs the corresponding linear constraints for entropy pooling. A VaR view is linear in the posterior probabilities: it constrains the probability mass at or below the target loss to be the significance level, so it needs no auxiliary variable. The constraints are then added to the entropy pooling constraint dictionary epc. This method validates that only single-asset, non-negative, and unit-coefficient views are allowed, and throws informative errors for invalid or extreme views.

Arguments

  • var_views: VaR view constraints.
  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • pr: Prior result containing asset return information.
  • sets: Asset set mapping asset names to indices.
  • alpha: Confidence level for VaR.
  • strict: If true, throws error for missing assets; otherwise, issue warnings.

Returns

  • nothing: The function mutates epc in-place.

Details

  • Parses view equations and replaces groupings by assets.
  • Replaces prior references in views with their actual prior values.
  • Converts parsed views to linear constraints and adds them to epc.
  • Validates that only equality and inequality constraints with unit coefficients are present.
  • Throws errors for negative or multi-asset views, or if the view is more extreme than the worst realisation.

Related

source
ep_var_views!(var_views::AbstractVector{<:ValueatRiskView}, args...; kwargs...)

Add each group of value at risk views under its own significance level.

Every ValueatRiskView in the vector is added in turn, so the groups accumulate into the same constraint set and one entropy pooling solve answers all of them.

Arguments

  • var_views: Groups of VaR views.
  • args...: Additional positional arguments forwarded to ep_var_views!.
  • kwargs...: Additional keyword arguments forwarded to ep_var_views!.

Returns

  • nothing: The function mutates epc in-place.

Related

source
PortfolioOptimisers.entropy_poolingFunction
entropy_pooling(w::VecNum, epc::AbstractDict, opt::OptimEntropyPooling)

Solve the dual of the entropy pooling problem using Optim.jl.

entropy_pooling computes posterior probabilities by minimising the Kullback-Leibler divergence of the posterior weights from the prior ones, subject to moment and view constraints. The optimisation is performed using Optim.jl, supporting box constraints and slack variables for relaxed equality constraints. This method is used internally by MeucciEntropyPoolingPrior and EntropyPoolingPrior when the optimiser is an OptimEntropyPooling.

Mathematical definition

The dual of the entropy pooling problem is solved for Lagrange multipliers $\boldsymbol{x}$. The dual objective is:

\[\begin{align} \underset{\boldsymbol{x}}{\min} &\; \boldsymbol{x}^\intercal \boldsymbol{b} + \sum_{t=1}^{T} q_t \exp\!\left(-\boldsymbol{x}^\intercal \mathbf{A}_{\cdot t} - 1\right)\,. \end{align}\]

The optimal posterior weights recover as:

\[\begin{align} p_t^* &= q_t \exp\!\left(-\boldsymbol{x}^{*\intercal} \mathbf{A}_{\cdot t} - 1\right)\,. \end{align}\]

Where:

  • $\boldsymbol{x}$: Lagrange multipliers (dual variables).
  • $\boldsymbol{b}$: Right-hand side constraint vector.
  • $\mathbf{A}_{\cdot t}$: $t$-th column of the constraint matrix $\mathbf{A}$.
  • $q_t$: Prior weight for scenario $t$.
  • $p_t^*$: Optimal posterior weight for scenario $t$.
  • $T$: Number of observations.

Arguments

  • w: Prior weights (length = number of observations).

  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.

  • opt: Optim.jl-based entropy pooling optimiser.

    • ::OptimEntropyPooling{<:Any, <:Any, <:Any, <:Any, <:ExpEntropyPooling}: Evaluate the objective through the exponential of the dual variables.
    • ::OptimEntropyPooling{<:Any, <:Any, <:Any, <:Any, <:LogEntropyPooling}: Evaluate the objective in log space.

Returns

  • pw::StatsBase.ProbabilityWeights: Posterior probability weights satisfying the constraints.

Details

  • Constructs the constraint matrix and bounds from epc.
  • Relaxes fixed equality constraints via slack variables to make the problem more tractable.
  • The two optimisation algorithms minimise the same objective and reach the same posterior. They differ only in the arithmetic that evaluates it.
  • Throws an error if optimisation fails.

Related

References

  • [80] A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
source
entropy_pooling(w::VecNum, epc::AbstractDict, opt::JuMPEntropyPooling)

Solve the primal of the entropy pooling problem using JuMP.jl.

entropy_pooling computes posterior probabilities by minimising the Kullback-Leibler divergence of the posterior weights from the prior ones, subject to moment and view constraints. The optimisation is performed using JuMP.jl, supporting relative entropy cones and slack variables for relaxed equality constraints. This method is used internally by MeucciEntropyPoolingPrior and EntropyPoolingPrior when the optimiser is a JuMPEntropyPooling.

Arguments

  • w: Prior weights (length = number of observations).

  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.

  • opt: JuMP.jl-based entropy pooling optimiser.

    • ::JuMPEntropyPooling{<:Any, <:Any, <:Any, <:Any, <:ExpEntropyPooling}: Write the divergence against the prior probabilities directly.
    • ::JuMPEntropyPooling{<:Any, <:Any, <:Any, <:Any, <:LogEntropyPooling}: Write the divergence against a unit reference and subtract the prior log-probabilities in the objective.

Returns

  • pw::StatsBase.ProbabilityWeights: Posterior probability weights satisfying the constraints.

Details

  • Forwards to the four-argument method with no tail view, which carries the body.
  • Constructs the JuMP model with the chosen divergence representation and the constraints from epc.
  • Relaxes fixed equality constraints by adding norm one cone bounded slack variables to make the problem more tractable.
  • Throws an error if optimisation fails.

Related

References

  • [80] A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
source
entropy_pooling(w::VecNum, epc::AbstractDict, tvs::VecEPTV,
                opt::AbstractEntropyPoolingOptimiser)

Solve an entropy pooling problem that carries tail view constraints.

entropy_pooling extends the three-argument form with the conditional and entropic value-at-risk views of [1]. A tail view needs auxiliary variables, so it is built into the model by add_ep_tail_view! rather than reduced to rows of epc.

Arguments

  • w: Prior weights (length = number of observations).

  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.

  • tvs: Tail view constraints.

  • opt: Entropy pooling optimiser.

    • ::JuMPEntropyPooling: Builds every tail view into the model.
    • ::OptimEntropyPooling: Solves the dual, which has no room for an auxiliary variable, so it accepts an empty tvs alone.

Validation

  • isa(opt, OptimEntropyPooling) requires isempty(tvs).

Returns

  • pw::StatsBase.ProbabilityWeights: Posterior probability weights satisfying the constraints.

Related

References

  • [1] D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
source
PortfolioOptimisers.ep_sigma_views!Function
ep_sigma_views!(sigma_views::LinearConstraintEstimator, epc::AbstractDict,
                pr::AbstractPriorResult, sets::UniverseSets; strict::Bool = false)

Parse and add variance (sigma) view constraints to the entropy pooling constraint dictionary.

ep_sigma_views! parses variance view equations from a LinearConstraintEstimator, replaces any prior references with their actual values, and constructs the corresponding quadratic constraints for entropy pooling. The constraints are then added to the entropy pooling constraint dictionary epc. This method returns a boolean vector indicating which assets require their mean to be fixed to the prior value, ensuring that variance views do not inadvertently alter the mean.

Arguments

  • sigma_views: Variance view constraints.
  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • pr: Prior result containing asset return information.
  • sets: Asset set mapping asset names to indices.
  • strict: If true, throws error for missing assets; otherwise, issue warnings.

Returns

  • to_fix::BitVector: Boolean vector indicating which assets require their mean to be fixed.

Details

  • Parses view equations and replaces groupings by assets.
  • Replaces prior references in views with their actual prior values.
  • Converts parsed views to quadratic constraints and adds them to epc.
  • Returns a boolean vector for assets that need their mean fixed due to variance constraints.

Related

source
PortfolioOptimisers.fix_sigma!Function
fix_sigma!(epc::AbstractDict, fixed::AbstractVector, to_fix::BitVector,
           pr::AbstractPriorResult)

Add constraints to fix the variance of specified assets in entropy pooling.

fix_sigma! identifies assets in to_fix that are not yet fixed (i.e., not present in fixed), and adds constraints to the entropy pooling constraint dictionary epc to fix their variance to the prior value. This ensures that higher moment views (e.g., skewness, kurtosis, correlation) do not inadvertently alter the variance of these assets. The function updates fixed in-place to reflect the newly fixed assets.

Arguments

  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • fixed: Boolean vector indicating which assets have their variance fixed.
  • to_fix: Boolean vector indicating which assets should have their variance fixed.
  • pr: Prior result containing asset return information.

Returns

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

Details

  • Adds a fixed equality constraint (:feq) for each asset in to_fix that is not yet fixed.
  • Uses the prior variance values from LinearAlgebra.diag(pr.sigma) for the constraint right-hand side.

Related

source
PortfolioOptimisers.ep_cov_views!Function
ep_cov_views!(cov_views::LinearConstraintEstimator, epc::AbstractDict,
              pr::AbstractPriorResult, sets::UniverseSets; strict::Bool = false)

Parse and add covariance view constraints to the entropy pooling constraint dictionary.

ep_cov_views! parses covariance view equations from a LinearConstraintEstimator, replaces any prior references with their actual values, and constructs the corresponding linear constraints for entropy pooling. The constraints are then added to the entropy pooling constraint dictionary epc. This method returns a boolean vector indicating which assets require their mean and variance to be fixed to the prior value, ensuring that covariance views do not inadvertently alter lower moments.

Arguments

  • cov_views: Covariance view constraints.
  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • pr: Prior result containing asset return information.
  • sets: Asset set mapping asset names to indices.
  • strict: If true, throws error for missing assets; otherwise, issue warnings.

Returns

  • to_fix::BitVector: Boolean vector indicating which assets require their mean and variance to be fixed.

Details

  • Parses view equations and replaces groupings by assets.
  • Replaces prior references in views with their actual prior covariance values.
  • A view over a pair of groups emits one constraint row per spanned asset pair, and each row takes that pair's own right-hand side.
  • Converts parsed views to linear constraints and adds them to epc.
  • Returns a boolean vector for assets that need their mean and variance fixed due to covariance constraints.

Related

source
PortfolioOptimisers.ep_rho_views!Function
ep_rho_views!(rho_views::LinearConstraintEstimator, epc::AbstractDict,
              pr::AbstractPriorResult, sets::UniverseSets; strict::Bool = false)

Parse and add correlation view constraints to the entropy pooling constraint dictionary.

ep_rho_views! parses correlation view equations from a LinearConstraintEstimator, replaces any prior references with their actual values, and constructs the corresponding linear constraints for entropy pooling. The constraints are then added to the entropy pooling constraint dictionary epc. This method returns a boolean vector indicating which assets require their mean and variance to be fixed to the prior value, ensuring that correlation views do not inadvertently alter lower moments.

Arguments

  • rho_views: Correlation view constraints.
  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • pr: Prior result containing asset return information.
  • sets: Asset set mapping asset names to indices.
  • strict: If true, throws error for missing assets; otherwise, issue warnings.

Returns

  • to_fix::BitVector: Boolean vector indicating which assets require their mean and variance to be fixed.

Details

  • Parses view equations and replaces groupings by assets.
  • Replaces prior references in views with their actual prior correlation values.
  • A view over a pair of groups emits one constraint row per spanned asset pair, and each row takes that pair's own right-hand side.
  • Converts parsed views to linear constraints and adds them to epc.
  • Returns a boolean vector for assets that need their mean and variance fixed due to correlation constraints.

Related

source
PortfolioOptimisers.ep_sk_views!Function
ep_sk_views!(skew_views::LinearConstraintEstimator, epc::AbstractDict,
             pr::AbstractPriorResult, sets::UniverseSets; strict::Bool = false)

Parse and add skewness view constraints to the entropy pooling constraint dictionary.

ep_sk_views! parses skewness view equations from a LinearConstraintEstimator, replaces any prior references with their actual values, and constructs the corresponding linear constraints for entropy pooling. The constraints are then added to the entropy pooling constraint dictionary epc. This method returns a boolean vector indicating which assets require their mean and variance to be fixed to the prior value, ensuring that skewness views do not inadvertently alter lower moments.

Arguments

  • skew_views: Skewness view constraints.
  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • pr: Prior result containing asset return information.
  • sets: Asset set mapping asset names to indices.
  • strict: If true, throws error for missing assets; otherwise, issue warnings.

Returns

  • to_fix::BitVector: Boolean vector indicating which assets require their mean and variance to be fixed.

Details

  • Parses view equations and replaces groupings by assets.
  • Replaces prior references in views with their actual prior skewness values.
  • Converts parsed views to linear constraints and adds them to epc.
  • Returns a boolean vector for assets that need their mean and variance fixed due to skewness constraints.

Related

source
PortfolioOptimisers.ep_kt_views!Function
ep_kt_views!(kurtosis_views::LinearConstraintEstimator, epc::AbstractDict,
             pr::AbstractPriorResult, sets::UniverseSets; strict::Bool = false)

Parse and add kurtosis view constraints to the entropy pooling constraint dictionary.

ep_kt_views! parses kurtosis view equations from a LinearConstraintEstimator, replaces any prior references with their actual values, and constructs the corresponding linear constraints for entropy pooling. The constraints are then added to the entropy pooling constraint dictionary epc. This method returns a boolean vector indicating which assets require their mean and variance to be fixed to the prior value, ensuring that kurtosis views do not inadvertently alter lower moments.

Arguments

  • kurtosis_views: Kurtosis view constraints.
  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • pr: Prior result containing asset return information.
  • sets: Asset set mapping asset names to indices.
  • strict: If true, throws error for missing assets; otherwise, issue warnings.

Returns

  • to_fix::BitVector: Boolean vector indicating which assets require their mean and variance to be fixed.

Details

  • Parses view equations and replaces groupings by assets.
  • Replaces prior references in views with their actual prior kurtosis values.
  • Converts parsed views to linear constraints and adds them to epc.
  • Returns a boolean vector for assets that need their mean and variance fixed due to kurtosis constraints.

Related

source

Tail views

PortfolioOptimisers.AbstractEntropyPoolingTailViewType
abstract type AbstractEntropyPoolingTailView <: AbstractResult

Abstract supertype for the tail view constraints of an entropy pooling problem.

A tail view constraint is the parsed, resolved form of a conditional or entropic value-at-risk view. It carries the loss series, the level, the operator and the target, in the shape the formulation that produced it needs. Unlike the linear views, which reduce to rows of a matrix that multiplies the posterior probabilities, a tail view constraint needs auxiliary variables, so it is handed to the optimiser as a struct and built into the model there.

Related

References

  • [1] D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
source
PortfolioOptimisers.ep_jump_views!Function
ep_jump_views!(model::JuMP.Model, x, obj_expr, epc::AbstractDict, tvs::VecEPTV,
               sc1::Number, sc2::Number, so::Number)

Add every view constraint of an entropy pooling problem to a JuMP model.

ep_jump_views! is the shared body of the two JuMPEntropyPooling formulations: they differ only in how they represent the divergence, and agree on every view. It adds the linear rows of epc, relaxes the fixed equalities with a norm one cone bounded slack, and hands each tail view to add_ep_tail_view!.

Arguments

  • model: Entropy pooling JuMP model.
  • x: Vector of posterior probability variables.
  • obj_expr: Objective expression, mutated when a fixed equality is relaxed.
  • epc: Dictionary of entropy pooling constraints, mapping keys to (lhs, rhs) pairs.
  • tvs: Tail view constraints.
  • sc1: Constraint scaling factor.
  • sc2: Fixed equality slack penalty.
  • so: Objective scaling factor.

Returns

  • nothing: The function mutates model and obj_expr in-place.

Related

source

References

[1]
D. Cajas. Entropy Pooling with CVaR and EVaR Views. Available at SSRN 7120258 (2026).
[80]
A. Meucci. Fully flexible views: theory and practice. Risk 21, 97–102 (2008).
[81]
A. Vorobets. Sequential entropy pooling heuristics. Available at SSRN 3936392 (2021).
[82]
A. Meucci, D. Ardia and S. Keel. Fully flexible extreme views. The Journal of Risk 14, 39–49 (2011).