Online selection rules: the third set

These rules solve an optimisation at each period. FollowTheLeader solves an optimisation estimator again on the past rows that a sample selector names, and moves the weights part of the way to the solution. The selectors are Prefix, which takes every row so far, LastRows, which takes the last W rows, and five pattern matchers, HistogramMatch, KernelMatch, NearestNeighbourMatch, CorrelationMatch and ClusterMatch. A pattern matcher takes the rows whose preceding window resembles the latest one. AllocationSetConstraint adds the set of allowed weights of OnlinePortfolioSelection to that optimisation. ShortTermLossControlPortfolio is a follow-the-leader rule over the rank-one covariance, and LowDimensionEnsemblePortfolio is one over the low-dimension ensemble prior. FollowTheLeadingHistory mixes copies of one rule started at different periods.

PortfolioOptimisers.AbstractSampleSelector — Type
abstract type AbstractSampleSelector <: AbstractAlgorithm

Names the past periods on which a follow-the-leader rule re-solves its held estimator.

A FollowTheLeader rule holds a Sample Selector on sel. The solved rules of the online selection literature solve one programme and differ in the sample alone. Follow the leader takes every period so far, and the successive variable rebalanced portfolio takes the last W. The pattern-matching rules take the periods whose preceding window resembles the latest window, by histogram cell, kernel radius, nearest neighbours, correlation or cluster. A selector reads the price relatives that the head holds and returns row indices. It holds no rows of its own.

Interfaces

In order to implement a new selector, subtype AbstractSampleSelector with the paper's parameters as part of the struct, and implement:

  • select_rows(sel::AbstractSampleSelector, X::AbstractMatrix) -> AbstractVector{<:Integer}: The indices of the rows of X in the sample, in time order. An empty vector is the empty sample.
  • rows_needed(sel::AbstractSampleSelector) -> Union{Nothing, Integer}: The number of rows that the selector reads at a step, or nothing for every row folded so far.

Arguments

  • sel: The selector.
  • X: The price relatives 1 .+ r of every row that the head holds, observations × assets, in time order. A gap reads as one, through price_relative. So a window that spans a listing compares as a window in which that asset sat in cash, which is the number that the step reads there.

Returns

  • idx::AbstractVector{<:Integer}: The row indices of the sample, in time order.

Related

source
PortfolioOptimisers.Prefix — Type
struct Prefix <: AbstractSampleSelector

Selects every period so far, the sample of follow the leader.

Under the default log-optimal estimator the leader is the best constant rebalanced portfolio to date. This is the successive constant rebalanced portfolio (SCRP) of Gaivoronski and Stella (2000).

Mathematical definition

\[\begin{align} C_t &= \left\lbrace 1, \ldots, t \right\rbrace\,. \end{align}\]

Where:

  • $C_t$: Sample of period $t$, the past periods whose price relatives the leader re-solves on.
  • $t$: Period index, counted from one.

Examples

julia> Prefix()Prefix()

Related

References

  • [200] A. A. Gaivoronski and F. Stella. Stochastic nonstationary optimization for finding universal portfolios. Annals of Operations Research 100, 165–188 (2000).
  • [151] B. Li and S. C. H. Hoi. Online portfolio selection: A survey. ACM Computing Surveys 46(3), 1–36 (2014). Section 3.2.3.
source
PortfolioOptimisers.LastRows — Type
struct LastRows{T1<:Integer} <: AbstractSampleSelector

Selects the last W periods, the sample of the successive variable rebalanced portfolio.

Under the default log-optimal estimator the leader is the best constant rebalanced portfolio of a moving window. Gaivoronski and Stella (2000) call the rule the successive variable rebalanced portfolio, and Li and Hoi (2014) call it the variable rebalanced portfolio (VRP). Before W periods exist the sample is every period so far, as in the paper of Gaivoronski and Stella.

Mathematical definition

\[\begin{align} C_t &= \left\lbrace \max(1,\, t - W + 1), \ldots, t \right\rbrace\,. \end{align}\]

Where:

  • $C_t$: Sample of period $t$, the past periods whose price relatives the leader re-solves on.
  • $W$: Window of the sample, the W field.
  • $t$: Period index, counted from one.

Fields

  • W: The number of rows of the window.

Constructors

LastRows(; W::Integer = 30) -> LastRows

Keywords correspond to the struct's fields.

Validation

  • W >= 1. A DomainError is thrown otherwise.

Examples

julia> LastRows()LastRows  W ┴ Int64: 30

Related

References

  • [200] A. A. Gaivoronski and F. Stella. Stochastic nonstationary optimization for finding universal portfolios. Annals of Operations Research 100, 165–188 (2000).
  • [151] B. Li and S. C. H. Hoi. Online portfolio selection: A survey. ACM Computing Surveys 46(3), 1–36 (2014). Section 3.2.3.
source
PortfolioOptimisers.AbstractPatternMatchSelector — Type
abstract type AbstractPatternMatchSelector <: AbstractSampleSelector

Selects the periods whose preceding window resembles the latest window, the pattern-matching family.

The selector compares each candidate period through the window of the window periods before it. The latest window holds the last window periods, and it precedes the next period, which has no price relative yet. Before window + 1 periods exist no candidate exists, the sample is empty, and the rule plays the uniform portfolio. Every selector of the family reads every row folded so far.

Mathematical definition

\[\begin{align} C_t &= \left\lbrace w < i \leq t : m\left(\boldsymbol{x}_{i-w}^{i-1},\, \boldsymbol{x}_{t-w+1}^{t}\right) \right\rbrace\,. \end{align}\]

Where:

  • $C_t$: Sample of period $t$, the past periods whose price relatives the leader re-solves on.
  • $w$: Window length, the number of periods in each window that a pattern-matching selector compares.
  • $\boldsymbol{x}_{a}^{b}$: Window of periods $a$ to $b$, the price relatives of those periods concatenated into one vector.
  • $m$: Similarity test of the selector, true when a candidate window matches the latest window.
  • $t$: Period index, counted from one.

Algorithm

The steps of select_rows on every selector of the family:

  1. Call pattern_candidates on sel.window and X, giving the candidate rows rows, their flattened windows cands and the flattened latest window latest. When it returns nothing, return the empty vector.
  2. Call matched_rows on sel, X, cands and latest, giving the matched positions.
  3. Return rows at those positions.

Interfaces

In order to implement a new pattern-matching selector, subtype AbstractPatternMatchSelector with a window field and the paper's similarity parameters, and implement:

  • matched_rows(sel::AbstractPatternMatchSelector, X::AbstractMatrix, cands::AbstractVector, latest::AbstractVector) -> AbstractVector{<:Integer}: The positions in cands of the candidates that match. cands holds one flattened window for each candidate, and latest is the latest window flattened the same way.

Related

source
PortfolioOptimisers.matched_rows — Function
matched_rows(sel::AbstractPatternMatchSelector, X::AbstractMatrix, cands::AbstractVector, latest::AbstractVector)

Returns the positions of the candidates that a pattern-matching selector matches against the latest window.

Arguments

  • sel: The selector.
  • X: The price relatives that the head holds, for a selector that reads more than the windows.
  • cands: One flattened window for each candidate period, in time order.
  • latest: The latest window, flattened the same way.

Returns

  • idx::AbstractVector{<:Integer}: The positions in cands of the matched candidates, increasing.

Related

source
PortfolioOptimisers.HistogramMatch — Type
struct HistogramMatch{T1<:Integer, T2<:(AbstractVector{<:Real})} <: AbstractPatternMatchSelector

Selects the periods whose preceding window falls in the same histogram cell as the latest window (BH).

This is the histogram rule of Györfi and Schäfer (2003). The paper quantises each price relative vector by a partition of the positive orthant, and a period matches when its window gives the same string of cell labels as the latest window. The paper leaves the partition to the user. Its consistency theorem asks for a nested sequence of partitions whose cells shrink, and the paper mixes the experts of that sequence by wealth. That mixture is an ExpertMixture over FollowTheLeader rules with one selector each.

Mathematical definition

\[\begin{align} C_t &= \left\lbrace w < i \leq t : G\left(\boldsymbol{x}_{i-w}^{i-1}\right) = G\left(\boldsymbol{x}_{t-w+1}^{t}\right) \right\rbrace\,, \\ G(\boldsymbol{v})_j &= \left\lvert \left\lbrace k : e_k \leq v_j \right\rbrace \right\rvert\,. \end{align}\]

Where:

  • $C_t$: Sample of period $t$, the past periods whose price relatives the leader re-solves on.
  • $w$: Window length, the number of periods in each window that a pattern-matching selector compares.
  • $\boldsymbol{x}_{a}^{b}$: Window of periods $a$ to $b$, the price relatives of those periods concatenated into one vector.
  • $G$: Cell map, which sends a flattened window to the bin index of each of its entries.
  • $e_1 < \cdots < e_m$: Cell edges, the edges field.
  • $v_j$: Entry $j$ of a flattened window $\boldsymbol{v}$.
  • $t$: Period index, counted from one.

The bins of every entry form a partition of the positive orthant into products of intervals, which is one partition of the paper's kind. At the default edges = [1] the bin of an entry shows whether the asset rose or fell. So two windows match when every asset moved the same way in every period of the window. More edges give a finer partition and a smaller sample.

Fields

  • window: The number of rows of the windows compared.
  • edges: The cell boundaries of every entry's binning, increasing.

Constructors

HistogramMatch(; window::Integer = 5, edges::AbstractVector{<:Real} = [1]) -> HistogramMatch

Keywords correspond to the struct's fields.

Validation

  • window >= 1. A DomainError is thrown otherwise.
  • !isempty(edges). An IsEmptyError is thrown otherwise.
  • edges is finite and strictly increasing. An ArgumentError is thrown otherwise.

Examples

julia> HistogramMatch()HistogramMatch  window ┼ Int64: 5   edges ┴ Vector{Int64}: [1]

Related

References

  • [201] L. Györfi and D. Schäfer. Nonparametric prediction. In: Advances in Learning Theory: Methods, Models and Applications, 339–354 (IOS Press, 2003).
  • [151] B. Li and S. C. H. Hoi. Online portfolio selection: A survey. ACM Computing Surveys 46(3), 1–36 (2014). Section 3.4.1.
source
PortfolioOptimisers.KernelMatch — Type
struct KernelMatch{T1<:Integer, T2<:Real} <: AbstractPatternMatchSelector

Selects the periods whose preceding window lies within radius of the latest window (BK).

This is the kernel rule of Györfi, Lugosi and Udina (2006) under the uniform kernel, in the Euclidean norm of the flattened windows. The paper's experts run over a grid of windows $w$ and radii $c / \ell$, and the paper mixes them by wealth. That mixture is an ExpertMixture over FollowTheLeader rules with one selector each, and each selector holds one radius.

Three later rules use this selector under another objective, which the held estimator on the rule's opt states. The semi-log-optimal rule of Györfi, Urbán and Vajda (2007) maximises the second-order expansion of the log at one. The Markowitz-type rule of Ottucsák and Vajda (2007) maximises a mean-variance utility. The rule of Györfi and Vajda (2008) compares windows of one period and maximises the log return net of proportional costs.

Mathematical definition

\[\begin{align} C_t &= \left\lbrace w < i \leq t : \left\lVert \boldsymbol{x}_{i-w}^{i-1} - \boldsymbol{x}_{t-w+1}^{t} \right\rVert_2 \leq r \right\rbrace\,. \end{align}\]

Where:

  • $C_t$: Sample of period $t$, the past periods whose price relatives the leader re-solves on.
  • $w$: Window length, the number of periods in each window that a pattern-matching selector compares.
  • $\boldsymbol{x}_{a}^{b}$: Window of periods $a$ to $b$, the price relatives of those periods concatenated into one vector.
  • $r$: Radius of the uniform kernel, the radius field.
  • $t$: Period index, counted from one.

Fields

  • window: The number of rows of the windows compared.
  • radius: The radius of the uniform kernel, in the Euclidean norm of the concatenated windows.

Constructors

KernelMatch(; window::Integer = 5, radius::Real) -> KernelMatch

Keywords correspond to the struct's fields. The radius has no default, because the papers scan it. Its scale is the scale of a window of price relatives.

Validation

  • window >= 1. A DomainError is thrown otherwise.
  • radius > 0 and finite. A DomainError is thrown otherwise.

Examples

julia> KernelMatch(; radius = 0.1)KernelMatch  window ┼ Int64: 5  radius ┴ Float64: 0.1

Related

References

  • [202] L. Györfi, G. Lugosi and F. Udina. Nonparametric kernel-based sequential investment strategies. Mathematical Finance 16, 337–357 (2006).
  • [203] L. Györfi, A. Urbán and I. Vajda. Kernel-based semi-log-optimal empirical portfolio selection strategies. International Journal of Theoretical and Applied Finance 10, 505–516 (2007).
  • [204] G. Ottucsák and I. Vajda. An asymptotic analysis of the mean-variance portfolio selection. Statistics & Decisions 25, 63–88 (2007).
  • [205] L. Györfi and I. Vajda. Growth optimal investment with transaction costs. In: Algorithmic Learning Theory, Lecture Notes in Computer Science 5254, 108–122 (Springer, 2008).
source
PortfolioOptimisers.NearestNeighbourMatch — Type
struct NearestNeighbourMatch{T1<:Integer, T2<:Real} <: AbstractPatternMatchSelector

Selects the periods whose preceding windows are the neighbours nearest to the latest window (BNN).

This is the nearest-neighbour rule of Györfi, Udina and Walk (2008), in the Euclidean norm of the flattened windows. The paper invests at period $n = t + 1$ with $\lfloor p\, n \rfloor$ neighbours, a count that grows with the history. So neighbours is an Integer count or a fraction in (0, 1). The fraction applies to the $t - w$ candidates and not to the period, so the count never exceeds the candidates. It is below the paper's count by at most $\lceil p (w + 1) \rceil$. A fraction that rounds down to zero gives the empty sample. The paper assumes that ties have zero probability. Here the earlier period wins a tie at the boundary.

Mathematical definition

\[\begin{align} C_t &= \left\lbrace w < i \leq t : \boldsymbol{x}_{i-w}^{i-1} \text{ is one of the } \ell \text{ windows nearest to } \boldsymbol{x}_{t-w+1}^{t} \right\rbrace\,, \\ \ell &= \begin{cases} \min(k,\, t - w) & \text{for a count } k\,, \\ \lfloor p\, (t - w) \rfloor & \text{for a fraction } p\,. \end{cases} \end{align}\]

Where:

  • $C_t$: Sample of period $t$, the past periods whose price relatives the leader re-solves on.
  • $w$: Window length, the number of periods in each window that a pattern-matching selector compares.
  • $\boldsymbol{x}_{a}^{b}$: Window of periods $a$ to $b$, the price relatives of those periods concatenated into one vector.
  • $\ell$: Neighbour count at period $t$.
  • $k$: Count, the neighbours field when it is an Integer.
  • $p$: Fraction, the neighbours field when it is a real in (0, 1).
  • $t$: Period index, counted from one.

The distance between two windows is the Euclidean norm of their difference.

Fields

  • window: The number of rows of the windows compared.
  • neighbours: The number of neighbours to keep, an Integer count or a fraction in (0, 1) of the candidate rows.

Constructors

NearestNeighbourMatch(; window::Integer = 5, neighbours::Real = 0.1) -> NearestNeighbourMatch

Keywords correspond to the struct's fields.

Validation

  • window >= 1. A DomainError is thrown otherwise.
  • neighbours >= 1 for an Integer, and 0 < neighbours < 1 for another real. A DomainError is thrown otherwise.

Examples

julia> NearestNeighbourMatch()NearestNeighbourMatch      window ┼ Int64: 5  neighbours ┴ Float64: 0.1

Related

References

  • [206] L. Györfi, F. Udina and H. Walk. Nonparametric nearest neighbor based empirical portfolio selection strategies. Statistics & Decisions 26, 145–157 (2008).
source
PortfolioOptimisers.CorrelationMatch — Type
struct CorrelationMatch{T1<:Integer, T2<:Real} <: AbstractPatternMatchSelector

Selects the periods whose preceding window correlates with the latest window at rho or more (CORN).

This is the correlation-driven rule of Li, Hoi and Gopalkrishnan (2011). The correlation is the Pearson correlation of the two flattened windows.

The paper's CORN-U mixes the experts of the windows 1 to $W$ at one threshold, from a uniform start and by wealth. Its CORN-K runs over the windows 1 to $W$ and the thresholds $0, 1/P, \ldots, (P - 1)/P$, and it keeps the $K$ wealthiest experts, weighted by wealth. Both are an ExpertMixture over FollowTheLeader rules with one selector each, CORN-K under the TopK weighting. The paper sets $W = 5$, $P = 10$ and $K = 5$, and it runs CORN-U at the threshold 0.1 with no tuning. The defaults of one selector take the window 5 and the threshold 0.1 from these values.

Wang, Wang, Wang and Zhang (2018) add a risk penalty to each expert (RACORN-K). Their programme maximises the mean log return over the sample less $\lambda$ times the standard deviation of the log return $\log \langle \boldsymbol{w}, \boldsymbol{x}_i \rangle$. Their experts run over windows, thresholds and values of $\lambda$, and the wealthiest tenth of them combine as in CORN-K. The nearest programme of the library is MeanRisk under MaximumUtility at l = λ over StandardDeviation, with LogarithmicReturn. It penalises the standard deviation of the return $\langle \boldsymbol{w}, \boldsymbol{x}_i \rangle - 1$ in place of the log return, and the two penalties agree to the first order in the return.

Mathematical definition

\[\begin{align} C_t &= \left\lbrace w < i \leq t : \rho\left(\boldsymbol{x}_{i-w}^{i-1},\, \boldsymbol{x}_{t-w+1}^{t}\right) \geq \bar{\rho} \right\rbrace\,, \\ \rho(\boldsymbol{u}, \boldsymbol{v}) &= \begin{cases} \dfrac{\operatorname{cov}(\boldsymbol{u}, \boldsymbol{v})}{\sigma(\boldsymbol{u})\, \sigma(\boldsymbol{v})} & \text{if } \sigma(\boldsymbol{u})\, \sigma(\boldsymbol{v}) > 0\,, \\ 0 & \text{otherwise}\,. \end{cases} \end{align}\]

Where:

  • $C_t$: Sample of period $t$, the past periods whose price relatives the leader re-solves on.
  • $w$: Window length, the number of periods in each window that a pattern-matching selector compares.
  • $\boldsymbol{x}_{a}^{b}$: Window of periods $a$ to $b$, the price relatives of those periods concatenated into one vector.
  • $\rho(\boldsymbol{u}, \boldsymbol{v})$: Correlation of two flattened windows, taken over their entries.
  • $\operatorname{cov}$, $\sigma$: Covariance and standard deviation over the entries of a flattened window.
  • $\bar{\rho}$: Threshold, the rho field.
  • $t$: Period index, counted from one.

A window with no variation correlates at zero, as the paper sets it. So it matches at a threshold of zero or less, and at no positive threshold.

Fields

  • window: The number of rows of the windows compared.
  • rho: The correlation threshold a candidate window must reach.

Constructors

CorrelationMatch(; window::Integer = 5, rho::Real = 0.1) -> CorrelationMatch

Keywords correspond to the struct's fields.

Validation

  • window >= 1. A DomainError is thrown otherwise.
  • -1 <= rho <= 1. A DomainError is thrown otherwise.

Examples

julia> CorrelationMatch()CorrelationMatch  window ┼ Int64: 5     rho ┴ Float64: 0.1

Related

References

  • [194] B. Li, S. C. H. Hoi and V. Gopalkrishnan. CORN: Correlation-driven nonparametric learning approach for portfolio selection. ACM Transactions on Intelligent Systems and Technology 2(3), 21:1–21:29 (2011). Equation 6, Algorithms 1 to 3 and Section 5.2.
  • [207] Y. Wang, D. Wang, Y. Wang and Y. Zhang. RACORN-K: Risk-aversion pattern matching-based portfolio selection. arXiv:1802.10244 (2018). Equation 3.
source
PortfolioOptimisers.ClusterMatch — Type
struct ClusterMatch{T1<:Integer, T2<:AbstractClustersEstimator} <: AbstractPatternMatchSelector

Selects the periods whose preceding window falls in the same cluster as the latest window (KMNLOG).

This follows the cluster-based rule of Khedmati and Azin (2020). The paper clusters the windows by k-means (KMNLOG), k-medoids (KMDLOG), spectral clustering (SPCLOG) and hierarchical clustering (HRCLOG). The clusterer field takes one of the library's clustering estimators, which partitions the windows through a distance that it forms from them. KMeansAlgorithm and HClustAlgorithm are among its algorithms. The paper puts a transaction cost into its programme, and the fees slot of the rule's opt holds that cost. Fewer than two candidates cannot be partitioned, so they give the empty sample.

Mathematical definition

\[\begin{align} C_t &= \left\lbrace w < i \leq t : \kappa\left(\boldsymbol{x}_{i-w}^{i-1}\right) = \kappa\left(\boldsymbol{x}_{t-w+1}^{t}\right) \right\rbrace\,. \end{align}\]

Where:

  • $C_t$: Sample of period $t$, the past periods whose price relatives the leader re-solves on.
  • $w$: Window length, the number of periods in each window that a pattern-matching selector compares.
  • $\boldsymbol{x}_{a}^{b}$: Window of periods $a$ to $b$, the price relatives of those periods concatenated into one vector.
  • $\kappa$: Cluster label of a window, from one clustering of the $t - w$ candidate windows and the latest window together.
  • $t$: Period index, counted from one.

Algorithm

The steps of matched_rows on this selector:

  1. When cands holds fewer than two windows, return the empty vector.
  2. Lay the candidate windows and latest out as the columns of M, with latest in the last column.
  3. Cluster the columns of M with clusterise on sel.clusterer, giving labels.
  4. Return the positions of the candidates whose label is the label of latest.

Fields

  • window: The number of rows of the windows compared.
  • clusterer: The clustering estimator that partitions the windows.

Constructors

ClusterMatch(;    window::Integer = 5,    clusterer::AbstractClustersEstimator = ClustersEstimator(; alg = KMeansAlgorithm())) -> ClusterMatch

Keywords correspond to the struct's fields.

Validation

  • window >= 1. A DomainError is thrown otherwise.

Examples

julia> ClusterMatch(; clusterer = ClustersEstimator()).window5

Related

References

  • [208] M. Khedmati and P. Azin. An online portfolio selection algorithm using clustering approaches and considering transaction costs. Expert Systems with Applications 159, 113546 (2020).
source
PortfolioOptimisers.AllocationSetConstraint — Type
struct AllocationSetConstraint{T1<:AbstractAllocationSet, T2<:(AbstractVector), T3<:(Union{Nothing, var"#s7444"} where var"#s7444"<:ReturnsResult)} <: CustomJuMPConstraint

Adds the head's Allocation Set to the programme of a follow-the-leader re-solve, the Allocation Set Constraint.

The type is a CustomJuMPConstraint that holds the resolved set, the Price-Adjusted Allocation of the step and the head's rows. A FollowTheLeader rule appends it to the ccnt of its held optimiser for one solve. add_custom_constraint! on it calls add_allocation_set_constraints!, which runs the set's own builders on the leader's model. So the feasible region of the programme is the set intersected with the region of the held optimiser. The turnover ceiling measures from the Price-Adjusted Allocation. The variance ceiling and the tracking error read the set's own pe on the head's rows, as they do in a projection. A constraint can live on the set or on the held optimiser, and a caller who wants one home leaves the other bare.

Fields

  • set: The Allocation Set, resolved over the pinned universe.
  • w: The Price-Adjusted Allocation the step trades from.
  • X: The rows carrier the head holds through the period, a ReturnsResult, or nothing.

View parameters

When port_opt_view is called on this type, its fields are subset to the selected assets. set takes its own view, against the unreduced returns matrix of the carrier when one exists, because the view of a tracking estimator asks for it. The view slices w, and X takes the view of the carrier. The reduction of the held estimator to its Investable Mask views its ccnt with the rest of the optimiser. So the set stays in the reduced programme. A custom constraint with no view drops out of it.

Related

source
PortfolioOptimisers.FollowTheLeader — Type
struct FollowTheLeader{T1<:AbstractSampleSelector, T2<:(Union{var"#s7444", var"#s7443"} where {var"#s7444"<:BestConstantRebalancedPortfolio, var"#s7443"<:JuMPOptimisationEstimator}), T3<:Real, T4<:EuclideanProjection} <: AbstractOnlinePortfolioSelectionAlgorithm

Re-solves an optimisation estimator on a sample of past periods at every step, the follow-the-leader rule.

The Sample Selector on sel names the sample, and the estimator on opt solves on it. The solution is the leader. The rule plays the leader, or at gamma > 0 the leader damped towards the allocation that it held.

Every solved rule of the online selection literature is this rule under one selector and one objective. Prefix under the log-optimal objective is follow the leader, the successive constant rebalanced portfolio of Gaivoronski and Stella (2000). At gamma > 0 it is their weighted rule (WSCRP). LastRows gives their successive variable rebalanced portfolio. The pattern-matching selectors give the histogram, kernel, nearest-neighbour, correlation and cluster rules. The papers of those rules mix a grid of selectors by wealth, which is an ExpertMixture over rules of this kind.

The objective is the held estimator's. BestConstantRebalancedPortfolio, the default, is the log-optimal portfolio with no solver. MeanRisk under LogarithmicReturn and MaximumReturn solves the same programme on a solver. Under Prefix and on the simplex, that estimator with l2 = L2Regularisation(; val = 1 / (2t), alg = QuadRiskExpr()) on its JuMPOptimiser and $t$ rows is the Exp-Concave-FTL of Hazan and Kale (2015). The paper subtracts $\tfrac{1}{2} \lVert \boldsymbol{w} \rVert^2$ from the sum of the log returns, and LogarithmicReturn states their mean, so the weight is $1 / (2t)$. One fixed val is that leader at one sample size alone. MaximumUtility over a risk measure gives a mean-risk leader, and fees on the estimator gives a cost-aware leader.

The solver-free default runs Cover's fixed point, which stops on a certificate, a bound on the shortfall of its log wealth from the leader's. At a leader that drops an asset, the weight of that asset decays slowly. So the default budget can stop before the certificate meets tol, and the rule then warns once and names the certificate. On the first 30 rows of the returns 0.02 .* randn(StableRNG(11), 40, 4) the default stops 0.066 from the leader in weight and 6.2e-5 short of it in log wealth. At iters = 10_000_000 the certificate meets tol = 1e-12 after 1 437 030 steps, 1.6e-9 from the leader in weight. A JuMP head solves the leader to the solver's tolerance, and the two forms agree to that tolerance at a leader inside the simplex.

The re-solve takes the head's Allocation Set as its feasible region. The rule wraps the set, the Price-Adjusted Allocation and the head's rows into an AllocationSetConstraint, and appends it to the ccnt of the held JuMP estimator for the solve. It passes the Price-Adjusted Allocation through factory as a fold loop does, so a turnover term or a fee on opt reads the same book. It plays the optimum with no projection, because the projected leader is not the leader. The solver-free estimator has no model. So a BoundedAllocationSet goes into its wb and sets, and the rule plays its repaired fixed point. The head refuses a ProgrammeAllocationSet over the solver-free estimator at construction. Under a programme set the constrained leader is MeanRisk under LogarithmicReturn.

The rule projects the damped mix alone. It uses the Euclidean geometry on proj, with the Price-Adjusted Allocation as the reference. On a static convex set the projection returns the mix unchanged. A turnover ceiling or a MIP kind needs the repair on a day when the mix leaves the set. The rule skips the projection by type on a BoundedAllocationSet, and at gamma = 0. An empty sample, or a sample too small for the estimator, gives the uniform portfolio projected onto the set, as the papers do. A JuMP head fits a covariance, so it needs two rows. A re-solve that fails after the fallback chain of the held estimator is a Held Step. The rule then plays the Price-Adjusted Allocation, so the fund trades nothing that period.

Under a time-varying panel the re-solve is the batch path. The estimator reads the head's rows carrier viewed at the sample, with the returns as they are, NaN where no return exists, and the active mask. So the estimator reduces to its own universe, as it does on any carrier, and writes a zero at every asset outside it. That universe is the Coverage Universe of the sample for the solver-free leader and for a head with no prior, and the Investable Mask of its prior for a JuMP head. An asset that is not listed for a part of the sample stays outside the universe of a plain estimator until the sample clears that span. A Prefix sample never clears it, and a LastRows sample clears it when its window has passed the listing. A prior that reads the mask admits the asset after its own warm-up. The selector reads a gap as a price relative of one, as if the asset sat in cash, so it compares a window that spans a listing and does not drop it. The damped mix and the projection read a zero from the leader at such an asset as they read any other zero.

Mathematical definition

\[\begin{align} \boldsymbol{w}^\star_t &= \underset{\boldsymbol{w} \in \mathcal{W}}{\arg\max}\; \sum_{i \in C_t} \log \langle \boldsymbol{w}, \boldsymbol{x}_i \rangle\,, \\ \boldsymbol{w}_{t+1} &= \mathrm{Proj}_{\mathcal{W}}\left( (1 - \gamma)\, \boldsymbol{w}^\star_t + \gamma\, \boldsymbol{w}_t \right)\,. \end{align}\]

Where:

  • $\boldsymbol{w}^\star_t$: Leader of period $t$, the allocation that the held optimisation estimator solves for on the sample $C_t$. The first line is the leader under the default log-optimal estimator. Another estimator on opt replaces the objective.
  • $\boldsymbol{w}$: Decision allocation of the leader's programme.
  • $\mathcal{W}$: Allocation Set.
  • $C_t$: Sample of period $t$, the past periods whose price relatives the leader re-solves on.
  • $\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.
  • $\gamma$: Damping towards the held allocation, in $[0, 1]$, the gamma field.
  • $\mathrm{Proj}_{\mathcal{W}}$: Euclidean projection onto the Allocation Set $\mathcal{W}$.
  • $t$: Period index, counted from one.

At $\gamma = 0$ the rule plays the leader. The leader lies in $\mathcal{W}$, so the mix leaves $\mathcal{W}$ only when $\boldsymbol{w}_t$ is outside it, as under a turnover ceiling, or when $\mathcal{W}$ is not convex, as under a cardinality bound. Under the log-optimal estimator and Prefix, the leader on $\mathcal{W} = \Delta_N$ is the best constant rebalanced portfolio of the first $t$ periods. The Exp-Concave-FTL of Hazan and Kale is

\[\begin{align} \boldsymbol{w}^\star_t &= \underset{\boldsymbol{w} \in \Delta_N}{\arg\max}\; \sum_{i=1}^{t} \log \langle \boldsymbol{w}, \boldsymbol{x}_i \rangle - \frac{1}{2} \lVert \boldsymbol{w} \rVert_2^2\,. \end{align}\]

Where:

  • $\Delta_N$: Probability simplex over the $N$ assets.
  • $N$: Number of assets.

Algorithm

The steps of the Online Update:

  1. Compute wh, the Price-Adjusted Allocation of w over x.
  2. Select idx, the rows of the sample, with select_rows on alg.sel and the price relatives of rows.
  3. When idx holds fewer rows than leader_min_rows(alg.opt), set wstar to the uniform portfolio projected onto set with alg.proj, from wh. Otherwise set wstar to the result of leader_allocation on alg.opt, the view of rows at idx, wh, set and rows.
  4. When wstar is nothing, the step is a Held Step. Return the carrier st and a copy of wh.
  5. When alg.gamma is zero, return st and wstar.
  6. Set mix to (1 - alg.gamma) .* wstar .+ alg.gamma .* w. Return st and the result of blend_projection of mix onto set with alg.proj, from wh.

Fields

  • sel: The Sample Selector that names the rows the estimator re-solves on.
  • opt: The optimisation estimator re-solved on the selected rows.
  • gamma: The damping towards the held allocation, in [0, 1]. At 0 the rule plays the leader.
  • proj: The Projection Geometry the rule projects its raw step onto the Allocation Set in; the slot's type bound names the geometries the rule's theorem covers.

Constructors

FollowTheLeader(;    sel::AbstractSampleSelector = Prefix(),    opt::LeaderOptimiser = BestConstantRebalancedPortfolio(),    gamma::Real = 0,    proj::EuclideanProjection = EuclideanProjection()) -> FollowTheLeader

Keywords correspond to the struct's fields.

Validation

  • 0 <= gamma <= 1. A DomainError is thrown otherwise.

View parameters

When port_opt_view is called on this type, opt is viewed to the selected indices and sel, gamma and proj are carried unchanged.

Examples

julia> FollowTheLeader()FollowTheLeader    sel ┼ Prefix()    opt ┼ BestConstantRebalancedPortfolio        │       wb ┼ WeightBounds        │          │   lb ┼ Float64: 0.0        │          │   ub ┴ Float64: 1.0        │     fees ┼ nothing        │     sets ┼ nothing        │       wf ┼ IterativeWeightFinaliser        │          │   iter ┴ Int64: 100        │       fb ┼ nothing        │    iters ┼ Int64: 20000        │      tol ┼ Float64: 1.0e-12        │   strict ┴ Bool: false  gamma ┼ Int64: 0   proj ┴ EuclideanProjection()

Related

References

  • [200] A. A. Gaivoronski and F. Stella. Stochastic nonstationary optimization for finding universal portfolios. Annals of Operations Research 100, 165–188 (2000).
  • [209] E. Hazan and S. Kale. An online portfolio selection algorithm with regret logarithmic in price variation. Mathematical Finance 25, 288–310 (2015). Section 2.2, Equation 1.
  • [151] B. Li and S. C. H. Hoi. Online portfolio selection: A survey. ACM Computing Surveys 46(3), 1–36 (2014). Sections 3.2.3 and 3.4.
source
PortfolioOptimisers.ShortTermLossControlPortfolio — Function
ShortTermLossControlPortfolio(; window::Integer = 5, gamma::Real = 0.025, slv::Slv_VecSlv, pe::AbstractPriorEstimator = EmpiricalPrior(; ce = RankOneCovariance()), proj::EuclideanProjection = EuclideanProjection())

Builds the short-term portfolio optimisation with loss control of Lai, Tan, Wu and Fang (2020) (SPOLC).

The rule is a FollowTheLeader over the last window periods. Its programme maximises the worst increasing factor of the window less gamma times the portfolio variance under the RankOneCovariance. MeanRisk states it as the minimum of WorstRealisation plus Variance scaled by gamma. The variance reads the rank-one matrix as a quadratic form under QuadRiskExpr, which needs no factor of the singular matrix. The head's Allocation Set enters the programme as in every follow-the-leader programme. The paper does not state the rule before the window fills. Here the rule re-solves on the periods that it has, and on one period it plays the uniform portfolio, because the programme reads a covariance.

Mathematical definition

\[\begin{align} \boldsymbol{w}^\star_t &= \underset{\boldsymbol{w} \in \Delta_N}{\arg\max}\; \min_{i \in C_t} \langle \boldsymbol{w}, \boldsymbol{x}_i \rangle - \gamma\, \boldsymbol{w}^\intercal \hat{\mathbf{\Sigma}}_{\mathrm{RO}} \boldsymbol{w}\,, \\ C_t &= \left\lbrace \max(1,\, t - w + 1), \ldots, t \right\rbrace\,. \end{align}\]

Where:

  • $\boldsymbol{w}^\star_t$: Leader of period $t$, the allocation that the held optimisation estimator solves for on the sample $C_t$.
  • $\boldsymbol{w}$: Decision allocation of the leader's programme.
  • $\Delta_N$: Probability simplex over the $N$ assets.
  • $C_t$: Sample of period $t$, the past periods whose price relatives the leader re-solves on.
  • $\boldsymbol{x}_t$: Price relative vector of period $t$, each asset's price over its price one period earlier.
  • $\gamma$: Weight of the variance against the worst increasing factor, the paper's $\gamma$.
  • $\hat{\mathbf{\Sigma}}_{\mathrm{RO}}$: Rank-one covariance estimate of a window, the matrix that RankOneCovariance computes.
  • $w$: Window of the rule, the paper's $w$.
  • $N$: Number of assets.
  • $t$: Period index, counted from one.

This is the paper's equation 51 at period $t$. On the simplex $\langle \boldsymbol{w}, \boldsymbol{x}_i \rangle - 1$ is the portfolio return of period $i$. So the worst increasing factor less one is the negative of the worst realisation over the sample, and the two programmes have one maximiser.

Arguments

  • window: The paper's $w$, the number of periods of the window.
  • gamma: The paper's $\gamma$, the weight of the variance against the worst increasing factor.
  • slv: The solver of the programme.
  • pe: The prior estimator of the programme, whose covariance is the rank-one estimate.
  • proj: The geometry of the damped mix. The rule's gamma = 0 does not read it.

Validation

  • window >= 1. A DomainError is thrown otherwise.
  • gamma >= 0. A DomainError is thrown otherwise.

Returns

  • alg::FollowTheLeader: The rule over LastRows at W = window, whose opt is the loss-control programme.

Examples

julia> alg = ShortTermLossControlPortfolio(; slv = Solver(; solver = nothing));julia> alg.selLastRows  W ┴ Int64: 5julia> alg.opt.r[2].settings.scale0.025

Related

References

  • [64] Z.-R. Lai, L. Tan, X. Wu and L. Fang. Loss control with rank-one covariance estimate for short-term portfolio optimization. Journal of Machine Learning Research 21, 1–37 (2020). Equation 51 and Section 4.2.1.
source
PortfolioOptimisers.LowDimensionEnsemblePortfolio — Function
LowDimensionEnsemblePortfolio(; N::Integer, window::Integer = 5, gamma::Real = 0.25, xi::Real = 0.002, slv::Slv_VecSlv, pe::AbstractPriorEstimator = LowDimensionEnsemblePrior(), proj::EuclideanProjection = EuclideanProjection())

Builds the online low-dimension ensemble method of Xi, Li, Song and Ning (2023) (OLDEM).

The rule is a FollowTheLeader over the last window regression pairs. Its programme maximises the forecast return of the ensemble, less gamma times the portfolio variance under the predictive covariance of the ensemble, less a linear turnover fee at the rate xi. MeanRisk states it as MaximumUtility at the risk aversion gamma over Variance under QuadRiskExpr. The ensemble prior on pe gives the forecast and the covariance from one fit. A Fees whose Turnover rate is xi gives the $\ell_1$ term, and the head passes the reference allocation through factory, as it does for every fee. The head's Allocation Set enters the programme as in every follow-the-leader programme.

The paper relaxes $\boldsymbol{w} \geq \boldsymbol{0}$, runs a coordinate-wise descent on the change of the allocation, and projects the result onto the simplex. The programme here keeps $\boldsymbol{w} \geq \boldsymbol{0}$ inside the solve. So it returns the minimiser of the paper's programme, which the relaxed and projected result is not in general. window regression pairs need window + 1 rows, so the selector holds one row more than the paper's $w$. Before the window fills the rule re-solves on the rows that it has. Below three rows the covariance of the regressors does not exist, and the rule plays the uniform portfolio.

The turnover fee holds a reference allocation of the universe's length from construction, and the head replaces it at every update. So the constructor takes the number of assets N, as UniversalPortfolio does.

Mathematical definition

\[\begin{align} \boldsymbol{w}^\star_t &= \underset{\boldsymbol{w} \in \Delta_N}{\arg\min}\; -\hat{\boldsymbol{x}}_{t+1}^\intercal \boldsymbol{w} + \gamma\, \boldsymbol{w}^\intercal \hat{\mathbf{\Sigma}}_{t+1} \boldsymbol{w} + \xi\, \lVert \boldsymbol{w} - \hat{\boldsymbol{w}}_t \rVert_1\,. \end{align}\]

Where:

  • $\boldsymbol{w}^\star_t$: Leader of period $t$, the allocation that the held optimisation estimator solves for on the sample $C_t$.
  • $\boldsymbol{w}$: Decision allocation of the leader's programme.
  • $\Delta_N$: Probability simplex over the $N$ assets.
  • $\hat{\boldsymbol{x}}_{t+1}$: Price Relative Forecast for period $t + 1$, made after the row of period $t$.
  • $\gamma$: Risk aversion over the predictive variance, the paper's $\gamma$.
  • $\hat{\mathbf{\Sigma}}_{t+1}$: Predictive covariance of the price relatives of period $t + 1$, made after the row of period $t$.
  • $\xi$: Rate of the linear turnover fee, the paper's $\xi$.
  • $\hat{\boldsymbol{w}}_t = \boldsymbol{w}_t \odot \boldsymbol{x}_t / \langle \boldsymbol{w}_t, \boldsymbol{x}_t \rangle$: Price-Adjusted Allocation, the wealth held in each asset at the end of period $t$.
  • $N$: Number of assets.
  • $t$: Period index, counted from one.

This is the paper's equation 14, with one change. The paper measures the turnover from its own last allocation $\hat{\boldsymbol{b}}_t$, and the programme here measures it from the Price-Adjusted Allocation $\hat{\boldsymbol{w}}_t$, the book that the fund holds when it trades. On the simplex $\hat{\boldsymbol{x}}^\intercal \boldsymbol{w}$ and $(\hat{\boldsymbol{x}} - \boldsymbol{1})^\intercal \boldsymbol{w}$ differ by one, so the programme over the forecast return has the same minimiser.

Arguments

  • N: The number of assets, the length of the reference allocation of the fee.
  • window: The paper's $w$, the number of regression pairs of the window. The selector holds window + 1 rows.
  • gamma: The paper's $\gamma$, the risk aversion over the predictive variance.
  • xi: The paper's $\xi$, the rate of the linear turnover fee.
  • slv: The solver of the programme.
  • pe: The prior estimator of the programme, the ensemble by default. Any prior gives the two moments that the programme reads.
  • proj: The geometry of the damped mix. The rule's gamma = 0 does not read it.

Validation

  • N >= 1. A DomainError is thrown otherwise.
  • window >= 2, the fewest pairs whose regressor covariance exists. A DomainError is thrown otherwise.
  • gamma >= 0. A DomainError is thrown otherwise.
  • xi >= 0. A DomainError is thrown otherwise.

Returns

  • alg::FollowTheLeader: The rule over LastRows at W = window + 1, whose opt is the ensemble programme.

Examples

julia> alg = LowDimensionEnsemblePortfolio(; N = 3, slv = Solver(; solver = nothing));julia> alg.selLastRows  W ┴ Int64: 6julia> alg.opt.objMaximumUtility  l ┴ Float64: 0.25julia> alg.opt.opt.fees.tnTurnover      w ┼ Vector{Float64}: [0.3333333333333333, 0.3333333333333333, 0.3333333333333333]    val ┼ Float64: 0.002  fixed ┴ Bool: false

Related

References

  • [110] W. Xi, Z. Li, X. Song and H. Ning. Online portfolio selection with predictive instantaneous risk assessment. Pattern Recognition 144, 109872 (2023). Equation 14, Section 4.2 and Section 5.3.
source
PortfolioOptimisers.FollowTheLeadingHistory — Type
struct FollowTheLeadingHistory{T1<:AbstractOnlinePortfolioSelectionAlgorithm, T2<:Real, T3<:Bool, T4<:(Union{Nothing, var"#s7439"} where var"#s7439"<:BoundedAllocationSet), T5<:EuclideanProjection} <: AbstractOnlinePortfolioSelectionAlgorithm

Mixes copies of one rule started at different periods, with a fixed share for the newest copy (FLH).

This is follow the leading history of Hazan and Seshadhri (2009). A multiplicative update weights the copies by their returns, and at every period a new copy starts with a fixed share of the weight. Under prune the rule keeps a working set of copies of logarithmic size. The paper's experiments use the Online Newton Step as the base rule, which is NewtonStep here, and any rule of the family serves.

A new copy starts at the base rule's own start from the uniform portfolio, projected onto the Allocation Set in the base rule's geometry. So a constant rebalanced base starts at the projection of its own w. The rule reads nothing of a given Start Allocation beyond its first copy, which starts there through project_start. The rule projects the weight vector onto the Expert Set on eset in the entropic geometry, after the share and the pruning. So a cap on eset caps the trust in one copy. The working set changes size, so eset admits a scalar bound alone. The rule projects the blend onto the head's Allocation Set once more in the Euclidean geometry on proj, as an ExpertMixture does, and skips it by type on a BoundedAllocationSet.

Mathematical definition

\[\begin{align} \hat{p}_{t+1, k} &= \frac{p_{t, k}\, r_{t, k}^{\alpha}}{\sum_{j \in S_t} p_{t, j}\, r_{t, j}^{\alpha}}\,, \quad k \in S_t\,, \\ \bar{p}_{t+1, k} &= \begin{cases} \left( 1 - \dfrac{1}{t + 1} \right) \hat{p}_{t+1, k} & k \in S_t\,, \\ \dfrac{1}{t + 1} & k = t + 1\,, \end{cases} \\ p_{t+1, k} &= \frac{\bar{p}_{t+1, k}}{\sum_{j \in S_{t+1}} \bar{p}_{t+1, j}}\,, \quad k \in S_{t+1}\,, \\ \boldsymbol{w}_{t+1} &= \sum_{k \in S_{t+1}} p_{t+1, k}\, \boldsymbol{h}_k(t+1)\,. \end{align}\]

Where:

  • $\boldsymbol{p}_t$: Weight vector over the experts at period $t$, with entries $p_{t,k}$ that sum to one. Here expert $k$ is the copy started at period $k$, and $p_{1, 1} = 1$.
  • $\hat{p}_{t+1, k}$, $\bar{p}_{t+1, k}$: Weights after the multiplicative update, and after the share of the new copy.
  • $\boldsymbol{r}_t$: Expert-return vector of period $t$, with entries $r_{t,k} = \langle \boldsymbol{h}_k(t), \boldsymbol{x}_t \rangle$.
  • $\boldsymbol{h}_k(t)$: Allocation that expert $k$ holds during period $t$.
  • $\boldsymbol{x}_t$: Price relative vector of period $t$, each asset's price over its price one period earlier.
  • $\alpha$: Exponent of the multiplicative update, the alpha field.
  • $S_t$: Working set of period $t$, the start periods of the live copies, with $S_1 = \lbrace 1 \rbrace$.
  • $\boldsymbol{w}_t$: Iterate of the rule at period $t$, the allocation its update reads.
  • $t$: Period index, counted from one.

The factor $r_{t, k}^{\alpha}$ is the paper's $e^{-\alpha f_t}$ under the log-wealth loss $f_t(\boldsymbol{w}) = -\log \langle \boldsymbol{w}, \boldsymbol{x}_t \rangle$, and at $\alpha = 1$ it is the wealth weighting. Without prune, $S_{t+1} = \lbrace 1, \ldots, t + 1 \rbrace$ and the last normalisation divides by one. Under prune, $S_{t+1}$ holds the start periods that are alive at $t + 1$ under the lifetime of expert_alive, which the paper takes from Woodruff. Then $S_t$ holds $O(\log t)$ copies, and for every $s \leq t$ it holds a start period in $[s, (s + t)/2]$.

Suppose that the base rule's regret on every interval $I$ is $\alpha^{-1} \log |I|$, and that every loss is $\alpha$-exp-concave. When the copy started at $r$ lives through $I = [r, s]$, the paper bounds the regret of the rule on $I$ by $O(\alpha^{-1} (\ln r + \ln |I|))$ (Lemma 3.1). Without prune every copy lives, so this bound holds on every interval. Under prune the paper's bound on every interval is $O(\alpha^{-1} \log s \cdot \log |I| + 1)$ (Lemma 3.2).

Algorithm

The steps of the Online Update:

  1. Set t to st.n + 1, and r to the return $\langle \boldsymbol{h}, \boldsymbol{x} \rangle$ of the allocation h of each live copy.
  2. Set phat to st.p .* r .^ alg.alpha, divided by its sum.
  3. Step every live copy with its own Online Update, which gives its Rule State and its allocation for the next period.
  4. Start a new copy at the base rule's start from the uniform portfolio, projected onto set in the base rule's geometry, with the start period t + 1.
  5. Set p to (1 - 1 / (t + 1)) .* phat, followed by the share 1 / (t + 1) of the new copy.
  6. Under alg.prune, keep the copies that expert_alive finds alive at t + 1, with their entries of p.
  7. Project p onto the Expert Set with the entropic projection. On the bare simplex over the copies this divides p by its sum.
  8. Set q to the sum of p[k] .* h over the copies. Return the new carrier, and the result of blend_projection of q onto set with alg.proj, from the Price-Adjusted Allocation.

Fields

  • alg: The base rule every expert is a copy of.
  • alpha: The exponent of the multiplicative update, the paper's $\alpha$. At 1 the update is the wealth weighting.
  • prune: Whether the rule prunes the working set to the paper's streaming set of logarithmic size.
  • eset: The Expert Set onto which the rule projects the weight vector, a scalar bound over the live experts, or nothing for the bare simplex over them.
  • proj: The geometry of the last projection of the blend onto the head's Allocation Set.

Constructors

FollowTheLeadingHistory(;    alg::AbstractOnlinePortfolioSelectionAlgorithm = NewtonStep(),    alpha::Real = 1,    prune::Bool = true,    eset::Option{<:BoundedAllocationSet} = nothing,    proj::EuclideanProjection = EuclideanProjection()) -> FollowTheLeadingHistory

Keywords correspond to the struct's fields.

Validation

  • alpha > 0. A DomainError is thrown otherwise.
  • eset, when given, holds a WeightBounds whose bounds are scalars and no sets: the working set changes size, so a vector bound has no length to match. An ArgumentError is thrown otherwise.

View parameters

When port_opt_view is called on this type, the base rule is viewed and the rest is carried unchanged.

Examples

julia> FollowTheLeadingHistory()FollowTheLeadingHistory    alg ┼ NewtonStep        │    beta ┼ Int64: 1        │   delta ┼ Float64: 0.125        │     eta ┼ Int64: 0        │    proj ┴ EuclideanProjection()  alpha ┼ Int64: 1  prune ┼ Bool: true   eset ┼ nothing   proj ┴ EuclideanProjection()

Related

References

  • [210] E. Hazan and C. Seshadhri. Efficient learning algorithms for changing environments. In: Proceedings of the 26th International Conference on Machine Learning, 393–400 (2009). Algorithm 1, Lemmas 3.1 and 3.2, and Appendix A.
source

References

[64]
Z.-R. Lai, L. Tan, X. Wu and L. Fang. Loss control with rank-one covariance estimate for short-term portfolio optimization. Journal of Machine Learning Research 21, 1–37 (2020).
[110]
W. Xi, Z. Li, X. Song and H. Ning. Online portfolio selection with predictive instantaneous risk assessment. Pattern Recognition 144, 109872 (2023).
[151]
B. Li and S. C. Hoi. Online portfolio selection: A survey. ACM Computing Surveys 46, 1–36 (2014).
[194]
B. Li, S. C. Hoi and V. Gopalkrishnan. CORN: Correlation-driven nonparametric learning approach for portfolio selection. ACM Transactions on Intelligent Systems and Technology 2, 21:1–21:29 (2011).
[200]
A. A. Gaivoronski and F. Stella. Stochastic nonstationary optimization for finding universal portfolios. Annals of Operations Research 100, 165–188 (2000).
[201]
L. Györfi and D. Schäfer. Nonparametric prediction. In: Advances in Learning Theory: Methods, Models and Applications (IOS Press, 2003); pp. 339–354.
[202]
L. Györfi, G. Lugosi and F. Udina. Nonparametric kernel-based sequential investment strategies. Mathematical Finance 16, 337–357 (2006).
[203]
L. Györfi, A. Urbán and I. Vajda. Kernel-based semi-log-optimal empirical portfolio selection strategies. International Journal of Theoretical and Applied Finance 10, 505–516 (2007).
[204]
G. Ottucsák and I. Vajda. An asymptotic analysis of the mean-variance portfolio selection. Statistics & Decisions 25, 63–88 (2007).
[205]
L. Györfi and I. Vajda. Growth optimal investment with transaction costs. In: Algorithmic Learning Theory, Vol. 5254 of Lecture Notes in Computer Science (Springer, 2008); pp. 108–122.
[206]
L. Györfi, F. Udina and H. Walk. Nonparametric nearest neighbor based empirical portfolio selection strategies. Statistics & Decisions 26, 145–157 (2008).
[207]
[208]
M. Khedmati and P. Azin. An online portfolio selection algorithm using clustering approaches and considering transaction costs. Expert Systems with Applications 159, 113546 (2020).
[209]
E. Hazan and S. Kale. An online portfolio selection algorithm with regret logarithmic in price variation. Mathematical Finance 25, 288–310 (2015).
[210]
E. Hazan and C. Seshadhri. Efficient learning algorithms for changing environments. In: Proceedings of the 26th International Conference on Machine Learning (2009); pp. 393–400.