Class ConstrainedPortfolioOptimizer
java.lang.Object
com.quantfinlib.optimization.ConstrainedPortfolioOptimizer
Constrained long-only optimizer: per-asset weight bounds (position caps /
floors) and an optional turnover penalty against current holdings —
adjusted return = μ·w − penalty · Σ|w − w_current| — so the
optimizer trades expected gain against the real cost of getting there.
Same derivative-free search as PortfolioOptimizer with feasibility
projection.-
Constructor Summary
ConstructorsConstructorDescriptionConstrainedPortfolioOptimizer(double[] expectedReturns, double[][] covariance) ConstrainedPortfolioOptimizer(double[] expectedReturns, double[][] covariance, long seed) -
Method Summary
Modifier and TypeMethodDescriptionmaxSharpe(double riskFreeRate) withBounds(double[] min, double[] max) Per-asset weight bounds; must admit a fully-invested portfolio.withTurnoverPenalty(double[] currentWeights, double penaltyPerUnitTurnover)
-
Constructor Details
-
ConstrainedPortfolioOptimizer
public ConstrainedPortfolioOptimizer(double[] expectedReturns, double[][] covariance) -
ConstrainedPortfolioOptimizer
public ConstrainedPortfolioOptimizer(double[] expectedReturns, double[][] covariance, long seed)
-
-
Method Details
-
withBounds
Per-asset weight bounds; must admit a fully-invested portfolio. -
withTurnoverPenalty
public ConstrainedPortfolioOptimizer withTurnoverPenalty(double[] currentWeights, double penaltyPerUnitTurnover) - Parameters:
penaltyPerUnitTurnover- expected-return units charged per unit of one-way turnover (e.g. transaction cost)
-
maxSharpe
-
minVolatility
-