25.11.2015 Views

The MOSEK Python optimizer API manual Version 7.0 (Revision 141)

Optimizer API for Python - Documentation - Mosek

Optimizer API for Python - Documentation - Mosek

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 8<br />

A case study<br />

8.1 Portfolio optimization<br />

8.1.1 Introduction<br />

In this section the Markowitz portfolio optimization problem and variants are implemented using the<br />

<strong>MOSEK</strong> <strong>optimizer</strong> <strong>API</strong>.<br />

An alternative to using the <strong>optimizer</strong> <strong>API</strong> is the Fusion <strong>API</strong> which is much simpler to use because<br />

it makes it possible to implement the model almost as stated on paper. It is not uncommon that an<br />

optimization problem can be implemented using the Fusion <strong>API</strong> in 1/10th of the time implementing<br />

it using the <strong>optimizer</strong> <strong>API</strong>. On the other hand, a well implemented model in the <strong>optimizer</strong> <strong>API</strong> will<br />

usually run faster than the same Fusion model.<br />

Since it so fast to implement a model in Fusion it can be attractive to implement a model in Fusion<br />

first because that way the results from the Fusion based code can be used to validate the results of<br />

the <strong>optimizer</strong> <strong>API</strong> implementation.<br />

Subsequently the following MATLAB inspired notation will be employed. <strong>The</strong> : operator is used as<br />

follows<br />

and hence<br />

If x and y are two column vectors, then<br />

i : j = {i, i + 1, . . . , j}<br />

x 2:4 =<br />

⎡<br />

⎣ x 2<br />

x 3<br />

x 4<br />

⎤<br />

⎦<br />

[ ] x<br />

[x; y] =<br />

y<br />

97

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!