Nested for loop portfolio optimization
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi guys,
I am probably doing something utterly silly which holds me back from retrieving the desired results.
I have two matrices: Matrix(A), which is a vector containing returns from three risky assets, and Matrix C, which consists of optimally genereated weights of those risky assets. To obtain the return, I wrote the following loop:
for i = 1:155
for j = 1:155
returns = A(i,:)*C(j,:)'
end
end
This code yields a 1x155 matrix, exactly as I asked for, But, the answers are not correct.
Does anyone have a clue what I do wrong here?
Thanks for the effort!
Cheers,
Kevin
2 comentarios
Matt J
el 2 de Mayo de 2013
The code you've shown returns a scalar, not a 1x155 vector. You should show us the code you're actually using.
Respuestas (1)
Ver también
Categorías
Más información sobre Quadratic Programming and Cone Programming en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!