okama.EfficientFrontier.bounds
- property EfficientFrontier.bounds
Return bounds for the assets weights.
Bounds are used in Mean-Variance optimization. Each asset can have weights limitation from 0 to 1.0.
If an asset has limitation for 10 to 20% bounds are defined as (0.1, 0.2). bounds = ((0, .5), (0, 1)) shows that in Portfolio with two assets first one has weight limitations from 0 to 50%. The second asset has no limitations.
- Returns:
- tuple of ((float, float),…)
Weights bounds used for portfolio optimization.
Examples
>>> two_assets = ok.EfficientFrontier(['SPY.US', 'AGG.US']) >>> two_assets.bounds ((0.0, 1.0), (0.0, 1.0))
By default there are no limitations for assets weights. Bounds can be set for a Efficient Frontier object.
>>> two_assets.bounds = ((0.5, 0.9), (0, 1.0))
Now the optimization is bounded (SPY has weights limits from 50 to 90%).