Portfolio Optimization - by sector and carbon intensity
2 次查看(过去 30 天)
显示 更早的评论
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:
- Set a upper boundary portfolio weights for certain sector e.g. <10% of stocks should be invested in the financial sector
- 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!
0 个评论
回答(1 个)
Shivam Lahoti
2024-2-16
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Portfolio Optimization and Asset Allocation 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!