Convert constraints from absolute to active format
ActiveConSet = abs2active(AbsConSet,Index)
ActiveConSet = abs2active(AbsConSet,Index)
transforms
a constraint matrix to an equivalent matrix expressed in active weight
format (relative to the index).

Portfolio linear inequality constraint matrix expressed in absolute
weight format. 



The transformed portfolio linear inequality constraint matrix
expressed in active weight format, also of the form 
Set up constraints for a portfolio optimization for portfolio w0
with
constraints in the form A*w <= b
, where w
is
absolute portfolio weights. (Absolute weights do not depend on the
tracking portfolio.) Use abs2active
to convert
constraints in terms of absolute weights into constraints in terms
of active portfolio weights, defined relative to the tracking portfolio w0
.
Assume three assets with the following mean and covariance of asset
returns:
m = [ 0.14; 0.10; 0.05 ];
C = [ 0.29^2 0.4*0.29*0.17 0.1*0.29*0.08; 0.4*0.29*0.17 0.17^2 0.3*0.17*0.08;...
0.1*0.29*0.08 0.3*0.17*0.08 0.08^2 ];
Absolute portfolio constraints are the typical ones (weights
sum to 1 and fall from 0 through 1), create the A
and b
matrices
using portcons
:
AbsCons = portcons('PortValue',1,3,'AssetLims', [0; 0; 0], [1; 1; 1;]);
Use the Portfolio
object
to determine the efficient frontier:
p = Portfolio('AssetMean', m, 'AssetCovar', C); p = p.setInequality(AbsCons(:,1:end1), AbsCons(:,end)); p.plotFrontier;
The tracking portfolio w0
is:
w0 = [ 0.1; 0.55; 0.35 ];
Use abs2active
to compute the constraints
for active portfolio weights:
ActCons = abs2active(AbsCons, w0)
This returns:
ActCons = 1.0000 1.0000 1.0000 0 1.0000 1.0000 1.0000 0 1.0000 0 0 0.9000 0 1.0000 0 0.4500 0 0 1.0000 0.6500 1.0000 0 0 0.1000 0 1.0000 0 0.5500 0 0 1.0000 0.3500
Use the Portfolio
object p
and
its efficient frontier to demonstrate expected returns and risk relative
to the tracking portfolio w0
:
p = p.setInequality(ActCons(:,1:end1), ActCons(:,end)); p.plotFrontier;
Note, when using abs2active
to compute "active
constraints" for use with a Portfolio object, don't use the
Portfolio object's default constraints because the relative
weights can be positive or negative (the setDefaultConstraints
function
specifies weights to be nonnegative).
abs2active
transforms a constraint matrix
to an equivalent matrix expressed in active weight format (relative
to the index). The transformation equation is
$$A{w}_{absolute}=A\left({w}_{active}+{w}_{index}\right)\le {b}_{absolute}.$$
Therefore
$$A{w}_{active}\le {b}_{absolute}A{w}_{index}={b}_{active}.$$
The initial constraint matrix consists
of NCONSTRAINTS
portfolio linear inequality constraints
expressed in absolute weight format. The index portfolio vector contains NASSETS
assets.
active2abs
 pcalims
 pcglims
 pcpval
 portcons
 Portfolio
 setInequality