quantlab.portfolio.approximate.PanelSolution#

class quantlab.portfolio.approximate.PanelSolution(weights, iterations, converged)[source]#

Bases: object

Every bar’s weights of a panel, as an implementation’s decide returns them.

Attributes:
weightsnp.ndarray

[bars, symbols]: finite on a decided bar, all NaN on a held one.

iterationsnp.ndarray

[bars]: the iterations an iterative solver took on each bar (0 for a rule that does not iterate, or a held bar).

convergednp.ndarray

[bars]: whether each bar met the solver’s stopping rule.

Examples

>>> solution = PanelSolution(
...     weights=np.array([[0.5, 0.5]]), iterations=np.array([0]), converged=np.array([True])
... )
>>> bool(solution.converged.all())
True