Portfolio Optimization - by sector and carbon intensity

2 visualizaciones (últimos 30 días)
Li Guobin
Li Guobin el 4 de Feb. de 2021
Respondida: Shivam Lahoti el 16 de Feb. de 2024
Hi,
I would like to use the matlab function to find the optimal sector allocation of an equity portfolio and include the following 2 constraints:
  1. Set a upper boundary portfolio weights for certain sector e.g. <10% of stocks should be invested in the financial sector
  2. Set a upper boundary portfolio weights such that the total carbon intensity of the portfolio is lower than a threshold e.g. total carbon intensity of the portfolio is lesser than 10,000GHG.
Would like to check how these can be implemented?
Thanks!

Respuestas (1)

Shivam Lahoti
Shivam Lahoti el 16 de Feb. de 2024
Hi Li Guobin,
The MATLAB Financial Toolbox allows for the optimization of a financial portfolio with various constraints. By creating a `Portfolio` object, you can set up expected returns and covariances, enforce a budget constraint where the sum of weights equals one, and prevent short selling by setting bounds between zero and one. Sector-specific constraints, such as limiting the financial sector to a maximum of 10%, can be added using `addGroups`. Additionally, custom linear inequality constraints, like a carbon intensity cap, can be implemented with `setInequality`. The optimal portfolio weights that maximize the Sharpe ratio are then estimated using `estimateMaxSharpeRatio`.
Please have a look at the code below to understand How these functions could be used.
% Create a Portfolio object
p = Portfolio('AssetList', assetNames, 'RiskFreeRate', riskFreeRate);
% Set up the problem with expected returns and covariances
p = setAssetMoments(p, expReturns, expCovariances);
% Add a total budget constraint (sum of weights is 1)
p = setBudget(p, 1, 1);
% Add a no-short selling constraint
p = setBounds(p, 0, 1);
% Define the sector constraint for the financial sector
financialSectorUpperBound = 0.10;
p = addGroups(p, assetIndustries, 0, financialSectorUpperBound);
% Define the carbon intensity constraint using setInequality
carbonIntensityUpperBound = 10000;
Aineq = carbonIntensity';
bineq = carbonIntensityUpperBound;
p = setInequality(p, Aineq, bineq);
% Estimate the portfolio with the maximum Sharpe ratio
maxSharpeRatioWeights = estimateMaxSharpeRatio(p);
To understand more about the portfolio object of MATLAB, kindly refer to the below documentation:
I hope this helps,
Shivam.

Categorías

Más información sobre Portfolio Optimization and Asset Allocation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by