maximisation of the utility function , portfolio optimization

Hi,
I am trying to miximize a utility function of an investor , I use CRRA utility , , , is known such that
, , , , γ is risk averse with constant value and ( R_1,...,R_4 ) is the matrix returns in excel file with 4 asstes and 249 observations and
So , everthing is known except from the weights ( x_1,...,x_4) , I need to find the optimal weights $x_i$ which maximize expected utility with constraint
I don't know how to solve this optimization problem , does this problem nonlinear optimization problem ?
Thank you

2 Comments

R_t is a time-dependent random variable ? What distribution follow its components ?
sum_{i=1}^{i=4} x_i*R_t is meant to be x(1)*R_t(1,:) + x(2)*R_t(2,:) + x(3)*R_t(3,:) + x(4)*R_t(4,:) ?
How is u(c) defined with c being a vector ?
I guess E[...] is expectation ?
You need to explain your problem in more detail to get an answer.
I updated my question with more details , I hope it's clear now

Sign in to comment.

 Accepted Answer

Calculate W1*Rt1, W2*Rt2,...,W4*Rt4. Let Wi*Rti be maximum. Then (assuming gamma < 1) x_i = 1, x_j = 0 for i~=j is optimal.

8 Comments

Sorry what does it mean to let Wi*Rti maximum ? I made some change on my formulation of the objective function , could you please take allok at it
Your formulation must still be wrong.
m = sum_i x(i) * w_i is a vector of length 1x4.
Now you multiply this vector with R which is 4x249.
The result is a vector of length 1x249.
Now you apply the utility function u to this vector. This gives a vector of the same length.
So you want to maximize a vector. What does that mean ?
so we sum the objective function evaluated at each t and maximize the sum over the vector of m_i
So the problem is as follows ?
max: sum_{i=1}^{i=249} u(c_i)
c = x.' * W*R
W = [w1.'; w2.'; w3.'; w4.']
sum_{j=1}^{j=4} x_j = 1
c = sum_{j=1}^{4} x_j.' * W_j*R
I think both expression are equal, aren't they ?
Use "fmincon" to solve for x1-x4.
Call fmincon as
W = ...;
R = ...;
gamma = ...;
Aeq = [1 1 1 1];
beq = 1;
u = @(x) 1/(1-gamma)*x.^(1-gamma);
obj = @(x)-sum(u(x.'*W*R))
x = fmincon(obj,0.25*ones(1,4),[],[],Aeq,beq)
Thank you very much it works with me however it gives me the following
Local minimum possible. Constraints satisfied.
fmincon stopped because the size of the current step is less than
the value of the step size tolerance and constraints are
satisfied to within the value of the constraint tolerance.
is there any different function I can apply it to compare the results ?
is there any different function I can apply it to compare the results ?
You could try "ga".
For completeness, you should add the bound constraints
lb = zeros(4,1);
ub = ones(4,1);
as lower and upper bound constraints for the x(i):
W = ...;
R = ...;
gamma = ...;
Aeq = [1 1 1 1];
beq = 1;
lb = zeros(4,1);
ub = ones(4,1);
u = @(x) 1/(1-gamma)*x.^(1-gamma);
obj = @(x)-sum(u(x.'*W*R));
x = fmincon(obj,0.25*ones(1,4),[],[],Aeq,beq,lb,ub)

Sign in to comment.

More Answers (0)

Asked:

on 6 Feb 2023

Edited:

on 8 Feb 2023

Community Treasure Hunt

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

Start Hunting!