Programme Allocation Set
ProgrammeAllocationSet is a set of allowed weights that holds a ConstraintBlock, the block of a JuMPOptimiser. So it takes every constraint and every objective penalty that a JuMPOptimiser takes, with the same keywords. A projection onto it is an optimisation, so it needs a solver. The set resolves the constraints that name assets once per fold, and rebuilds the constraints that read returns at every update. This page also has the two barrier geometries of the first-order rule, TsallisProjection and LogBarrierProjection. Their projection onto a BoundedAllocationSet is a root search on one scalar.
PortfolioOptimisers.ProgrammeAllocationSet — Type
struct ProgrammeAllocationSet{__T_pe, __T_slv, __T_cbe, __T_r, __T_ret, __T_sc, __T_so} <: AbstractProgrammeAllocationSetConstrains an online allocation with every constraint kind of a JuMP optimiser, and projects onto the set with a solver.
The set holds its constraint kinds and its direct objective penalties in a ConstraintBlock, the block that JuMPOptimiser holds, in its field cbe. Each slot of the block is a keyword and a property of the set, so set.wb reads set.cbe.wb. The risk ceilings r and the return floor ret are fields of the set, and not slots of the block. A projection onto the set is a programme, so slv has no default. The budget is one, and the set owns it, so the set has no budget field. Cash is an asset whose price relative is one, and the rule allocates it as any other asset.
The projection is a bare JuMP model with the variables and rows of the Weight Finaliser, which are w, k = 1, Σw = 1, the constraint scale and the objective scale. set_allocation_set_constraints! adds the constraint kinds through the builders of the optimiser, in the order that assemble_jump_model! runs them. set_projection_objective! sets the objective, the divergence of the rule's Projection Geometry plus the set's penalties.
The block resolves in the two stages of a JuMP head. Once per fold, resolve_allocation_set runs stage 1, resolve_constraint_block_names, and resolves wb when it reads no rows: the slots that hold a name over sets and whose value follows a view at the Investable Mask. These are wb, lt, st, sgcarde, smtx, sgmtx, slt, sst, sglt, sgst and tn. At every step, resolve_allocation_set_step runs stage 2, resolve_constraint_block, on the set viewed at the mask of the step and on the prior result of pe fitted on the head's rows. It gives the ResolvedConstraintBlock of the set, which the builders read. Stage 2 resolves these kinds:
wb, when it reads the returns (bounds_read_rows), as aScoreWeightBoundsdoes. Each step scores the assets on the head's rows at the Investable Mask of the step, as the batch fit of a JuMP head on those rows does, so the bound reads no row after the step. The bounds rows, the floor of a barrier geometry and the result thatoptimisereturns for the head all read this bound of the step.lcseandgcarde, the linear rows. A linear constraint does not follow a view at the mask, so they resolve after it, over thesetsthat carry the Non-Investable Axis. An exposure row inlcsetakes its loadings by the precedence offactor_space_regression: the result that itsFactorSpacestates, else the loadingsrrof the set's prior, else a fit of the regression of the space on the head's rows.cte, the centrality rows, andple, the integer and semidefinite phylogeny kinds.A Calibration Rule in
l2c,lpc,linfc,l1,l2,lporlinf, against the prior and the solverslv.
The settings sbgt, gbgt, xbgt, card, scard, ss, ccnt and cobj need no resolution. Each kind goes to the builder that JuMPOptimiser gives it to. The fields of the set read the prior and the rows of its block Result at every step:
r, the risk ceilings. Each measure goes through its own JuMP builder, with the set as theRiskConstraintOwnerandsettings.ubas the ceiling.factoryfirst materialises the measure against the prior, so a moment that the measure carries is the moment its row uses. AVarianceorStandardDeviationthat holds its matrix reads no rows and no prior. It goes through the same builder with no prior, so the source of the matrix does not change the formulation (set_allocation_risk_ceiling!).ret, a floor on the prior's expected return of the allocation.
The tracking errors tr also read the prior and the rows of the block Result.
At every step factory replaces the reference of a turnover ceiling, and of a WeightsTracking, with the Price-Adjusted Allocation of the step. That is the book the fund trades from. A fixed object keeps the caller's reference.
Each reader of the set states its own source. The set holds no source. It gives the head's rows to its prior pe, to each graph slot in cte and ple, and to the regression of each exposure slot in lcse. Each one reads the rows as its own x_src states, as the same slot of a JuMPOptimiser does. When pe states x_src = ExcessSource(), the prior fits the rows on X - B, which benchmark_relative_returns gives. A Variance ceiling then becomes a ceiling on the tracking variance against the benchmark B that the rows carry. The head's rows keep the raw returns and the benchmark, so each reader reads its own source, whatever the source of the head's step is.
The readers of the set join the group of the head, see group_frames. A DataBenchmarkTracking in tr or r refuses a pe that states ExcessSource(), because it would subtract the benchmark twice. A reader of the Excess Frame refuses rows with no benchmark.
A set that reads the rows, for which rows_needed returns nothing, fits its prior once over the whole prefix at every step, and then solves its programme. A caller who wants a window states it on pe. A covariance of one observation does not exist. So while the head holds fewer than two rows, the set fits no prior, and the step is a Held Step with its reason recorded (allocation_set_ready). A caller who wants a covariance ceiling from the first row gives r its matrix. A MIP projection is not unique. So the identity between the Causal Pass and the Recursion Result is a property of the code path, the same solves in the same order on the same rows, and it holds exactly only with a deterministic solver.
The set has no field for a budget, fees, the return term as an objective, the scalariser or the execution settings of the optimiser, and no slot of its block holds a TimeDependent schedule. At construction assert_risk_ceiling refuses a frontier or a per-asset ub on a measure, because a ceiling is one number. The set does not read the rke or the scale of a measure. The ceiling is a constraint, and the objective is the divergence plus the penalties. The Euclidean, Gram and diagonal geometries admit a negative lower bound. The entropic, Tsallis and log-barrier geometries refuse it, at the head's construction when the bound is a value (assert_geometry_admits_set) and at the projection when an estimator resolves it. The wealth factor of a leveraged allocation can reach zero on an extreme day. At that point the log wealth and the next gradient are undefined, and the set does not guard against it.
Mathematical definition
\[\begin{align} \mathcal{W} &= \left\{ \boldsymbol{w} \in \mathbb{R}^N : \boldsymbol{1}^\intercal \boldsymbol{w} = 1,\; \boldsymbol{w} \in \mathcal{C}_k \text{ for every kind } k \text{ of the set} \right\}\,, \\ \boldsymbol{w}^{+} &= \underset{\boldsymbol{w} \in \mathcal{W}}{\arg\min} \; D_\Psi(\boldsymbol{w}, \boldsymbol{q}) + \pi(\boldsymbol{w})\,. \end{align}\]
Where:
- $\mathcal{W}$: Allocation Set.
- $\boldsymbol{w}$: Portfolio weights vector $N \times 1$.
- $N$: Number of assets.
- $\mathcal{C}_k$: Feasible set of the constraint kind $k$, which the builder of
JuMPOptimiserfor that kind writes. A risk ceiling, a tracking error, a centrality row, a phylogeny kind, an exposure row and a return floor take $\mathcal{C}_k$ from the prior of the step, and a turnover ceiling takes it from the Price-Adjusted Allocation. - $\boldsymbol{w}^{+}$: Projected allocation, the answer of the projection onto the Allocation Set.
- $D_\Psi$: Bregman divergence of $\Psi$.
- $\Psi$: Potential of the Projection Geometry.
- $\boldsymbol{q}$: Raw step, the vector the rule's unconstrained step gives before the projection onto the Allocation Set.
- $\pi$: Objective Penalty of the set, zero when the set has no penalty.
set_projection_objective! states the divergence of each geometry.
Fields
pe: The prior estimator that the set fits on the head's rows at every step. The risk ceilings, the tracking errors, the centrality and phylogeny rows, an exposure row and the return floor use its result. The set does not read it when no slot reads the rows.
slv: Solver or vector of solvers.
cbe: Constraint Block that holds the feasible set of the weights and the terms of the Objective Penalty, seeConstraintBlock. Its slots are flat keywords and properties of the owner. In a programme set, the turnover ceilingstnand aWeightsTrackingintrthat is notfixedtake the Price-Adjusted Allocation of the step as their reference. AReturnsTrackingseries intrthat is stated over the fold is cut to the prefix that the head has folded, and the centrality rowscteare resolved on the head's rows at every step.
r: The risk ceilings, aRiskMeasureor a vector of them, each withsettings.ubthe ceiling, ornothing.
ret: The return floor: a return term, or a vector of them, whosesettings.lbbounds the prior's expected return of the projected allocation from below; the term's objective role is not read.
sc: Constraint scale factor.
so: Objective scale factor.
Constructors
ProgrammeAllocationSet(; slv::Slv_VecSlv, pe::AbstractPriorEstimator = EmpiricalPrior(), cbe::Option{<:ConstraintBlock} = nothing, r::Option{<:RM_VecRM} = nothing, ret::Option{<:JRE_VecJRE} = nothing, sc::Number = 1, so::Number = 1, slots...,) -> ProgrammeAllocationSetKeywords correspond to the struct's fields and to the slots of ConstraintBlock. slv has no default, because every projection onto the set is a programme. slots... takes each keyword of the block with its type and its default: wb, sbgt, gbgt, lt, st, lcse, cte, gcarde, sgcarde, smtx, sgmtx, slt, sst, sglt, sgst, tn, sets, tr, ple, ccnt, cobj, ss, card, scard, l2c, lpc, linfc, l1, l2, lp, linf and xbgt. The constructor builds the block in cbe from these flat keywords, as the keyword constructor of JuMPOptimiser does. When the caller gives cbe, a flat keyword replaces that slot of the given block, and a slot that the caller does not name keeps its value, see constraint_block. A name that is neither a field nor a slot raises a MethodError.
lcse, sgcarde, smtx, sgmtx, slt, sst, sglt, sgst, tn and ple take a vector that mixes the members of their element type. The keyword constructor of the block narrows it through narrow_mixed_vector.
The positional constructor takes the fields in the order of the struct: pe, slv, cbe, r, ret, sc and so. Before the block, it took one argument for each slot.
Validation
The constructor of ConstraintBlock checks each slot on its own: the values of sbgt, gbgt, card, l2c, linfc, l1 and linf, an empty vector in a slot, the roles of lp and lpc, the shapes of the sub-group MIP slots, and sets beside a slot keyed by name (name_keyed). This constructor checks the fields of the set, and the rules that read the set and its block together.
- If
slvis a vector:!isempty(slv). AnIsEmptyErroris thrown otherwise. - No slot of
cbeholds aTimeDependent. No fold loop resolves a schedule inside an Allocation Set, so the constructor refuses it with anArgumentError. Schedule the whole set instead,OnlinePortfolioSelection(; set = TimeDependent([…])). - If
gbgtis given:sbgtis not a number, because the budget of one and a number insbgtalready fix the gross exposure. Ifwbis aWeightBounds, one of its bounds admits a short weight. Ifgbgthas an upper end, it is at least one, because the gross exposure is at least the budget of one (assert_gross_budget_admissible). AnArgumentErroris thrown otherwise. - If
ris given: thesettings.ubof every measure is a finite non-negative number, the ceiling, and no measure holds aReturnsTracking, because the ceiling reads rows that change at every step (assert_risk_ceiling). AnArgumentErroris thrown otherwise, and anIsEmptyErrorfor an empty vector. - If
retis given: thesettings.lbof every return term isnothingor a number, the floor, because the projection solves once and returns one allocation (assert_return_floor). AnArgumentErroris thrown for aFrontieror a vector. An empty vector raises anIsEmptyError. - If
trorrholds aDataBenchmarkTracking:pemust not statex_src = ExcessSource(), seeassert_data_benchmark_prior.
View parameters
ProgrammeAllocationSet defines its own port_opt_view method rather than deriving one from field tags.
- The method views the block through
port_opt_view(cbe::ConstraintBlock, i, args...), which passes the arguments afterito the tracking errorstralone. It views the risk ceilingsrwithnothingin place of those arguments. - The prior estimator
pe, the return floorretand the risk ceilings recurse throughport_opt_view. The block views its per-asset slots, and keepscte,gcarde,sgcardeandple, as it does inJuMPOptimiser. A precomputedLinearConstraintis the identity under a view. - When a sub-group slot and its sub-grouped slot hold one object, such as
smtxandsgmtx, the block views it once, and the two slots stay one object.
Examples
julia> ProgrammeAllocationSet(; slv = Solver(; solver = nothing), tn = Turnover(; w = fill(0.25, 4), val = 0.1))ProgrammeAllocationSet pe ┼ EmpiricalPrior │ ce ┼ PortfolioOptimisersCovariance │ │ ce ┼ Covariance │ │ │ me ┼ SimpleExpectedReturns │ │ │ │ w ┴ nothing │ │ │ ce ┼ GeneralCovariance │ │ │ │ ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true) │ │ │ │ w ┴ nothing │ │ │ alg ┼ FullMoment() │ │ │ w ┴ nothing │ │ mp ┼ MatrixProcessing │ │ │ pdm ┼ Posdef │ │ │ │ alg ┼ UnionAll: NearestCorrelationMatrix.Newton │ │ │ │ kwargs ┴ @NamedTuple{}: NamedTuple() │ │ │ dn ┼ nothing │ │ │ dt ┼ nothing │ │ │ alg ┼ nothing │ │ │ order ┴ NTuple{4, Symbol}: (:pdm, :dn, :dt, :alg) │ me ┼ SimpleExpectedReturns │ │ w ┴ nothing │ horizon ┼ nothing │ fill_limit ┼ nothing │ x_src ┴ nothing slv ┼ Solver │ name ┼ String: "" │ solver ┼ nothing │ settings ┼ nothing │ check_sol ┼ @NamedTuple{}: NamedTuple() │ add_bridges ┴ Bool: true cbe ┼ ConstraintBlock │ wb ┼ WeightBounds │ │ lb ┼ Float64: 0.0 │ │ ub ┴ Float64: 1.0 │ sbgt ┼ nothing │ gbgt ┼ nothing │ lt ┼ nothing │ st ┼ nothing │ lcse ┼ nothing │ cte ┼ nothing │ gcarde ┼ nothing │ sgcarde ┼ nothing │ smtx ┼ nothing │ sgmtx ┼ nothing │ slt ┼ nothing │ sst ┼ nothing │ sglt ┼ nothing │ sgst ┼ nothing │ tn ┼ Turnover │ │ w ┼ Vector{Float64}: [0.25, 0.25, 0.25, 0.25] │ │ val ┼ Float64: 0.1 │ │ fixed ┴ Bool: false │ sets ┼ nothing │ tr ┼ nothing │ ple ┼ nothing │ ccnt ┼ nothing │ cobj ┼ nothing │ ss ┼ nothing │ card ┼ nothing │ scard ┼ nothing │ l2c ┼ nothing │ lpc ┼ nothing │ linfc ┼ nothing │ l1 ┼ nothing │ l2 ┼ nothing │ lp ┼ nothing │ linf ┼ nothing │ xbgt ┴ Bool: false r ┼ nothing ret ┼ nothing sc ┼ Int64: 1 so ┴ Int64: 1Related
AbstractAllocationSetBoundedAllocationSet: the set of weight bounds alone, with a scalar root for every geometry but the Gram one.JuMPOptimiserprojectset_allocation_set_constraints!set_projection_objective!resolve_allocation_setresolve_constraint_blockHeldStepOnlinePortfolioSelectionport_opt_view
PortfolioOptimisers.TsallisProjection — Type
struct TsallisProjection{__T_alpha} <: AbstractProjectionGeometryProjects the raw step onto the Allocation Set in the Bregman divergence of the Tsallis potential of power alpha.
This is the geometry of the Tsallis-entropy steps of Section 3 of [255] and of the Tsallis-INF algorithm of Section 3.2 of [256]. The potential of Abernethy et al. [255] is $\alpha \Psi_\alpha$ plus a constant, and the potential of Zimmert and Seldin [256] is $\Psi_\alpha$ plus an affine term, which is constant on the simplex. So each divergence is $D_{\Psi_\alpha}$ times a constant factor, which a learning rate absorbs. Abernethy et al. [255] and Zimmert and Seldin [256] both bound the regret of the multi-armed bandit with bounded losses. At the tuned rate, Corollary 3.2 of [255] bounds the expected regret by $\sqrt{2 T N / (\alpha (1 - \alpha))}$. The log-wealth loss of a portfolio has no bounded gradient, so that bound does not apply to it as it stands. The geometry cannot set a positive entry to zero, and a zero entry stays zero. The geometry refuses a negative lower bound, because the potential is undefined below zero.
Mathematical definition
\[\begin{align} \Psi_\alpha(\boldsymbol{w}) &= \frac{1}{\alpha (\alpha - 1)} \sum_i w_i^{\alpha}\,, \\ \mathrm{Proj}^{\alpha}_{\mathcal{W}}(\boldsymbol{q}) &= \underset{\boldsymbol{w} \in \mathcal{W}}{\arg\min} \; D_{\Psi_\alpha}(\boldsymbol{w}, \boldsymbol{q})\,, \\ w_i(\theta) &= \min\left(\max\left(\left(q_i^{\alpha - 1} + \theta\right)^{1 / (\alpha - 1)},\, l_i\right),\, u_i\right)\,, \\ w_{t+1, i} &= \left( w_{t, i}^{\alpha - 1} + (1 - \alpha) \eta_t g_{t, i} + \theta \right)^{1 / (\alpha - 1)}\,. \end{align}\]
Where:
- $\Psi_\alpha$: Tsallis potential, the potential of this geometry.
- $\alpha$: Power of the potential, in $(0, 1)$.
- $D_\Psi$: Bregman divergence of $\Psi$.
- $\boldsymbol{q}$: Raw step, the vector the rule's unconstrained step gives before the projection onto the Allocation Set.
- $\mathcal{W}$: Allocation Set.
- $l_i$, $u_i$: Lower and upper bounds of asset $i$ on a
BoundedAllocationSet. - $\theta$: Budget multiplier, the root of $\sum_i w_i(\theta) = 1$.
- $\boldsymbol{w}_t$: Iterate of the rule at period $t$, the allocation its update reads.
- $\eta_t$: Learning rate of the update at period $t$.
- $\boldsymbol{g}_t$: Gradient of the loss of period $t$, taken at the iterate.
The mirror image is $\nabla \Psi_\alpha(\boldsymbol{w})_i = w_i^{\alpha - 1} / (\alpha - 1)$, so the projection sets $\nabla \Psi_\alpha(\boldsymbol{w}) - \nabla \Psi_\alpha(\boldsymbol{q})$ to one constant over the free entries. On a BoundedAllocationSet the projection is $\boldsymbol{w}(\theta)$ at the root. A base $q_i^{\alpha - 1} + \theta$ at or below zero puts its asset at $u_i$. The budget $\sum_i w_i(\theta)$ does not increase in $\theta$. The last line is a first-order step from $\boldsymbol{w}_t$ and its projection onto the simplex together, one scalar root. As $\alpha \to 1$, $D_{\Psi_\alpha}$ tends to the relative entropy of EntropicProjection. As $\alpha \to 0$, it tends to the Itakura–Saito divergence of LogBarrierProjection, as Section 3.2 of [256] shows for the potentials. On a ProgrammeAllocationSet a weight that the set forces to zero stays zero, as under EntropicProjection.
Fields
alpha: The power of the potential, in(0, 1).
Constructors
TsallisProjection(; alpha::Real = 0.5) -> TsallisProjectionKeywords correspond to the struct's fields. The default is the $\alpha = 1/2$ of Section 4.1 of [256].
Validation
0 < alpha < 1. ADomainErroris thrown otherwise.
Examples
julia> TsallisProjection()TsallisProjection alpha ┴ Float64: 0.5Related
References
- [255] J. D. Abernethy, C. Lee and A. Tewari. Fighting bandits with a new kind of smoothness. In: Advances in Neural Information Processing Systems 28 (2015). Section 3, Theorem 3.1, Corollary 3.2.
- [256] J. Zimmert and Y. Seldin. Tsallis-INF: An optimal algorithm for stochastic and adversarial bandits. Journal of Machine Learning Research 22(28), 1–49 (2021). Section 3.2. Section 4.1, Theorem 1.
PortfolioOptimisers.LogBarrierProjection — Type
struct LogBarrierProjection <: AbstractProjectionGeometryProjects the raw step onto the Allocation Set in the Itakura–Saito divergence, the Bregman divergence of the Burg entropy.
In Section 7 of [257], the Burg entropy is the natural regulariser of mirror descent on the log loss, the alternative to the Soft-Bayes step of [257]. Orseau et al. [257] state without a proof that its regret is $O(\sqrt{N T \log (T / N)})$ and does not depend on the largest gradient. For a portfolio, this means that the bound needs no lower bound on the price relatives. The geometry cannot set a positive entry to zero, and a zero entry stays zero. The geometry refuses a negative lower bound, because the logarithm is undefined below zero.
Mathematical definition
\[\begin{align} \Psi(\boldsymbol{w}) &= -\sum_i \log w_i\,, \\ D_\Psi(\boldsymbol{w}, \boldsymbol{q}) &= \sum_i \left( \frac{w_i}{q_i} - 1 - \log \frac{w_i}{q_i} \right)\,, \\ \mathrm{Proj}^{\mathrm{IS}}_{\mathcal{W}}(\boldsymbol{q}) &= \underset{\boldsymbol{w} \in \mathcal{W}}{\arg\min} \; D_\Psi(\boldsymbol{w}, \boldsymbol{q})\,, \\ w_i(\theta) &= \min\left(\max\left(\frac{1}{1 / q_i + \theta},\, l_i\right),\, u_i\right)\,, \\ w_{t+1, i} &= \frac{1}{1 / w_{t, i} + \eta_t g_{t, i} + \theta}\,. \end{align}\]
Where:
- $\Psi$: Burg entropy, the potential of this geometry.
- $D_\Psi$: Bregman divergence of $\Psi$.
- $\boldsymbol{q}$: Raw step, the vector the rule's unconstrained step gives before the projection onto the Allocation Set.
- $\mathcal{W}$: Allocation Set.
- $l_i$, $u_i$: Lower and upper bounds of asset $i$ on a
BoundedAllocationSet. - $\theta$: Budget multiplier, the root of $\sum_i w_i(\theta) = 1$.
- $\boldsymbol{w}_t$: Iterate of the rule at period $t$, the allocation its update reads.
- $\eta_t$: Learning rate of the update at period $t$.
- $\boldsymbol{g}_t$: Gradient of the loss of period $t$, taken at the iterate.
The mirror image is $\nabla \Psi(\boldsymbol{w})_i = -1 / w_i$, so the projection sets $\nabla \Psi(\boldsymbol{w}) - \nabla \Psi(\boldsymbol{q})$ to one constant over the free entries. On a BoundedAllocationSet the projection is $\boldsymbol{w}(\theta)$ at the root. A base $1 / q_i + \theta$ at or below zero puts its asset at $u_i$. The budget $\sum_i w_i(\theta)$ does not increase in $\theta$. The last line is a first-order step from $\boldsymbol{w}_t$ and its projection onto the simplex together, one scalar root. The Hessian of $\Psi$ is $\mathrm{diag}(1 / w_i^2)$, so the step moves a small weight in proportion to its square. On a ProgrammeAllocationSet a weight that the set forces to zero stays zero, as under EntropicProjection.
Examples
julia> LogBarrierProjection()LogBarrierProjection()Related
References
- [257] L. Orseau, T. Lattimore and S. Legg. Soft-Bayes: Prod for mixtures of experts with log-loss. In: Proceedings of the 28th International Conference on Algorithmic Learning Theory, PMLR 76, 372–399 (2017). Section 7, Alternative approaches.
PortfolioOptimisers.mirror_step — Function
mirror_step(proj::EuclideanProjection, u::AbstractVector, s::AbstractVector)
mirror_step(proj::EntropicProjection, u::AbstractVector, s::AbstractVector)
mirror_step(proj::TsallisProjection, u::AbstractVector, s::AbstractVector)
mirror_step(proj::LogBarrierProjection, u::AbstractVector, s::AbstractVector)Takes the unconstrained mirror step from the iterate u along the scaled gradient s, in the potential of the geometry.
The answer is the raw step that project then puts onto the Allocation Set. A barrier geometry has a step only while every base is positive. A base at or below zero is a step to an unbounded allocation, and the function refuses it and does not clip it. Under the plain log-wealth gradient every rate below one has a step. A transformed gradient changes that condition. The first step of AdaptiveMomentGradient with gamma1 = 0.9 and gamma2 = 0.999 scales every entry of the gradient to about -3.16, so at the rate 0.9 the log-barrier step fails when one asset holds more than 0.352 of the iterate.
Mathematical definition
\[\begin{align} \boldsymbol{q} &= \nabla \Psi^{*}\left(\nabla \Psi(\boldsymbol{u}) - \boldsymbol{s}\right)\,, \\ q^{\mathrm{E}}_i &= u_i - s_i\,, \\ q^{\mathrm{KL}}_i &= u_i \exp(-s_i)\,, \\ q^{\alpha}_i &= \left( u_i^{\alpha - 1} + (1 - \alpha) s_i \right)^{1 / (\alpha - 1)}\,, \\ q^{\mathrm{IS}}_i &= \frac{1}{1 / u_i + s_i}\,. \end{align}\]
Where:
- $\boldsymbol{q}$: Raw step, the vector the rule's unconstrained step gives before the projection onto the Allocation Set.
- $\Psi$: Potential of the Projection Geometry.
- $\nabla \Psi^{*}$: Inverse of the mirror map $\nabla \Psi$.
- $\boldsymbol{u}$: The iterate the step starts from.
- $\boldsymbol{s}$: The scaled gradient, $\eta_t \boldsymbol{g}_t$ for a plain gradient.
- $q^{\mathrm{E}}$, $q^{\mathrm{KL}}$, $q^{\alpha}$, $q^{\mathrm{IS}}$: The raw step under
EuclideanProjection,EntropicProjection,TsallisProjectionandLogBarrierProjection. - $\alpha$: Power of the Tsallis potential, in $(0, 1)$.
- $\eta_t$: Learning rate of the update at period $t$.
- $\boldsymbol{g}_t$: Gradient of the loss of period $t$, taken at the iterate.
- $\boldsymbol{x}_t$: Price relative vector of period $t$, each asset's price over its price one period earlier.
Under the log-wealth loss with a plain gradient, $\boldsymbol{s} = -\eta_t \boldsymbol{x}_t / \langle \boldsymbol{u}, \boldsymbol{x}_t \rangle$. The log-barrier base $1 / u_i + s_i$ is then positive exactly while $\eta_t \hat{u}_i < 1$ for every asset, with $\hat{\boldsymbol{u}} = \boldsymbol{u} \odot \boldsymbol{x}_t / \langle \boldsymbol{u}, \boldsymbol{x}_t \rangle$ the Price-Adjusted Allocation of the iterate. Each $\hat{u}_i$ is at most one, so a rate below one always has a step. The Tsallis base is positive exactly while $(1 - \alpha) \eta_t \hat{u}_i u_i^{-\alpha} < 1$ for every asset.
Arguments
proj: The Projection Geometry.u: The iterate the step starts from.s: The scaled gradient.
Validation
- Under
TsallisProjectionandLogBarrierProjection: every base is positive. ADomainErroris thrown otherwise (assert_mirror_base).
Returns
q::AbstractVector: The raw step.
Related
PortfolioOptimisers.rows_needed — Method
rows_needed(set::ProgrammeAllocationSet)Returns the number of rows that a programme set reads at a step.
The set reads every row that the head has folded when one of its slots reads the rows. These slots are weight bounds that read them (bounds_read_rows), a risk ceiling that reads them (risk_reads_rows), a tracking error, a centrality or phylogeny estimator (fitted_on_rows), an exposure row (exposure_keyed), a return floor, and a Calibration Rule in a norm ceiling or in a penalty (calibrated).
Returns
::Union{Nothing, Int}:nothing, every row folded, when a slot reads the rows, and0otherwise.
Related
PortfolioOptimisers.factory — Method
factory(
set::ProgrammeAllocationSet,
w::AbstractVector
) -> ProgrammeAllocationSet
Returns a copy of set whose parts that read the previous weights hold the Price-Adjusted Allocation w of a step.
The block takes w through factory(cbe::ConstraintBlock, w): its turnover ceilings, its tracking errors, its custom constraints and its custom objective terms. The risk ceilings r take it through factory(r, w), so a WeightsTracking benchmark or a TurnoverRiskMeasure reference that is not fixed reads the book of the step. A fixed object keeps the caller's reference. The return floor reads no weights. resolve_allocation_set_step calls it at each step, before stage 2 of the block.
Arguments
set: The programme set.w: The Price-Adjusted Allocation of the step.
Returns
set'::ProgrammeAllocationSet: The set with the parts rebuilt forw.
Related
References
- [255]
- J. D. Abernethy, C. Lee and A. Tewari. Fighting bandits with a new kind of smoothness. In: Advances in Neural Information Processing Systems, Vol. 28 (2015).
- [256]
- J. Zimmert and Y. Seldin. Tsallis-INF: An optimal algorithm for stochastic and adversarial bandits. Journal of Machine Learning Research 22, 1–49 (2021).
- [257]
- L. Orseau, T. Lattimore and S. Legg. Soft-Bayes: Prod for mixtures of experts with log-loss. In: Proceedings of the 28th International Conference on Algorithmic Learning Theory, Vol. 76 of Proceedings of Machine Learning Research (2017); pp. 372–399.