FICO Xpress Optimization Examples Repository
 FICO Optimization Community FICO Xpress Optimization Home

Economics and finance

Description
H‑1 H‑2 H‑3 Problem name and type, features Difficulty Choice of loans * calculation of net present value Publicity campaign * forall-do Portfolio selection ** sets of integers, second formulation with semi-continuous, parameters Financing an early retirement scheme ** inline if, selection with `|' Family budget ** formulation of monthly balance constraints including different payment frequencies; as, mod, inline if, selection with `|' Choice of expansion projects ** experiment with solutions: solve LP problem explicitly, ``round'' some almost integer variable and re-solve Mean variance portfolio selection: Quadratic Programming problem *** parameters, forall-do, min, max, loop over problem solving

Further explanation of this example: 'Applications of optimization with Xpress-MP', Chapter 13: Economics and finance problems

Source Files

Data Files

h1loan.mos

```(!******************************************************
Mosel Example Problems
======================

file h1loan.mos
```````````````
Choice of loans

(c) 2008 Fair Isaac Corporation
author: S. Heipcke, Mar. 2002
*******************************************************!)

model "H-1 Loan choice"
uses "mmxprs"

declarations
BANKS = 1..3                         ! Set of banks
SHOPS = {"London", "Munich", "Rome"} ! Set of shops
DUR: integer                         ! Duration of loans

PRICE: array(SHOPS) of integer       ! Price of shops
RATE: array(BANKS,SHOPS) of real     ! Interest rates offered by banks
VMAX: integer                        ! Maximum loan volume per bank

borrow: array(BANKS,SHOPS) of mpvar  ! Loan taken from banks per project
end-declarations

initializations from 'h1loan.dat'
PRICE RATE VMAX DUR
end-initializations

! Objective: interest payments
Interest:=
sum(b in BANKS, s in SHOPS) borrow(b,s)*RATE(b,s)/(1-(1+RATE(b,s))^(-DUR))

! Finance all projects
forall(s in SHOPS) sum(b in BANKS) borrow(b,s) = PRICE(s)

! Keep within maximum loan volume per bank
forall(b in BANKS) sum(s in SHOPS) borrow(b,s) <= VMAX

! Solve the problem
minimize(Interest)

! Solution printing
writeln("Total interest: ", getobjval)
forall(s in SHOPS) do
write("Shop in ", s, ": ")
forall(b in BANKS)
write( if(getsol(borrow(b,s))>0,
" bank " + b + ": " + getsol(borrow(b,s))/1000000 + " million",
""))
writeln
end-do

end-model

```