Hello!
How can I run such kind of optimization :
max Q subject to x = x1,..., xn, where = Rp / σp
and constraints :
Rp = R' * x
σp^2 =x' * Σ * x
sum(x) = 1
Can someone help me about how to write down my objective function ...and the rest of the constraints. What type of sover I need to use ?
Best regards,

댓글 수: 2

Walter Roberson
Walter Roberson 2019년 3월 21일
I think part of the equations got lost?
What is Q?
You say "where = " but what needs to equal that?
Why do you say "subject to" and list variable names?
In Rp / op is that matrix division (least squared fitting) or is it element-by-element division ?
DAN TURMACU
DAN TURMACU 2019년 3월 21일
편집: DAN TURMACU 2019년 3월 21일
yes.
Q = Rp / σp
Rp - Return of portfolio it is a number
σp - Risk of portfolio it is a number
but R' , Σ are matrix
The constraint is sum(x) = 1.

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

 채택된 답변

DAN TURMACU
DAN TURMACU 2019년 3월 21일

0 개 추천

Dear Torsten,
I have another unexpected problem.
When I run x = fmincon(fun,x0,A,b,Aeq,beq) in Command Window, I receive the error message:
Undefined function or variable 'returns'.
Error in @(x)-(x'*returns)/sqrt(x'*sigma*x)
Error in fmincon (line 564)
initVals.f = feval(funfcn{3},X,varargin{:});
Caused by:
Failure in initial user-supplied objective function evaluation. FMINCON
cannot continue.
I do not understand. I provided with returns and sigma matrixes in Workspace Window.
Thank you.

댓글 수: 2

Torsten
Torsten 2019년 3월 21일
편집: Torsten 2019년 3월 21일
Write a .m file and load it into matlab.
BTW: "returns" must be a vector of the same length as x, not a matrix.
DAN TURMACU
DAN TURMACU 2019년 3월 21일
Now it is ok. I have to run fun script first.
Many thanks,
Dan

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

추가 답변 (1개)

Torsten
Torsten 2019년 3월 21일
편집: Torsten 2019년 3월 21일

0 개 추천

Use fmincon with objective function
f = @(x)(R'*x)/sqrt(x'*sigma*x)
and linear constraint
Aeq = ones(size(x))
beq = 1
Best wishes
Torsten.

댓글 수: 6

DAN TURMACU
DAN TURMACU 2019년 3월 21일
Thank you very much,
Dan
DAN TURMACU
DAN TURMACU 2019년 3월 21일
I am searching for the max of Q.
I think I need to put objective function
f = @(x)sqrt(x'*sigma*x)/(R'*x)
for the min.
Walter Roberson
Walter Roberson 2019년 3월 21일
Use the negative of your problem to search for the maximum.
DAN TURMACU
DAN TURMACU 2019년 3월 21일
How may I ? I do not know.
Thanks.
Torsten
Torsten 2019년 3월 21일
f = @(x)-(R'*x)/sqrt(x'*sigma*x)
DAN TURMACU
DAN TURMACU 2019년 3월 21일
Thanks.

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

카테고리

도움말 센터File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기

제품

릴리스

R2008a

태그

질문:

2019년 3월 20일

댓글:

2019년 3월 21일

Community Treasure Hunt

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

Start Hunting!

Translated by