openseries.efficient_frontier

openseries.efficient_frontier(eframe, num_ports=5000, seed=71, bounds=None, frontier_points=200, minimize_method='SLSQP', *, tweak=True)[source]

Identify an efficient frontier.

Parameters:
  • eframe (OpenFrame) – Portfolio data.

  • num_ports (int) – Number of possible portfolios to simulate. Defaults to 5000.

  • seed (int) – The seed for the random process. Defaults to 71.

  • bounds (tuple[tuple[float, float], ...] | None) – The range of minimum and maximum allowed allocations for each asset.

  • frontier_points (int) – Number of points along frontier to optimize. Defaults to 200.

  • minimize_method (LiteralMinimizeMethods) – The method passed into the scipy.minimize function. Defaults to SLSQP.

  • tweak (bool) – Cutting the frontier to exclude multiple points with almost the same risk. Defaults to True.

Returns:

The efficient frontier data, simulation data and optimal portfolio.

Return type:

tuple[DataFrame, DataFrame, NDArray[float64]]