How To Optimize Portfolio With Target Risk And Return Constraints With Weight Constraints Together

조회 수: 2 (최근 30일)
symbol=timur.Properties.VariableNames(1:end)
monthlyReturn=timur(2:end,1:end)
P=Portfolio('AssetList',symbol,'RiskFreeRate',0.0008)
P=estimateAssetMoments(P,monthlyReturn)
P=setDefaultConstraints(P)
targetRetn = 0.15;
pwgt = estimateFrontierByReturn(P, targetRetn)
targetRisk = 0.10;
pwgt=estimateFrontierByRisk(P,targetRisk)
P = setMinMaxNumAssets(P, 1, 3)
disp(P.NumAssets)
disp(P.bInequality)
LowerBound = [0.1; 0.1; 0.1]
UpperBound= [0.5; 0.5; 0.5]
P = setBounds(P, LowerBound, UpperBound)
optimalweight=estimateMaxSharpeRatio(P)
[optrisk,optret]=estimatePortMoments(P,optimalweight)
display=(optret)
My code is working but we get 2 solutions first solution is withuot target risk and return optimization second one just target risk and return optimization without other constraints . Target risk and return not working with MaxSharpeRatio estimation.
  댓글 수: 1
nick
nick 2023년 9월 27일
I want to confirm if you are looking for a way to include target risk and target return as constraints while using MaxSharpeRatio estimation.

댓글을 달려면 로그인하십시오.

답변 (1개)

Shivam Lahoti
Shivam Lahoti 2024년 1월 9일
Hi Mahir,
I understand that you want to optimize your portfolio while keeping constraints like target risk return constraints along with keeping weight constraints intact.
The code provided by you uses ‘estimateMaxSharpeRatio’ to get the weights of assets in the portfolio. Though it is a powerful function for portfolio optimization, it does not allow for the direct inclusion of target return or target risk constraints. To incorporate such constraints, you would need to use a more general optimization function that MATLAB provides. Please have a look at the below documentation to understand different approaches.
Apart from this, if you want to narrow down the constraint to one parameter, you shall consider using ‘estimateFrontierByReturn’ and ‘estimateFrontierByRisk’. These functions estimate points on the efficient frontier corresponding to a target return or risk. Please find the documentation for these functions below:
I hope this was helpful.
Regards,
Shivam Lahoti.

카테고리

Help CenterFile 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!

Translated by