Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmartin8 committed May 5, 2021
1 parent 287e50b commit 1db0896
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/FAQ.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Constraining the number of assets
Unfortunately, cardinality constraints are not convex, making them difficult to implement.

However, we can treat it as a mixed-integer program and solve (provided you have access to a solver).
or small problems with less than 1000 variables and constraints, you can use the community version of CPLEX:
for small problems with less than 1000 variables and constraints, you can use the community version of CPLEX:
``pip install cplex``. In the below example, we limit the portfolio to at most 10 assets::

ef = EfficientFrontier(mu, S, solver=cp.CPLEX)
Expand Down
4 changes: 3 additions & 1 deletion docs/UserGuide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,10 @@ To combat this, I have introduced an objective function which borrows the idea o
regularisation from machine learning. Essentially, by adding an additional cost
function to the objective, you can 'encourage' the optimizer to choose different
weights (mathematical details are provided in the :ref:`L2-Regularisation` section).
To use this feature, change the ``gamma`` parameter::
To use this feature, change the ``gamma`` parameter::

from pypfopt import objective_functions

ef = EfficientFrontier(mu, S)
ef.add_objective(objective_functions.L2_reg, gamma=0.1)
w = ef.max_sharpe()
Expand Down

0 comments on commit 1db0896

Please sign in to comment.