Online selection rules: the adaptive subgradient and the optimistic step
This page has two first-order rules that adapt their steps. AdaptiveSubgradient is the diagonal adaptive subgradient method. The step size of each asset follows the gradients that asset has had so far, and the projection uses a norm weighted by those gradients. OptimisticStep is optimistic mirror descent. It wraps a MirrorDescent rule and takes two half-steps each period, the second along a guess of the next gradient. A gradient predictor makes the guess: LastGradient, MeanGradient or ForecastGradient. HintResidualRate is the adaptive step size that reads how far the guesses were from the real gradients.
PortfolioOptimisers.AdaptiveSubgradient — Type
struct AdaptiveSubgradient{T1<:Real, T2<:Real, T3<:AbstractOnlineObjective} <: AbstractOnlinePortfolioSelectionAlgorithmSteps each asset at its own rate, set by the gradient mass that the asset has accrued (AdaGrad).
This is the diagonal adaptive subgradient method of Duchi, Hazan and Singer (2011, Algorithm 1) with its composite mirror descent update. The rule projects in the norm of its gradient mass, through a DiagonalProjection that it builds at every step, so it holds no proj slot.
At delta = 0 an asset whose every price relative so far is zero has no gradient mass. The diagonal of the norm then has a zero entry, and DiagonalProjection refuses it with a DomainError. The paper takes a pseudo-inverse there, but the projection in a seminorm has no unique answer, so the rule refuses instead.
Mathematical definition
\[\begin{align} s_{t, i} &= \sqrt{\textstyle\sum_{s \leq t} g_{s, i}^2}\,, \\ H_t &= \delta I + \mathrm{diag}(\boldsymbol{s}_t)\,, \\ \boldsymbol{w}_{t+1} &= \underset{\boldsymbol{w} \in \mathcal{W}}{\arg\min} \; \eta \langle \boldsymbol{g}_t, \boldsymbol{w} \rangle + \tfrac{1}{2} \lVert \boldsymbol{w} - \boldsymbol{w}_t \rVert^2_{H_t} = \mathrm{Proj}^{H_t}_{\mathcal{W}} \left( \boldsymbol{w}_t - \eta H_t^{-1} \boldsymbol{g}_t \right)\,. \end{align}\]
Where:
- $\boldsymbol{g}_t$: Gradient of the loss of period $t$, taken at the iterate. Under
LogWealthit is $-\boldsymbol{x}_t / \langle \boldsymbol{w}_t, \boldsymbol{x}_t \rangle$. - $\boldsymbol{x}_t$: Price relative vector of period $t$, each asset's price over its price one period earlier.
- $\boldsymbol{w}_t$: Iterate of the rule at period $t$, the allocation its update reads.
- $t$: Period index, counted from one.
- $\boldsymbol{s}_t$: Gradient mass after period $t$, with one entry for each asset.
- $\delta$: Offset that the rule adds to the gradient mass of every asset.
- $H_t$: Diagonal matrix of the norm of the step at period $t$.
- $\eta$: Fixed learning rate of the rule.
- $\mathcal{W}$: Allocation Set.
- $\lVert \boldsymbol{z} \rVert^2_{H} = \boldsymbol{z}^\intercal H \boldsymbol{z}$: Squared norm of a vector $\boldsymbol{z}$ in a positive diagonal matrix $H$.
- $\mathrm{Proj}^{H}_{\mathcal{W}}$: Projection onto $\mathcal{W}$ in the norm of $H$, which is
DiagonalProjectionwith the diagonal of $H$.
Under log wealth the raw step is $\boldsymbol{w}_t + \eta \boldsymbol{x}_t / (\langle \boldsymbol{w}_t, \boldsymbol{x}_t \rangle (\delta + \boldsymbol{s}_t))$, with the division taken asset by asset. At $\delta = 0$ the first raw step is $\boldsymbol{w}_1 + \eta \boldsymbol{1}$, a uniform shift, because $s_{1, i} = \lvert g_{1, i} \rvert$. The projection in the norm of $H_1$ then takes more of the shift back from the assets with the smaller gradient, so the first step moves weight toward the assets that rose the most. It leaves the allocation unchanged only when every price relative is equal.
Let $D_\infty = \sup_{\boldsymbol{w} \in \mathcal{W}} \lVert \boldsymbol{w} - \boldsymbol{w}^* \rVert_\infty$ for a fixed comparator $\boldsymbol{w}^*$. At $\delta = 0$ and $\eta = D_\infty / \sqrt{2}$, Corollary 6 of the paper bounds the regret against $\boldsymbol{w}^*$ by $\sqrt{2} D_\infty \sum_i \lVert \boldsymbol{g}_{1:T, i} \rVert_2$, with $\boldsymbol{g}_{1:T, i}$ the gradients of asset $i$ over $T$ periods. On the simplex $D_\infty \leq 1$, and the default $\eta = 1 / \sqrt{2}$ is that rate. The bound is small when a few assets carry most of the gradient mass. The paper shows that the bound is below the bound of online gradient descent on a box. On the simplex, with dense gradients, it can be larger by a factor of up to $\sqrt{N / 2}$, and log-wealth gradients are dense.
The full-matrix variant of the paper (Algorithm 2) uses $H_t = \delta I + (\sum_{s \leq t} \boldsymbol{g}_s \boldsymbol{g}_s^\intercal)^{1/2}$, the root of the sum that NewtonStep accrues. This rule keeps the diagonal alone, and the diagonal keeps the step at $O(N)$.
Algorithm
The seven-argument online_update! runs these steps at the period's row x. The six-argument form calls it with the book w as the Gradient Point point.
- Take the gradient
gofobjatpoint, fromxand the head'srows, withloss_gradient. - Form the Price-Adjusted Allocation
whof the bookwafter the row. - When every entry of
gis zero, projectwonto the set fromwhin the Euclidean geometry. Count the period, keep the gradient mass, and return that allocation. Stop. - Add
gto the gradient massst.sin place, as the root of the sum of squares of each asset. - Form the diagonal
h = delta .+ st.s. - Form the raw step
q = w .- eta .* g ./ h. - Project
qonto the set fromwhin the geometryDiagonalProjection(h), which gives the new allocation. - Return the state, with the period count raised by one, and the new allocation.
A zero gradient accrues no mass, and the norm of step 7 has no meaning there. So step 3 takes the zero step of every first-order rule. A RiskLoss gives a zero gradient while the head holds fewer than two rows.
Fields
eta: The learning rate of the step. A larger rate reacts faster and is less stable.
delta: The paper's $\delta$, which the rule adds to the gradient mass of every asset.
obj: The objective whose gradient the rule takes, log wealth or a Risk Loss over the head's rows.
Constructors
AdaptiveSubgradient(; eta::Real = 1 / sqrt(2), delta::Real = 0, obj::AbstractOnlineObjective = LogWealth()) -> AdaptiveSubgradientKeywords correspond to the struct's fields. The paper fixes no default. eta = 1 / sqrt(2) is the rate of its Corollary 6 on the simplex, and the paper states that delta = 0 works in practice. obj is the slot of MirrorDescent. It takes log wealth, or a RiskLoss over the head's rows, whose gradient loss_gradient gives at the Gradient Point. The rule needs as many rows as its objective.
Validation
eta > 0,delta >= 0. ADomainErroris thrown otherwise.
Examples
julia> AdaptiveSubgradient()AdaptiveSubgradient eta ┼ Float64: 0.7071067811865475 delta ┼ Int64: 0 obj ┴ LogWealth()Related
AbstractOnlinePortfolioSelectionAlgorithmOnlinePortfolioSelectionAdaptiveSubgradientStateDiagonalProjectionMirrorDescentNewtonStep
References
- [211] J. Duchi, E. Hazan and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research 12, 2121–2159 (2011).
PortfolioOptimisers.AbstractGradientPredictor — Type
abstract type AbstractGradientPredictor <: AbstractAlgorithmAbstract supertype for the Gradient Predictors, which give the hint of an optimistic step for the gradient of the next period.
An OptimisticStep takes its second half-step along the hint $M_{t+1}$.
Interfaces
To implement a new predictor, subtype AbstractGradientPredictor and implement:
predictor_state_seed(pred::AbstractGradientPredictor, w::AbstractVector): Returns the carrier that the predictor keeps on the Rule State before the first row,nothingby default.wis the Start Allocation, whose length and element type the carrier takes.predict_gradient!(pred::AbstractGradientPredictor, ps, obj::AbstractOnlineObjective, g::AbstractVector, v::AbstractVector, x::AbstractVector, xm::AbstractVector, rows, t::Integer) -> Tuple: Returns the carrier after the period and the hint. The arguments are the objectiveobjof the wrapped rule, the gradientgof the period at the played allocation, the secondary iteratevthat the second half-step starts from, the price relativexof the period as traded, the same relativexmafter the uniform mix of the wrapped rule, the rows that the head holds through the period, and the period countt.greadsxm, andxmisxwhere the wrapped rule does not mix. A predictor that reads the relative as a price foldsx. A predictor that evaluates the loss of the wrapped rule again readsxm, so the hint sees the loss thatgsaw.rows_needed(pred::AbstractGradientPredictor): The rows the predictor reads at a step,0by default.
The head's state already slices and copies a carrier that is nothing, a vector or a Partial Fit State. A carrier of another shape needs its own methods of predictor_state_view and copy_predictor_state.
Related
PortfolioOptimisers.LastGradient — Type
struct LastGradient <: AbstractGradientPredictorTakes the last gradient as the hint of the optimistic step.
This is the default predictor of OptimisticStep. Under it the optimistic step is the two-projection algorithm of Chiang, Yang, Lee, Mahdavi, Lu, Jin and Zhu (2012), and the residual sum $\sum_t \lVert \boldsymbol{g}_t - \boldsymbol{g}_{t-1} \rVert_*^2$ is the path length of the gradients.
With at_played = false the predictor reads the loss of the period again at the new secondary iterate, through loss_gradient. This is the online form of the Mirror-Prox method of Nemirovski (2004). Rakhlin and Sridharan [212] recover Mirror Prox from the optimistic step with the hint at the secondary point, for one fixed objective, so the two agree when every period has the same loss. The secondary iterate $\boldsymbol{v}_{t+1}$ is not the played allocation $\boldsymbol{w}_t$, so the two hints of this type differ in general from the first period on.
Mathematical definition
\[\begin{align} M_{t+1} &= \boldsymbol{g}_t\,, \\ M_{t+1}^{\mathrm{MP}} &= -\boldsymbol{x}_t / \langle \boldsymbol{v}_{t+1}, \boldsymbol{x}_t \rangle\,. \end{align}\]
Where:
- $M_t$: Hint of period $t$, the forecast of the gradient $\boldsymbol{g}_t$ that the Gradient Predictor makes one period earlier. $M_{t+1}$ is the hint at
at_played = true. - $M_{t+1}^{\mathrm{MP}}$: Hint at
at_played = falseunderLogWealth. - $\boldsymbol{g}_t$: Gradient of the loss of period $t$, taken at the iterate. The optimistic step takes it at the played allocation $\boldsymbol{w}_t$.
- $\boldsymbol{w}_t$: Iterate of the rule at period $t$, the allocation its update reads.
- $\boldsymbol{x}_t$: Price relative vector of period $t$, each asset's price over its price one period earlier. Where the wrapped rule mixes, it is the mixed price relative that $\boldsymbol{g}_t$ reads.
- $\boldsymbol{v}_t$: Secondary iterate of the optimistic step at period $t$, the allocation that the first half-step of period $t$ starts from.
- $t$: Period index, counted from one.
- $\lVert \cdot \rVert_*$: Dual norm of the norm that the potential of the Projection Geometry is strongly convex against.
Fields
at_played: Whether the hint is the gradient at the played allocation. When it isfalse, the hint is the gradient of the loss of the period at the new secondary iterate.
Constructors
LastGradient(; at_played::Bool = true) -> LastGradientKeywords correspond to the struct's fields.
Examples
julia> LastGradient()LastGradient at_played ┴ Bool: trueRelated
References
- [213] C.-K. Chiang, T. Yang, C.-J. Lee, M. Mahdavi, C.-J. Lu, R. Jin and S. Zhu. Online optimization with gradual variations. In: Proceedings of the 25th Annual Conference on Learning Theory, 6.1–6.20 (2012).
- [212] A. Rakhlin and K. Sridharan. Optimization, learning, and games with predictable sequences. In: Advances in Neural Information Processing Systems 26, 3066–3074 (2013).
- [214] A. Nemirovski. Prox-method with rate of convergence O(1/t) for variational inequalities with Lipschitz continuous monotone operators and smooth convex-concave saddle point problems. SIAM Journal on Optimization 15, 229–251 (2004).
PortfolioOptimisers.MeanGradient — Type
struct MeanGradient <: AbstractGradientPredictorTakes the running mean of the past gradients as the hint of the optimistic step.
Rakhlin and Sridharan [215] call the regret bound under this hint a variance bound. The carrier holds the mean, and the predictor updates it in one pass.
Mathematical definition
\[\begin{align} M_{t+1} &= \frac{1}{t} \sum_{s \leq t} \boldsymbol{g}_s\,. \end{align}\]
Where:
- $M_t$: Hint of period $t$, the forecast of the gradient $\boldsymbol{g}_t$ that the Gradient Predictor makes one period earlier.
- $\boldsymbol{g}_t$: Gradient of the loss of period $t$, taken at the iterate.
- $t$: Period index, counted from one.
With $M_1 = \boldsymbol{0}$, the residual sum is at most the squared first gradient plus twice the spread of the gradients about their mean, $\sum_{t \leq T} \lVert \boldsymbol{g}_t - M_t \rVert_2^2 \leq \lVert \boldsymbol{g}_1 \rVert_2^2 + 2 \sum_{t \leq T} \lVert \boldsymbol{g}_t - \bar{\boldsymbol{g}}_T \rVert_2^2$, with $\bar{\boldsymbol{g}}_T$ the mean of the first $T$ gradients. The maximum norm is at most the Euclidean norm, so the bound holds for the residuals in the maximum norm too.
Examples
julia> MeanGradient()MeanGradient()Related
References
- [215] A. Rakhlin and K. Sridharan. Online learning with predictable sequences. In: Proceedings of the 26th Annual Conference on Learning Theory, 993–1019 (2013).
PortfolioOptimisers.ForecastGradient — Type
struct ForecastGradient{T1<:AbstractExpectedReturnsEstimator} <: AbstractGradientPredictorForms the hint of the optimistic step from a Price Relative Forecast.
The hint is the gradient that the log-wealth loss of the next period would have at the secondary iterate, if the forecast were the outcome. The forecaster is any expected-returns estimator. The carrier folds it where it has an exact fold, and the predictor fits it again from the head's rows otherwise, as the me slot of ForecastReversion does. A flat forecast gives a hint with equal entries, and the projection onto the budget undoes the uniform shift of such a hint.
The optimistic-step papers take their hints from the past gradients, and this hint is not in them. It is the natural hint of the portfolio problem, where every reversion rule and every tracking rule already holds a forecast.
Mathematical definition
\[\begin{align} M_{t+1} &= -\hat{\boldsymbol{x}}_{t+1} / \langle \boldsymbol{v}_{t+1}, \hat{\boldsymbol{x}}_{t+1} \rangle\,. \end{align}\]
Where:
- $M_t$: Hint of period $t$, the forecast of the gradient $\boldsymbol{g}_t$ that the Gradient Predictor makes one period earlier.
- $\hat{\boldsymbol{x}}_{t+1}$: Price Relative Forecast for period $t + 1$, made after the row of period $t$.
- $\boldsymbol{v}_t$: Secondary iterate of the optimistic step at period $t$, the allocation that the first half-step of period $t$ starts from.
- $t$: Period index, counted from one.
Fields
me: The forecaster whose Price Relative Forecast gives the hint.
Constructors
ForecastGradient(; me::AbstractExpectedReturnsEstimator) -> ForecastGradientKeywords correspond to the struct's fields. The predictor needs as many rows as me, and the wrapper needs as many rows as the larger of the predictor and the wrapped rule.
Validation
meis not anOnlinewrapper, and holds none. AnArgumentErroris thrown otherwise.
Examples
julia> ForecastGradient(; me = PriceLevelExpectedReturns(; alg = MovingAverage(; window = 3)))ForecastGradient me ┼ PriceLevelExpectedReturns │ alg ┼ MovingAverage │ │ window ┴ Int64: 3Related
PortfolioOptimisers.predictor_state_seed — Function
predictor_state_seed(pred::AbstractGradientPredictor, w::AbstractVector)
predictor_state_seed(pred::MeanGradient, w::AbstractVector)
predictor_state_seed(pred::ForecastGradient, w::AbstractVector)Returns the carrier that a Gradient Predictor keeps on the Rule State before the first row. It is nothing by default, the zero mean under MeanGradient, and the carrier of the forecaster from forecaster_seed under ForecastGradient.
Related
PortfolioOptimisers.predict_gradient! — Function
predict_gradient!(pred::LastGradient, ps::Nothing, obj::AbstractOnlineObjective, g::AbstractVector, v::AbstractVector, x::AbstractVector, xm::AbstractVector, rows, t::Integer)
predict_gradient!(pred::MeanGradient, m::AbstractVector, obj::AbstractOnlineObjective, g::AbstractVector, v::AbstractVector, x::AbstractVector, xm::AbstractVector, rows, t::Integer)
predict_gradient!(pred::ForecastGradient, ps, obj::AbstractOnlineObjective, g::AbstractVector, v::AbstractVector, x::AbstractVector, xm::AbstractVector, rows, t::Integer)Returns the carrier after the period and the hint of the period, and writes the carrier in place.
- Under
LastGradientthe hint is a copy ofg. Atat_played = falseit is the gradient ofobjat the secondary iteratev, on the mixed relativexmthatgreads. - Under
MeanGradientthe method updates the running meanm, and the hint is a copy of it. - Under
ForecastGradientthe method folds or fits the forecaster on the traded relativexthroughforecast_relative, and the hint is the log-wealth gradient of the forecast atv. It reads no objective, because a forecast is a price relative.
A forecaster folds the path that traded, not the mixed one, so the mix does not pull its statistic toward one. The rule applies no mix to the forecast.
Returns
(ps', M)::Tuple: The carrier after the period, and the hint, a new vector.
Related
PortfolioOptimisers.HintResidualRate — Type
struct HintResidualRate{T1<:Real} <: AbstractLearningRateScheduleSets the learning rate of an optimistic step from the hint residuals that the step has accrued.
This is the adaptive rate of Corollary 2 of [212]. It needs no horizon and no bound on the residual sum ahead of time. The schedule reads the residuals that an OptimisticStep keeps on its carrier, and it refuses the carrier of any other rule by name. hint_residual states the norm of the residuals in each geometry.
Mathematical definition
\[\begin{align} S_t &= \sum_{i \leq t} \lVert \boldsymbol{g}_i - M_i \rVert_*^2\,, \\ \eta_t &= R_{\max} \min \left\lbrace \left( \sqrt{S_{t-1}} + \sqrt{S_{t-2}} \right)^{-1},\, 1 \right\rbrace\,. \end{align}\]
Where:
- $\eta_t$: Learning rate of the update at period $t$.
- $t$: Period index, counted from one.
- $S_t$: Sum of the squared hint residuals through period $t$, zero for $t \leq 0$.
- $\boldsymbol{g}_t$: Gradient of the loss of period $t$, taken at the iterate.
- $M_t$: Hint of period $t$, the forecast of the gradient $\boldsymbol{g}_t$ that the Gradient Predictor makes one period earlier.
- $\lVert \cdot \rVert_*$: Dual norm of the norm that the potential of the Projection Geometry is strongly convex against.
- $R_{\max}$: Scale and cap of the rate. The paper sets $R_{\max}^2 = \sup_{\boldsymbol{w}, \boldsymbol{w}' \in \mathcal{W}} D_\Psi(\boldsymbol{w}, \boldsymbol{w}')$.
- $\mathcal{W}$: Allocation Set.
- $D_\Psi$: Bregman divergence of $\Psi$.
The rate is the cap $R_{\max}$ while $S_{t-1} = 0$. With $R_{\max}$ at that supremum, the paper bounds the regret over $T$ periods by $3.5 R_{\max} (\sqrt{S_T} + 1)$. Under the Euclidean geometry on the simplex the supremum is one, the default rmax. Under the entropic geometry the supremum is infinite, and the uniform mix alpha of the wrapped rule does not bound it, because the mix applies to the played allocation and not to the secondary iterate. There rmax is a tuning constant, and the bound does not hold.
Fields
rmax: The paper's $R_{\max}$, which scales the rate and caps it.
Constructors
HintResidualRate(; rmax::Real = 1) -> HintResidualRateKeywords correspond to the struct's fields.
Validation
rmax > 0. ADomainErroris thrown otherwise.
Examples
julia> HintResidualRate()HintResidualRate rmax ┴ Int64: 1Related
References
- [212] A. Rakhlin and K. Sridharan. Optimization, learning, and games with predictable sequences. In: Advances in Neural Information Processing Systems 26, 3066–3074 (2013).
PortfolioOptimisers.OptimisticStep — Type
struct OptimisticStep{T1<:MirrorDescent, T2<:AbstractGradientPredictor} <: AbstractOnlinePortfolioSelectionAlgorithmPlays two half-steps of a first-order rule each period, the second along a hint for the gradient of the next period (OMD).
This is the optimistic mirror descent of Rakhlin and Sridharan (2013), as a wrapper over a MirrorDescent rule. The carrier holds two iterates. The secondary iterate is where the step of the next period starts, and the played allocation is one hint step ahead of it.
eta, proj, alpha and obj are those of the wrapped rule. Both half-steps are its mirror step in its geometry, and the gradient is that of its objective, through loss_gradient. A RiskLoss reads the head's rows, and the wrapper needs as many rows as the larger of the objective and the predictor. A schedule on eta counts the periods of the wrapper and reads its carrier. The wrapper reads the uniform mix alpha as the wrapped rule does.
Mathematical definition
\[\begin{align} \boldsymbol{v}_{t+1} &= \underset{\boldsymbol{v} \in \mathcal{W}}{\arg\min} \; \eta_t \langle \boldsymbol{g}_t, \boldsymbol{v} \rangle + D_\Psi(\boldsymbol{v}, \boldsymbol{v}_t)\,, \\ \boldsymbol{w}_{t+1} &= \underset{\boldsymbol{w} \in \mathcal{W}}{\arg\min} \; \eta_{t+1} \langle M_{t+1}, \boldsymbol{w} \rangle + D_\Psi(\boldsymbol{w}, \boldsymbol{v}_{t+1})\,. \end{align}\]
Where:
- $\boldsymbol{v}_t$: Secondary iterate of the optimistic step at period $t$, the allocation that the first half-step of period $t$ starts from.
- $\boldsymbol{w}_t$: Iterate of the rule at period $t$, the allocation its update reads. Here it is the played allocation before the uniform mix.
- $\boldsymbol{g}_t$: Gradient of the loss of period $t$, taken at the iterate. The rule takes it at $\boldsymbol{w}_t$. Under
LogWealthit is $-\boldsymbol{x}_t / \langle \boldsymbol{w}_t, \boldsymbol{x}_t \rangle$. - $\boldsymbol{x}_t$: Price relative vector of period $t$, each asset's price over its price one period earlier.
- $M_t$: Hint of period $t$, the forecast of the gradient $\boldsymbol{g}_t$ that the Gradient Predictor makes one period earlier.
- $\eta_t$: Learning rate of the update at period $t$.
- $t$: Period index, counted from one.
- $\mathcal{W}$: Allocation Set.
- $\Psi$: Potential of the Projection Geometry.
- $D_\Psi$: Bregman divergence of $\Psi$.
- $\lVert \cdot \rVert_*$: Dual norm of the norm that the potential of the Projection Geometry is strongly convex against.
The rates follow equation (1) of [212], which forms $\boldsymbol{w}_{t+1}$ at $\eta_{t+1}$. A fixed rate is one rate for both half-steps. Under the zero hint the second half-step returns $\boldsymbol{v}_{t+1}$, so the rule is the wrapped rule.
For a fixed rate $\eta$ and a comparator $\boldsymbol{w}^*$ with $D_\Psi(\boldsymbol{w}^*, \boldsymbol{v}_1) \leq R^2$, Lemma 1 of [212], with its equation (3) at $\rho = \eta$, bounds the regret by $\eta^{-1} R^2 + \tfrac{\eta}{2} \sum_t \lVert \boldsymbol{g}_t - M_t \rVert_*^2$. At the rate tuned to the residual sum, the bound is $O(\sqrt{\sum_t \lVert \boldsymbol{g}_t - M_t \rVert_*^2})$. The residual sum is the path length of the gradients under LastGradient, and the spread of the gradients about their mean bounds it under MeanGradient. [215] states that a hint that misses keeps the bound of mirror descent up to a constant, for hints no larger than the gradients in the dual norm. HintResidualRate on the eta of the wrapped rule is the adaptive rate of [212].
Algorithm
The seven-argument online_update! runs these steps at the period's row x. The six-argument form calls it with the unmixed played iterate st.u as the Gradient Point point.
- Set the period
t = st.n + 1, and form the Price-Adjusted Allocationwhof the bookwafter the row. - When the schedule of
etanames a restart att, re-enter the Start Allocationst.w0onto the set fromwhwithreprojection. Put both iterates at that allocation and every carrier at its seed, keept, and return that allocation. Stop. - When the schedule reads the period's row before the rate, write its statistic from
wandx. - Read the rate
etaand the sharealphaof periodt. - Mix the price relatives into
xmwithmixed_relatives. - Take the gradient
gofobjatpoint, fromxmand the head'srows, withloss_gradient. - Take the first half-step from the secondary iterate
st.voneta .* gwithhalf_step, which gives the new secondary iteratev. - Form the hint
mand the carrierpsof the predictor withpredict_gradient!, fromg,v,xandxm. - Measure the residual
rofgagainst the last hintst.mwithhint_residual, and shift the residual sums intores. - When the schedule reads the past alone, write its statistic
sfromwandx. - Read the rate of period
t + 1from a carrier that holds the period's row. Take the second half-step fromvon that rate timesm, which gives the unmixed played iterateu. - Form the played allocation from
uwithplayed_allocation. Whenalphais positive, project it withreprojection. - Return the new state and the played allocation.
Fields
alg: The first-order rule that takes both half-steps.
predictor: The Gradient Predictor whose hint the second half-step follows.
Constructors
OptimisticStep(; alg::MirrorDescent = MirrorDescent(), predictor::AbstractGradientPredictor = LastGradient()) -> OptimisticStepKeywords correspond to the struct's fields. The Gradient Transform of the wrapped rule must be the identity. A transform keeps a carrier that one gradient writes each period, and the optimistic step reads two gradients a period.
Validation
alg.gradis aPlainGradient. AnArgumentErroris thrown otherwise.
Examples
julia> OptimisticStep()OptimisticStep alg ┼ MirrorDescent │ eta ┼ Float64: 0.05 │ proj ┼ EntropicProjection() │ alpha ┼ Int64: 0 │ obj ┼ LogWealth() │ grad ┴ PlainGradient() predictor ┼ LastGradient │ at_played ┴ Bool: trueRelated
AbstractOnlinePortfolioSelectionAlgorithmOnlinePortfolioSelectionMirrorDescentOptimisticStepStateAbstractGradientPredictorHintResidualRate
References
- [215] A. Rakhlin and K. Sridharan. Online learning with predictable sequences. In: Proceedings of the 26th Annual Conference on Learning Theory, 993–1019 (2013).
- [212] A. Rakhlin and K. Sridharan. Optimization, learning, and games with predictable sequences. In: Advances in Neural Information Processing Systems 26, 3066–3074 (2013).
- [213] C.-K. Chiang, T. Yang, C.-J. Lee, M. Mahdavi, C.-J. Lu, R. Jin and S. Zhu. Online optimization with gradual variations. In: Proceedings of the 25th Annual Conference on Learning Theory, 6.1–6.20 (2012).
References
- [211]
- J. Duchi, E. Hazan and Y. Singer. Adaptive subgradient methods for online learning and stochastic optimization. Journal of Machine Learning Research 12, 2121–2159 (2011).
- [212]
- A. Rakhlin and K. Sridharan. Optimization, learning, and games with predictable sequences. In: Advances in Neural Information Processing Systems 26 (2013); pp. 3066–3074.
- [213]
- C.-K. Chiang, T. Yang, C.-J. Lee, M. Mahdavi, C.-J. Lu, R. Jin and S. Zhu. Online optimization with gradual variations. In: Proceedings of the 25th Annual Conference on Learning Theory (2012); p. 6.1–6.20.
- [214]
- A. Nemirovski. Prox-method with rate of convergence O(1/t) for variational inequalities with Lipschitz continuous monotone operators and smooth convex-concave saddle point problems. SIAM Journal on Optimization 15, 229–251 (2004).
- [215]
- A. Rakhlin and K. Sridharan. Online learning with predictable sequences. In: Proceedings of the 26th Annual Conference on Learning Theory (2013); pp. 993–1019.