[FlopCpp] Extension of stampl.cpp for a portfolio optimization problem

Jia Li jialicn81 at yahoo.com
Wed Sep 13 09:25:21 EDT 2006


That's what I suspected. Is there any way to tackle my original problem then? I'm stuck there...

Jia

----- Message d'origine ----
De : Tim Hultberg <Tim.Hultberg at eumetsat.int>
À : flopcpp at list.coin-or.org; Jia Li <jialicn81 at yahoo.com>
Envoyé le : Mercredi, 13 Septembre 2006, 3h04mn 59s
Objet : Re: [FlopCpp] Extension of stampl.cpp for a portfolio optimization problem

FLOPC++ only handles linear problems (LPs and MIPs). Thats also why you
cant have division by expressions involving variables.
 
What you try to specify instead are quadratic contraints, since Buy,
TotalReturn and Liability are all MP_variables.

Best regrads, Tim

>>> Jia Li <jialicn81 at yahoo.com> 13/09/2006 12:59 >>>
Hi All,

I'm working on the problem of portfolio optimization. I'm modifying the
stampl.cpp written by Tim. A basic feature we're adding is a MP_variable
Liability at each stage to denote the liability. From one year to
another we can compute a "total return" by

MP_variable total return = sum(new asset value)/sum(asset value
one-year ago)

Then we'll calculate

MP_variable Liability() = parent->Liability() * (some function based on
total return);

In FlopC++ the operation of division of two "sum"s is not computable,
so we need to circumvent it. What I did is to write it as a constraint:

MP_constraint PortfReturn( ) = sum( INSTR, parent->Buy( INSTR ) ) *
TotalReturn() >= sum(INSTR,  parent->Buy(INSTR) * Return(INSTR));

Then another constraint to compute the new liability:

MP_constraint NewLiability( ) = Liability( ) == parent->Liability( ) *
TotalReturn( );

The problem is that these two lines won't compile. For the first line
the error is ".\portfopt.cpp(81) : error C2678: binary '*' : no operator
found which takes a left-hand operand of type 'flopc::MP_expression' (or
there is no acceptable conversion)"; for the second is
".\portfopt.cpp(82) : error C2678: binary '*' : no operator found which
takes a left-hand operand of type 'const flopc::VariableRef' (or there
is no acceptable conversion)".

It seems that it's not a feasible way to describe the problem to
FlopC++. Could you offer any help or advice on the issue? Thanks in
advance.

With best regards,

Jia Li




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/flopcpp/attachments/20060913/473f3650/attachment.html


More information about the FlopCpp mailing list