- class picos.expressions.uncertain.pert_moment.MomentAmbiguitySet(parameter_name, shape, nominal_mean=0, nominal_covariance='I', alpha=0, beta=1, sample_space=None)¶
A moment-uncertain description of a random perturbation parameter.
- Model of uncertainty
As a distributional ambiguity set, an instance of this class
represents a safety region for a partially known (ambiguous) probability distribution and
provides a random, ambiguously distributed perturbation parameter that can be used to define worst-case-expectation expressions of the form
for a selection of functions and a decision variable .
Formally, this class can describe ambiguity sets of the form
is the set of all Borel probability measures on ,
the sample space bounds the support of and may be given as either or as an -dimensional ellipsoid,
and with are the nominal mean and covariance matrix of , respectively, and
and are meta-parameters bounding the uncertainty concerning the mean and the covariance matrix, respectively.
Unless , this class can also represent the limit cases of and denoting an unbounded mean and covariance matrix, respectively.
While denotes that the nominal mean is certain, there is a subtle difference between setting on the one hand and assuming a certain form for the covariance matrix on the other hand: In the former case, the worst case covariance matrix may be Lowener smaller than the nominal one. Setting a lower bound on the covarianve matrix is computationally difficult and not supported.
- Supported functions
A squared norm where is biaffine in and . This can be written as
A convex piecewise linear function where is biaffine in and for all . This can be written as
picos.max([a_1, ..., a_k])in Python.
A concave piecewise linear function where is biaffine in and for all . This can be written as
picos.min([a_1, ..., a_k])in Python.
We show that for unbounded mean and support (i.e. and ) and for a finite samples space , this distributional ambiguity set can be used in the context of classical (non-distributional) robust optimization applied to least squares problems.
>>> from picos import Constant, diag, Ellipsoid, Problem, RealVariable >>> from picos.uncertain import ConicPerturbationSet, MomentAmbiguitySet >>> import numpy >>> numpy.random.seed(1) >>> # Setup data and variables of the nominal least squares problem. >>> n = 3 >>> A = Constant("A", numpy.random.random((n, n))) >>> b = Constant("b", numpy.random.random(n)) >>> x = RealVariable("x", n) >>> # Setup an ellipsoid S bounding the uncertainty in both models. >>> N = n**2 >>> S = Ellipsoid(N, diag(range(1, N + 1)), range(N)) >>> # Define and solve both robust models. >>> U1 = ConicPerturbationSet.from_constraints( ... "Y", RealVariable("Y", N) << S) >>> U2 = MomentAmbiguitySet("Z", N, alpha=None, beta=None, sample_space=S) >>> Y = U1.parameter.reshaped((n, n)) >>> Z = U2.parameter.reshaped((n, n)) >>> P1, P2 = Problem(), Problem() >>> P1.objective = "min", abs((A + Y)*x - b) >>> P2.objective = "min", abs((A + Z)*x - b)**2 >>> _ = P1.solve(solver="cvxopt") >>> x1 = ~x # Save current value of x as a constant PICOS expression x1. >>> _ = P2.solve(solver="cvxopt") >>> x2 = ~x >>> # Verify that both models yield the same robust regression vector. >>> x1.equals(x2, relTol=1e-4) True
- __init__(parameter_name, shape, nominal_mean=0, nominal_covariance='I', alpha=0, beta=1, sample_space=None)¶
parameter_name (str) – Name of the random parameter .
nominal_mean (anything recognized by
load_data) – The nominal mean of the ambiguous distribution .
nominal_covariance (anything recognized by
load_data) – The nominal covariance matrix of the ambiguous distribution .
Ellipsoid) – The sample space . If this is
Noneor an instance of
TheField(i.e. ), then the support of is unbounded. If this is an -dimensional instance of
Ellipsoid, then the support of is a subset of that ellipsoid.
- property dim¶
The dimension of the sample space.
- property nominal_covariance¶
The nominal covariance matrix .
- property nominal_mean¶
The nominal mean of the ambiguous distribution.
- property parameter¶
The random perturbation parameter .