Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

setTrackingError

Set up maximum portfolio tracking error constraint

Syntax

obj = setTrackingError(obj,TrackingError)
obj = setTrackingError(___,TrackingPort,NumAssets)

Description

example

obj = setTrackingError(obj,TrackingError) sets up a maximum portfolio tracking error constraint.

example

obj = setTrackingError(___,TrackingPort,NumAssets) sets up a maximum portfolio tracking error constraint using optional arguments for TrackingPort and NumAssets.

Examples

collapse all

Create a Portfolio object.

AssetMean = [ 0.05; 0.1; 0.12; 0.18 ];
AssetCovar = [ 0.0064 0.00408 0.00192 0;
    0.00408 0.0289 0.0204 0.0119;
    0.00192 0.0204 0.0576 0.0336;
    0 0.0119 0.0336 0.1225 ];

p = Portfolio('mean', AssetMean, 'covar', AssetCovar, 'lb', 0, 'budget', 1)
p = 
  Portfolio with properties:

          BuyCost: []
         SellCost: []
     RiskFreeRate: []
        AssetMean: [4x1 double]
       AssetCovar: [4x4 double]
    TrackingError: []
     TrackingPort: []
         Turnover: []
      BuyTurnover: []
     SellTurnover: []
             Name: []
        NumAssets: 4
        AssetList: []
         InitPort: []
      AInequality: []
      bInequality: []
        AEquality: []
        bEquality: []
       LowerBound: [4x1 double]
       UpperBound: []
      LowerBudget: 1
      UpperBudget: 1
      GroupMatrix: []
       LowerGroup: []
       UpperGroup: []
           GroupA: []
           GroupB: []
       LowerRatio: []
       UpperRatio: []

Estimate the Sharpe ratio for the Portfolio object p and define the tracking error.

x0 = estimateMaxSharpeRatio(p);
te = 0.08;
p = setTrackingError(p, te, x0);
display(p.NumAssets);
     4
display(p.TrackingError);
    0.0800
display(p.TrackingPort);
    0.6608
    0.1622
    0.0626
    0.1143

Input Arguments

collapse all

Object for portfolio, specified using a Portfolio object. For more information on creating a portfolio object, see Portfolio.

Upper bound for portfolio tracking error, specified using a nonnegative and finite scalar.

Given an upper bound for portfolio tracking error in TrackingError and a tracking portfolio in TrackingPort, the tracking error constraint requires any portfolio in Port to satisfy

(Port - TrackingPort)'*AssetCovar*(Port - TrackingPort) <= TrackingError^2 .
For more information, see Tracking Error Constraints.

Data Types: double

Tracking portfolio weights, specified using a vector. TrackingPort must be a finite vector with NumAssets > 0 elements.

If no TrackingPort is specified, it is assumed to be 0. If TrackingPort is specified as a scalar and NumAssets exists, then TrackingPort undergoes scalar expansion.

Data Types: double

Number of assets in portfolio, specified using a scalar. If it is not possible to obtain a value for NumAssets, it is assumed that NumAssets is 1.

Data Types: double

Output Arguments

collapse all

Updated portfolio object, returned as a Portfolio object. For more information on creating a portfolio object, see Portfolio.

Note

The tracking error constraints can be used with any of the other supported constraints in the Portfolio object without restrictions. However, since the portfolio set necessarily and sufficiently must be a non-empty compact set, the application of a tracking error constraint can result in an empty portfolio set. Use estimateBounds to confirm that the portfolio set is non-empty and compact.

Tips

You can also use dot notation to set up a maximum portfolio tracking error constraint.

obj = obj.setTrackingError(TrackingError, NumAssets);

To remove a tracking portfolio, call this function with an empty argument ([]) for TrackingError.

obj = setTrackingError(obj, [ ]);

Introduced in R2015b

Was this topic helpful?