Our Customers
- HBOS Plc/ INSIGHT (UK)
- UBS Investment Research (UK)
- Fidelity Investment Ltd. (UK)
- Deutsche Bank (UK)
- APT INC (USA)
- MOD (UK)
- UNILEVER (UK/Netherlands)
- US Coast Guard (USA)
- British Gas (UK)
- Southern Electric (UK)
- DTI (UK)
- Allocare (Switzerland)
- NATO (Belgium)
- Singapore Defence (Singapore)
- Indian Institute of Management, Calcutta (India)
Contact Us
FortMP MEX Example
Problem Statement: National Insurance Associates carries an investment portfolio of stocks, bonds and other investment alternatives. Currently £200,000 of funds is available and must be considered for new investment opportunities. The four stock options National is considering and the relevant financial data are as follows:
|
Stock |
|||
|
A |
B |
C |
D |
Price per share (in Rs.) |
100 |
50 |
80 |
40 |
Annual rate of return |
0.12 |
0.08 |
0.06 |
0.10 |
Risk measure per Rs. invested |
0.10 |
0.07 |
0.05 |
0.08 |
Table-1: Financial Data
The risk measure indicates the relative uncertainty associated with the stock in terms of it realising the projected annual return: higher values indicate greater risk.
National’s top management has stipulated the following investment guidelines
- The annual rate of return for the portfolio must be 9%
- No one stock can account for more than 50% of the total sterling investment
They request you to find the investment decisions.
Mathematical formulation of the problem
MinimizeRisk = 10*StockA + 3.5*StockB + 4*StockC + 4*StockD
Variables
StockA ≤ 1000
StockB ≤ 2000
StockC ≤ 1250
StockD ≤ 2500
Subject to
100*StockA + 50*StockB + 80*StockC + 40*StockD ≤ 200000
12*StockA + 4*StockB + 4.8*StockC + 4*StockD ≤ 18000
Solving the Problem using FortMP-MEX
FortMP-MEX uses the following data representation to solve an LP problem.
The MATLAB function we will need is FMP_SOLVE
Open MATLAB and change to the MFortMP-MEX directory, then type the following command at the prompt
>>help FMP_SOLVE
Usage : [obj, sol ,dsl ,bas ,stsl, tctn] = FMP_SOLVE(A,L,U,l,u,k,c,mitype)
Description: Solves a model entered in canonical form
Inputs:-
k - is a scalar constant offset to the objective
c - is an n- vector of the cost coefficients c1,c2,...cn.
x - is an n- vector of the structural variables x1,x2,...xn
L - is an m-vector of lower right hand sides L1,L2,...Lm
A - is an m x n matrix of coefficients aij
U - is an m-vector of upper right hand sides U1,U2,...Um
l - is an n- vector of lower bounds l1,l2,...ln
u - is an n- vector of upper bounds u1,u2,...un
mitype - see manual
Output - see manual
Referring to our problem, now enter the inputs A, L, U, l, u, k, c and mitype into matlab:
We can now solve the problem by issuing the following commands at the MATLAB prompt -
Notice that we used -c because we want to maximize and the default is minimization. The exit code (tctn) is zero signifying that there was no error and a status code (stsl) of 3 meaning that an optimal linear solution was found.
The objective value -obj or sol(1) and the solution vectors are given by typing the following.
