Professional Documents
Culture Documents
In the CAPM and APT pricing theories, we assumed linearity in the models and solved for
expected security prices using regressions in Python.
As the number of securities in our portfolio increases, certain limitations are introduced as
well. Portfolio managers would find themselves constrained by these rules in pursuing
certain objectives mandated by investors.
Unfortunately, in Python, there is no single official package that supports this solution.
However, there are third-party packages available with an implementation of the simplex
algorithm for linear programming. For the purpose of this demonstration, we will use Pulp,
an open source linear programming modeler, to assist us in this particular linear
programming problem.
• For every 2 units of the security X invested and 1 unit of the security Y invested, the
total volume must not exceed 100
• For every unit of the securities X and Y invested, the total volume must not exceed 80
• The total volume allowed to invest in the security X must not exceed 40
• Short-selling is not allowed for securities