Skip to content
13

Base JuMP Optimisation

PortfolioOptimisers.BaseJuMPOptimisationEstimator Type
julia
abstract type BaseJuMPOptimisationEstimator <: BaseOptimisationEstimator

Abstract supertype for base JuMP-based portfolio optimisation estimators.

These are configuration-level types (e.g., JuMPOptimiser) that define the optimisation problem setup for JuMP-based optimisers.

Related Types

source
PortfolioOptimisers.JuMPOptimisationEstimator Type
julia
abstract type JuMPOptimisationEstimator <: NonFiniteAllocationOptimisationEstimator

Abstract supertype for JuMP-based portfolio optimisation estimators.

JuMP optimisers formulate and solve portfolio optimisation problems using mathematical programming via the JuMP.jl framework.

Related Types

source
PortfolioOptimisers.RiskJuMPOptimisationEstimator Type
julia
abstract type RiskJuMPOptimisationEstimator <: JuMPOptimisationEstimator

Abstract supertype for risk-based JuMP portfolio optimisation estimators.

Subtype RiskJuMPOptimisationEstimator to implement optimisers that minimise or constrain risk measures as the primary objective.

Related Types

source
PortfolioOptimisers.ObjectiveFunction Type
julia
abstract type ObjectiveFunction <: AbstractEstimator

Abstract supertype for portfolio objective functions.

Subtype ObjectiveFunction to implement portfolio optimisation objectives such as minimum risk, maximum return, or maximum Sharpe ratio.

Related Types

source
PortfolioOptimisers.JuMPReturnsEstimator Type
julia
abstract type JuMPReturnsEstimator <: AbstractEstimator

Abstract supertype for JuMP-based returns estimators used in optimisation models.

JuMPReturnsEstimator types define how expected returns are incorporated into JuMP models.

Related Types

source
PortfolioOptimisers.JuMPConstraintEstimator Type
julia
abstract type JuMPConstraintEstimator <: AbstractConstraintEstimator

Abstract supertype for JuMP constraint estimators.

Subtype JuMPConstraintEstimator to implement custom constraints or objectives for JuMP-based portfolio optimisers.

Related Types

source
PortfolioOptimisers.CustomJuMPConstraint Type
julia
abstract type CustomJuMPConstraint <: JuMPConstraintEstimator

Abstract supertype for custom JuMP constraint implementations.

Implement add_custom_constraint! to define custom JuMP model constraints.

Related Types

source
PortfolioOptimisers.CustomJuMPObjective Type
julia
abstract type CustomJuMPObjective <: JuMPConstraintEstimator

Abstract supertype for custom JuMP objective implementations.

Implement add_custom_objective_term! to add custom terms to the JuMP model objective.

Related Types

source
PortfolioOptimisers.JuMPOptimisationSolution Type
julia
struct JuMPOptimisationSolution{__T_w} <: OptimisationModelResult

Stores the solution (portfolio weights) from a JuMP optimisation model.

Fields

  • w: Optimal portfolio weights (non-empty array of numbers).

Related

source
PortfolioOptimisers.add_custom_objective_term! Function
julia
add_custom_objective_term!(args...; kwargs...)

Add a custom objective term to the JuMP model.

No-op fallback. Override this method for subtypes of CustomJuMPObjective to add custom penalty or reward terms to the JuMP model objective.

Arguments

  • args...: JuMP model and custom objective type (ignored in fallback).

  • kwargs...: Additional keyword arguments.

Returns

  • nothing.

Related

source
PortfolioOptimisers.add_custom_constraint! Function
julia
add_custom_constraint!(args...; kwargs...)

Add a custom constraint to the JuMP model.

No-op fallback. Override this method for subtypes of CustomJuMPConstraint to add custom constraints to the JuMP model.

Arguments

  • args...: JuMP model and custom constraint type (ignored in fallback).

  • kwargs...: Additional keyword arguments.

Returns

  • nothing.

Related

source
PortfolioOptimisers.set_model_scales! Function
julia
set_model_scales!(model::JuMP.Model, so::Number, sc::Number)

Register objective scale so and constraint scale sc as named expressions in the JuMP model.

Arguments

  • model::JuMP.Model: JuMP optimisation model.

  • so::Number: Objective scale factor.

  • sc::Number: Constraint scale factor.

Returns

  • nothing.

Related

source
PortfolioOptimisers.set_initial_w! Function
julia
set_initial_w!(args...)
set_initial_w!(w::VecNum, wi::VecNum)

Set initial (warm-start) values for portfolio weight variables in the JuMP model.

The no-op fallback does nothing when wi is not provided. The two-argument method sets JuMP start values for each weight variable.

Arguments

  • w::VecNum: Vector of JuMP weight variables.

  • wi::VecNum: Vector of initial weight values.

Returns

  • nothing.

Related

source
PortfolioOptimisers.set_w! Function
julia
set_w!(model::JuMP.Model, X::MatNum, wi::Option{<:VecNum_VecVecNum})

Create portfolio weight variables in the JuMP model and optionally set initial values.

Registers a vector of weight variables w of length size(X, 2) in the model. If wi is provided, sets the initial values via set_initial_w!.

Arguments

  • model::JuMP.Model: JuMP optimisation model.

  • X::MatNum: Asset returns matrix (shape: observations × assets).

  • wi: Optional initial weight values.

Returns

  • nothing.

Related

source
PortfolioOptimisers.set_portfolio_returns! Function
julia
set_portfolio_returns!(model::JuMP.Model, X::MatNum)

Compute and register portfolio returns expression X * w in the JuMP model.

If the expression already exists in the model, returns it directly (idempotent).

Arguments

  • model::JuMP.Model: JuMP optimisation model.

  • X::MatNum: Asset returns matrix.

Returns

  • The portfolio returns expression.

Related

source
PortfolioOptimisers.set_net_portfolio_returns! Function
julia
set_net_portfolio_returns!(model::JuMP.Model, X::MatNum)

Compute and register net portfolio returns (after fees) in the JuMP model.

Calls set_portfolio_returns! and subtracts fees if present.

Arguments

  • model::JuMP.Model: JuMP optimisation model.

  • X::MatNum: Asset returns matrix.

Returns

  • The net portfolio returns expression.

Related

source
PortfolioOptimisers.set_portfolio_returns_plus_one! Function
julia
set_portfolio_returns_plus_one!(model::JuMP.Model, X::MatNum)

Compute and register portfolio gross returns X .+ 1 in the JuMP model.

Used in drawdown and logarithmic return computations.

Arguments

  • model::JuMP.Model: JuMP optimisation model.

  • X::MatNum: Portfolio returns expression.

Returns

  • The gross returns expression X .+ 1.

Related

source
PortfolioOptimisers.set_portfolio_drawdowns_plus_one! Function
julia
set_portfolio_drawdowns_plus_one!(model::JuMP.Model, X::MatNum)

Compute and register absolute drawdowns plus one in the JuMP model.

Computes absolute_drawdown_arr(X) .+ 1 and registers it in the model.

Arguments

  • model::JuMP.Model: JuMP optimisation model.

  • X::MatNum: Portfolio returns expression.

Returns

  • The drawdowns-plus-one expression.

Related

source