Group Abstract Group Abstract

Message Boards Message Boards

0
|
867 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Simple optimization does not provide answer

Posted 2 months ago

Hi, I am first time Mathematica user. I use Chatgpt to help me generate codes for a simple optimization problem in investment. But Mathematica does not provide any solution nor does it show any error message. I am not sure what is going on. Here is the code:

ClearAll[miu1,miu2,sig11,sig,sig,sig22,miut,w1,w2]
miu = {miu1,miu2};
sigma = {{sig11,sig},{sig,sig22}};
w = {w1,w2};
constraints = {w1+w2==1,miu.w<=miut};
varianceExpr =w.sigma.w;
Minimize[{varianceExpr,constraints},{w1,w2}, Reals]

Thanks!

POSTED BY: Charles He
2 Replies
Posted 2 months ago

What can you say about the values of miu1, miu2, and miut to which you haven't placed any restrictions? By giving values to those variables, do you get a result? I assume that sig11 > 0 and sig22 > 0 but you haven't told that to Mathematica. Also note that ChatGPT can even give you Mathematica code where some of the functions in that generated code don't even exist.

POSTED BY: Jim Baldwin
POSTED BY: Michael Rogers
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard