Items tagged with portfolio portfolio Tagged Items Feed

I have a non linear Sharpe ratio with 3 portfolio weights w1,w2 and w2. I want to (globally) maximize the sharpe ratio by choosing w1,w2 and w2 subject to the constraints that each of the variables is in the range of 0 to 1, and that their summation is equal to 1. I also want the maximization to start at an initial point of [w1=0.35,w2=0.6,w3=0.05].

The function is:

SR:= (0.012w1+0.007w2+0.0384w3-0.009)/(stdev)

where stdev is the standard deviation of the portfolio ...

Mean-Absolute Deviation

January 02 2012 by alex_01 2978 Maple 13

So, I am reading the blog post about Mean Absolute Deviation portfolio optimization that

http://yetanothermathprogrammingconsultant.blogspot.com/2010/04/portfolio-from-qp-to-lp.html

 

claims that the traditional portfolio optimization problem can be expressed as seen below:

I am not sure however that it is 100% correct for example you have (r[i,t...

Ok, first of all I renamed the return matrix R (A is allready used)
I now think I got two of them (minimize portfolio variance and minimize portfolio variance for a
given expected return in matrix form) figured out:


Cov := Matrix(CovarianceMatrix(R), datatype = float):
pr := .6*max([seq(ExpectedValue(Column(R, i)), i = 1 .. nstock)]):

A := Matrix([[seq(1, i = 1 .. nstock)]], datatype = float):
b := Vector([1], datatype = float):
Aeq := Matrix(...

Test.mw

If I use a binary {0,1} linear program the cardinal constraint ie control the
number of 1's (long positions in portfolio) works beautiful. See attached worksheet.

The problem starts when I convert the problem into a constrained integer {-1,0,1}
linear problem where -1= short position, 0=no position and 1=long position.

In the first example when we add the constraint  add(w[i], i = 1 .. NC) = 4

restart:
with(LinearAlgebra):
with(ArrayTools):
with(Statistics):
randomize():
with(plots):
with(combinat):

n := 100:
nstock := 7:
corr := .8:

R := Matrix(nstock, nstock, proc (i, j) options operator, arrow; `if`(i = j, 1, corr) end proc):
CD := Matrix(LUDecomposition(evalf(R), 'method' = 'Cholesky'), datatype = float[8]):

ev := [seq((1/5)*(rand(-3 .. 4))(), i = 1 .. nstock)]:
st := [seq((rand(1 .. 2))(), i = 1 .. nstock)]:

Page 1 of 1