Skip to main content

Spot rate curve

Awaiting user input

Comments

2 comments

  • Official comment
    Simranjit Kaur
    • Gurobi Staff
    This post is more than two years old. Some information may not be up to date. For current information, please check the Gurobi Documentation or Knowledge Base. If you need more help, please create a new post in the community forum, or try Gurobot, our chatbot interface offering instant, expert-level support.
  • Mario Ruthmair
    • Gurobi Staff

    Hi Daniel,

    Indeed, formulating this function in a Gurobi model is a bit involved.

    First, you do not need addGenConstrPow() for quadratic terms, those are directly supported in the constraint formulation. In your case, you can remove variable SS, just state "... = S * S" in your sum constraints, and minimize S.

    Regarding the fraction in the sum, as far as I can see from your code only the r(t) are variables, correct?
    If yes, then you could create additional helper variables x(i,t) that are equivalent to the fraction for i and t, variables y(t) that correspond to (1+r(t)), and variables z(t) that correspond to y(t) ^ t. This leads to constraints

    S*S = sum_{i=1 to N} [ P(0,i) - sum_{t=1 to T} x(i,t) ]
    x(i,t) * z(t) = F(t,i)
    z(t) = y(t)^t (implemented via addGenConstrPow())
    y(t) = 1 + r(t)

    Except for the 3rd constraints, you can write every constraint in a straightforward way with addConstr().

    Did I miss something?

    Best regards,
    Mario

    0

Post is closed for comments.