Naive optimisation
PortfolioOptimisers.NaiveOptimisationEstimator Type
abstract type NaiveOptimisationEstimator <: NonFiniteAllocationOptimisationEstimatorAbstract supertype for naive (heuristic) portfolio optimisation estimators.
Naive optimisers compute portfolio weights directly from statistical properties of asset returns (e.g., volatility or equal weights) without solving an optimisation problem.
Related Types
sourcePortfolioOptimisers.NaiveOptimisationResult Type
struct NaiveOptimisationResult{__T_oe, __T_pr, __T_wb, __T_retcode, __T_w, __T_fb} <: NonFiniteAllocationOptimisationResultResult type for naive portfolio optimisation estimators.
Fields
oe: Type of the optimisation estimator that produced this result.pr: Prior result used in optimisation (ornothing).wb: Weight bounds applied.retcode: Optimisation return code (OptimisationSuccessorOptimisationFailure).w: Optimal portfolio weights vector.fb: Fallback result (if a fallback optimiser was used).
Related
sourcePortfolioOptimisers.InverseVolatility Type
struct InverseVolatility{__T_pe, __T_wb, __T_sets, __T_wf, __T_fb, __T_sq, __T_brt, __T_strict} <: NaiveOptimisationEstimatorInverse Volatility portfolio optimiser.
InverseVolatility allocates portfolio weights inversely proportional to each asset's volatility (standard deviation). Optionally, sq = true uses variance instead.
Mathematical Definition
where sq = true) of asset
Fields
pe: Prior estimator or prior result for computing asset covariance.wb: Weight bounds estimator or bounds.sets: Asset sets (required whenwbis aWeightBoundsEstimator).wf: Weight finaliser for enforcing bounds.fb: Fallback optimiser (used if this optimiser fails).sq: Iftrue, weights are inversely proportional to variance rather than volatility.brt: Iftrue, uses bootstrap returns instead of the original returns.strict: Iftrue, strictly enforces weight bounds.
Constructors
InverseVolatility(;
pe::PrE_Pr = EmpiricalPrior(),
wb::Option{<:WbE_Wb} = WeightBounds(),
sets::Option{<:AssetSets} = nothing,
wf::WeightFinaliser = IterativeWeightFinaliser(),
fb::Option{<:OptE_Opt} = nothing,
sq::Bool = false,
brt::Bool = false,
strict::Bool = false
) -> InverseVolatilityKeywords correspond to the struct's fields.
Examples
julia> InverseVolatility()
InverseVolatility
pe ┼ EmpiricalPrior
│ ce ┼ PortfolioOptimisersCovariance
│ │ ce ┼ Covariance
│ │ │ me ┼ SimpleExpectedReturns
│ │ │ │ w ┴ nothing
│ │ │ ce ┼ GeneralCovariance
│ │ │ │ ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)
│ │ │ │ w ┴ nothing
│ │ │ alg ┴ Full()
│ │ mp ┼ DenoiseDetoneAlgMatrixProcessing
│ │ │ pdm ┼ Posdef
│ │ │ │ alg ┼ UnionAll: NearestCorrelationMatrix.Newton
│ │ │ │ kwargs ┴ @NamedTuple{}: NamedTuple()
│ │ │ dn ┼ nothing
│ │ │ dt ┼ nothing
│ │ │ alg ┼ nothing
│ │ │ order ┴ DenoiseDetoneAlg()
│ me ┼ SimpleExpectedReturns
│ │ w ┴ nothing
│ horizon ┴ nothing
wb ┼ WeightBounds
│ lb ┼ Float64: 0.0
│ ub ┴ Float64: 1.0
sets ┼ nothing
wf ┼ IterativeWeightFinaliser
│ iter ┴ Int64: 100
fb ┼ nothing
sq ┼ Bool: false
brt ┼ Bool: false
strict ┴ Bool: falseRelated
sourcePortfolioOptimisers.EqualWeighted Type
struct EqualWeighted{__T_wb, __T_sets, __T_wf, __T_fb, __T_strict} <: NaiveOptimisationEstimatorEqual-weighted portfolio optimiser.
EqualWeighted allocates equal weight to all
Fields
wb: Weight bounds estimator or bounds.sets: Asset sets (required whenwbis aWeightBoundsEstimator).wf: Weight finaliser for enforcing bounds.fb: Fallback optimiser.strict: Iftrue, strictly enforces weight bounds.
Constructors
EqualWeighted(;
wb::Option{<:WbE_Wb} = WeightBounds(),
sets::Option{<:AssetSets} = nothing,
wf::WeightFinaliser = IterativeWeightFinaliser(),
fb::Option{<:OptE_Opt} = nothing,
strict::Bool = false
) -> EqualWeightedKeywords correspond to the struct's fields.
Examples
julia> EqualWeighted()
EqualWeighted
wb ┼ WeightBounds
│ lb ┼ Float64: 0.0
│ ub ┴ Float64: 1.0
sets ┼ nothing
wf ┼ IterativeWeightFinaliser
│ iter ┴ Int64: 100
fb ┼ nothing
strict ┴ Bool: falseRelated
sourcePortfolioOptimisers.RandomWeighted Type
struct RandomWeighted{__T_alpha, __T_rng, __T_seed, __T_wb, __T_sets, __T_wf, __T_fb, __T_strict} <: NaiveOptimisationEstimatorRandom-weighted portfolio optimiser.
RandomWeighted draws portfolio weights at random from a Dirichlet distribution with concentration parameter alpha. This can be used for simulation, benchmarking, or stress-testing.
Mathematical Definition
where
Fields
alpha: Dirichlet concentration parameter (scalar or vector, all positive).rng: Random number generator.seed: Optional seed for the RNG.wb: Weight bounds estimator or bounds.sets: Asset sets.wf: Weight finaliser for enforcing bounds.fb: Fallback optimiser.strict: Iftrue, strictly enforces weight bounds.
Constructors
RandomWeighted(;
alpha::Num_VecNum = 1,
rng::Random.AbstractRNG = Random.default_rng(),
seed::Option{<:Integer} = nothing,
wb::Option{<:WbE_Wb} = nothing,
sets::Option{<:AssetSets} = nothing,
wf::WeightFinaliser = IterativeWeightFinaliser(),
fb::Option{<:OptE_Opt} = nothing,
strict::Bool = false
) -> RandomWeightedKeywords correspond to the struct's fields.
Validation
- If
alphais provided: all elements positive and finite.
Examples
julia> RandomWeighted()
RandomWeighted
alpha ┼ Int64: 1
rng ┼ Random.TaskLocalRNG: Random.TaskLocalRNG()
seed ┼ nothing
wb ┼ nothing
sets ┼ nothing
wf ┼ IterativeWeightFinaliser
│ iter ┴ Int64: 100
fb ┼ nothing
strict ┴ Bool: falseRelated
sourcePortfolioOptimisers.optimise Function
optimise(iv::InverseVolatility{<:Any, <:Any, <:Any, <:Any, Nothing},
rd::ReturnsResult = ReturnsResult(); dims::Int = 1, kwargs...) -> NaiveOptimisationResultArguments
iv: The inverse volatility optimiser to use.rd: The returns result to use. Ifisa(iv.pe, AbstractPriorResult),rdis not necessary.dims: The dimension along which observations advance in time.kwargs: Additional keyword arguments passed to the optimisation function.
PortfolioOptimisers.optimise Method
optimise(ew::EqualWeighted{<:Any, <:Any, <:Any, Nothing},
rd::ReturnsResult; dims::Int = 1, kwargs...) -> NaiveOptimisationResultArguments
ew: The equal-weighted optimiser to use.rd: The returns result to use. Used to know how many assets there are.dims: The dimension along which observations advance in time.kwargs: Additional keyword arguments passed to the optimisation function.
PortfolioOptimisers.optimise Method
optimise(rw::RandomWeighted{<:Any, <:Any, <:Any, <:Any, <:Any, <:Any, Nothing},
rd::ReturnsResult; dims::Int = 1, kwargs...) -> NaiveOptimisationResultArguments
rw: The random-weighted optimiser to use.rd: The returns result to use. Used to know how many assets there are.dims: The dimension along which observations advance in time.kwargs: Additional keyword arguments passed to the optimisation function.