The source files can be found in examples/.
The online walk-forward: one estimator, updated fold by fold
A walk-forward refits every fold from its training window. Fold i uses every row that fold i - 1 used and a few more, fits the moments over all of them, and solves. On an expanding window the cost of the whole run therefore grows with the square of the number of folds, and the moments of fold i are recomputed from scratch when almost all of their input is the input of fold i - 1.
An online walk-forward, built by OnlineIndexWalkForward, fits one estimator on the first training window, adds the new rows of each later fold to it, and computes the weights where a refit would have run. We call the step that adds rows to a fitted estimator an update, and partial_fit! is the function that makes it. The online run gives the weights of the batch expanding-window walk-forward, fold by fold.
The list below says what each part of a run does in an online walk-forward.
- A prior updates its moment estimators with the new rows, and it keeps the rows themselves, because a prior result holds
Xfor the scenario risk measures. - An optimiser passes the new rows to its prior alone. To compute weights, it rebuilds a returns result from the prior's rows and runs the ordinary batch fit, so every constraint, every clustering and every uncertainty set is the one the batch run builds. A set with no prior of its own is calibrated on the prior result the optimiser gives it.
- An optimiser that solves a JuMP problem, such as
MeanRisk, builds a new model each time it computes weights. The solve is the cost of the update, and no model is kept between folds. - The type of the walk-forward declares the update, and the fold loop starts from an estimator with no state.
- A search scores every candidate through the same fold loop, online and batch alike.
- A
Pipelinepasses the update to its steps. A step that works row by row updates, a step that changes the universe takes a view, and a step with no online form throws an error unless the pipeline declares a refit. - A result lets you continue a run.
Resume(res)starts the loop again after the folds the result holds.
A prior with no update formula, such as FactorPrior, goes in Online instead. Online(pe; max_history) keeps a buffer of rows, and the library refits the prior from that buffer each time it computes weights. The cap on the buffer gives a rolling window.
Reach for OnlineIndexWalkForward in place of an expanding walk-forward whose data and estimators the update accepts, because it costs nothing in accuracy. The run gives the weights of the batch run, fold by fold. Sections 2 and 3 show inputs the update refuses. Reach for it for speed when the prior has a CoveragePolicy and the optimiser computes its weights cheaply, as a hierarchical or a naive optimiser does, because there the batch fit itself runs row by row. Reach for it whenever you will continue a run, because the result of an online run resumes over a longer history and a batch result cannot. With a prior that has no CoveragePolicy, through MeanRisk, the update saves no time, and section 9 prints the ratio.
This example runs one walk-forward through each of those estimators, and each section prints the comparison it makes. Section 8 measures the accuracy of the update and its speed on one covariance, and section 9 measures its speed through the walk-forward.
- The panel, a universe that moves inside the window, and the two walk-forwards.
- The online run against the batch expanding run, fold by fold.
- What the loop does, written by hand.
- A prior with no update formula refits from its buffer.
- A capped buffer is the rolling window.
- A search picks the batch candidate.
- A run resumes from its result.
- Speed and accuracy of the moment update.
- The gain through the loop, measured.
- What to take away.
using PortfolioOptimisers, StableRNGs, Statistics, LinearAlgebra, Dates, DataFrames, PrettyTables, Clarabelnumfmt = (v, i, j) -> begin return isa(v, AbstractFloat) ? round(v; sigdigits = 4) : vend;1. The panel, and the two walk-forwards
The data is a small factor panel drawn from a seeded generator, with eight assets, three hundred observations and two factors. Five assets list after the first row, and three delist before the last. The universe therefore moves inside the window, and an online update must follow it. We write the listing calendar out as a fact about the instruments, and the returns are NaN wherever an asset is not listed. The AssetPanel takes the calendar as its active mask. We set the estimation mask to the active one, because the online update takes the active mask alone. Section 2 shows the error that a narrower estimation mask throws.
The function cut keeps the rows i of the returns, of the timestamps and of the panel masks. Sections 3 and 7 use it to cut windows by hand. The last line prints the first and the last listed row of each asset.
function synthetic_panel(; T = 300, N = 8, K = 2, seed = 20260912) rng = StableRNG(seed) F = 0.01 .* randn(rng, T, K) B = randn(rng, N, K) ivol = 0.008 .+ 0.012 .* rand(rng, N) X = F * transpose(B) .+ randn(rng, T, N) .* transpose(ivol) listed = [1, 34, 42, 1, 67, 10, 175, 1] delisted = [T, T, T, 252, T, 291, T, 264] amsk = [listed[i] <= t <= delisted[i] for t in 1:T, i in 1:N] days = filter(d -> Dates.dayofweek(d) <= 5, Date(2015, 1, 1):Day(1):(Date(2015, 1, 1) + Day(2 * T + 10)))[1:T] nx = ["A" * lpad(i, 2, '0') for i in 1:N] pnl = AssetPanel(; amsk = amsk, emsk = copy(amsk)) rd = ReturnsResult(; nx = nx, X = ifelse.(amsk, X, NaN), ts = days, pnl = pnl) rdf = ReturnsResult(; nx = nx, X = rd.X, ts = days, nf = ["F1", "F2"], F = F, pnl = pnl) return rd, rdfendrd, rdf = synthetic_panel()T, N = size(rd.X)amsk = Matrix(rd.pnl.amsk)function cut(rd, i) return ReturnsResult(; nx = rd.nx, X = rd.X[i, :], ts = rd.ts[i], pnl = AssetPanel(; amsk = amsk[i, :], emsk = amsk[i, :]))end[(rd.nx[j], findfirst(amsk[:, j]), findlast(amsk[:, j])) for j in 1:N]8-element Vector{Tuple{String, Int64, Int64}}:
("A01", 1, 300)
("A02", 34, 300)
("A03", 42, 300)
("A04", 1, 252)
("A05", 67, 300)
("A06", 10, 291)
("A07", 175, 300)
("A08", 1, 264)The two walk-forwards enumerate the same folds. The batch one expands its training window, as an online run does anyway, because an update adds rows to the moments and never removes them. OnlineIndexWalkForward therefore sets expand_train = true, and the two schemes cut identical windows. Both purge three rows before each test window. A rolling window is set on the estimator instead, as section 5 shows.
w, t, p = 100, 40, 3batch = IndexWalkForward(w, t; purged_size = p, expand_train = true)online = OnlineIndexWalkForward(w, t; purged_size = p)(; train_idx, test_idx) = split(batch, rd)(train_idx == split(online, rd).train_idx, train_idx, [first(i):last(i) for i in test_idx])(true, UnitRange{Int64}[1:97, 1:137, 1:177, 1:217, 1:257], UnitRange{Int64}[101:140, 141:180, 181:220, 221:260, 261:300])The seventh asset lists at row 175, inside the third training window, and the fourth delists at row 252, inside the fifth. A prior with no CoveragePolicy never admits a late listing over an expanding window from row 1. It needs a finite return at every row of the window, and the window always starts at row 1. The prior below has a CoveragePolicy on both moments. Each asset's mean uses the rows where that asset has a return, each covariance entry uses the rows where both assets have one, and an asset enters the estimate when it lists. Under the policy the online update gives the batch estimate exactly, because the batch fit under the policy runs the same update over the rows. Section 9 returns to that fact.
The clustering of HierarchicalRiskParity reads the returns data, not the prior. The returns data keep the gap of the seventh asset before it lists, so the clustering takes the covariance estimator of the prior, with its policy, and reads the rows where each pair has a return. A clustering with no policy cannot read the gap. The optimiser then leaves the asset out with a warning, although the prior admitted it.
cvg = CoveragePolicy()pe = EmpiricalPrior(; me = SimpleExpectedReturns(; cvg = cvg), ce = PortfolioOptimisersCovariance(; ce = Covariance(; cvg = cvg)))slv = Solver(; name = :clarabel, solver = Clarabel.Optimizer, settings = Dict("verbose" => false, "tol_gap_abs" => 1e-10, "tol_gap_rel" => 1e-10, "tol_feas" => 1e-10), check_sol = (; allow_local = false, allow_almost = false))mr = MeanRisk(; opt = JuMPOptimiser(; pe = pe, slv = slv))cle = ClustersEstimator(; ce = pe.ce)hrp = HierarchicalRiskParity(; opt = HierarchicalOptimiser(; pe = pe, cle = cle))HierarchicalRiskParity
opt ┼ HierarchicalOptimiser
│ pe ┼ EmpiricalPrior
│ │ ce ┼ PortfolioOptimisersCovariance
│ │ │ ce ┼ Covariance
│ │ │ │ me ┼ SimpleExpectedReturns
│ │ │ │ │ w ┴ nothing
│ │ │ │ ce ┼ GeneralCovariance
│ │ │ │ │ ce ┼ SimpleCovariance: SimpleCovariance(true)
│ │ │ │ │ w ┴ nothing
│ │ │ │ alg ┼ FullMoment()
│ │ │ │ w ┼ nothing
│ │ │ │ cvg ┼ CoveragePolicy
│ │ │ │ │ min_coverage ┼ Float64: 0.0
│ │ │ │ │ alg ┼ DecayCoverage()
│ │ │ │ │ peel ┴ MinimalPeel()
│ │ │ 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
│ │ │ cvg ┼ CoveragePolicy
│ │ │ │ min_coverage ┼ Float64: 0.0
│ │ │ │ alg ┼ DecayCoverage()
│ │ │ │ peel ┴ MinimalPeel()
│ │ horizon ┼ nothing
│ │ fill_limit ┼ nothing
│ │ x_src ┴ nothing
│ cle ┼ ClustersEstimator
│ │ ce ┼ PortfolioOptimisersCovariance
│ │ │ ce ┼ Covariance
│ │ │ │ me ┼ SimpleExpectedReturns
│ │ │ │ │ w ┴ nothing
│ │ │ │ ce ┼ GeneralCovariance
│ │ │ │ │ ce ┼ SimpleCovariance: SimpleCovariance(true)
│ │ │ │ │ w ┴ nothing
│ │ │ │ alg ┼ FullMoment()
│ │ │ │ w ┼ nothing
│ │ │ │ cvg ┼ CoveragePolicy
│ │ │ │ │ min_coverage ┼ Float64: 0.0
│ │ │ │ │ alg ┼ DecayCoverage()
│ │ │ │ │ peel ┴ MinimalPeel()
│ │ │ 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)
│ │ de ┼ Distance
│ │ │ power ┼ nothing
│ │ │ alg ┴ CanonicalDistance()
│ │ alg ┼ HClustAlgorithm
│ │ │ linkage ┴ Symbol: :ward
│ │ onc ┼ OptimalNumberClusters
│ │ │ max_k ┼ nothing
│ │ │ alg ┼ SecondOrderDifference
│ │ │ │ alg ┼ StandardisedValue
│ │ │ │ │ mv ┼ MeanValue
│ │ │ │ │ │ w ┴ nothing
│ │ │ │ │ sv ┼ StdValue
│ │ │ │ │ │ w ┼ nothing
│ │ │ │ │ │ corrected ┴ Bool: true
│ │ x_src ┴ nothing
│ slv ┼ nothing
│ wb ┼ WeightBounds
│ │ lb ┼ Float64: 0.0
│ │ ub ┴ Float64: 1.0
│ fees ┼ nothing
│ sets ┼ nothing
│ wf ┼ IterativeWeightFinaliser
│ │ iter ┴ Int64: 100
│ strict ┴ Bool: false
r ┼ Variance
│ settings ┼ RiskMeasureSettings
│ │ scale ┼ Float64: 1.0
│ │ ub ┼ nothing
│ │ rke ┴ Bool: true
│ sigma ┼ nothing
│ chol ┼ nothing
│ rc ┼ nothing
│ alg ┼ SquaredSOCRiskExpr()
│ mtx_sqrt ┼ EigenFallbackSquareRoot()
│ ratio_alg ┼ SquareRootRatio()
│ corner ┴ nothing
sca ┼ nothing
fb ┴ nothing
2. The online run against the batch expanding run, fold by fold
We make the same call to cross_val_predict twice, once under each scheme. The table prints the largest weight difference per fold for MeanRisk, in jump_gap, and for HierarchicalRiskParity, in hierarchical_gap.
b_mr = cross_val_predict(mr, rd, batch)o_mr = cross_val_predict(mr, rd, online)b_hrp = cross_val_predict(hrp, rd, batch)o_hrp = cross_val_predict(hrp, rd, online)weights(res) = [p.res.w for p in res.pred]masks(res) = [p.res.imsk for p in res.pred]count_in(m) = isnothing(m) ? N : count(m)gap(a, b) = [maximum(abs, x - y) for (x, y) in zip(weights(a), weights(b))]fold_df = DataFrame(; fold = 1:length(train_idx), window = string.(train_idx), investable = count_in.(masks(o_mr)), jump_gap = gap(o_mr, b_mr), hierarchical_gap = gap(o_hrp, b_hrp), masks_agree = masks(o_mr) .== masks(b_mr))pretty_table(fold_df; formatters = [numfmt])[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
┌───────┬────────┬────────────┬──────────┬──────────────────┬─────────────┐
│ fold │ window │ investable │ jump_gap │ hierarchical_gap │ masks_agree │
│ Int64 │ String │ Int64 │ Float64 │ Float64 │ Bool │
├───────┼────────┼────────────┼──────────┼──────────────────┼─────────────┤
│ 1 │ 1:97 │ 7 │ 0.0 │ 0.0 │ true │
│ 2 │ 1:137 │ 7 │ 0.0 │ 0.0 │ true │
│ 3 │ 1:177 │ 8 │ 0.0 │ 0.0 │ true │
│ 4 │ 1:217 │ 8 │ 0.0 │ 0.0 │ true │
│ 5 │ 1:257 │ 7 │ 0.0 │ 0.0 │ true │
└───────┴────────┴────────────┴──────────┴──────────────────┴─────────────┘The hierarchical_gap column is zero on every fold, because under the policy the batch fit and the online update compute the same numbers. The jump_gap column is zero here too. In general it sits within the tolerance of the solver, because MeanRisk solves the same problem from the same rows.
Both runs follow the universe as it moves. Seven assets are investable in the first two folds, all eight once the seventh lists, and seven again once the fourth delists. imsk is nothing on a fold where every asset was investable. Only the prior ran online. HierarchicalRiskParity clustered and MeanRisk solved as they do in batch, over a returns result rebuilt from the prior's rows.
The online update takes the active mask of the panel with the rows, and no other part of the panel. A panel whose estimation mask differs from its active mask, or that has time-varying panel fields, throws an error at the warm-up, the first fit on the first training window. The message names the field. The batch walk-forward accepts either kind of panel, because each fold refits over its whole window.
narrow = ReturnsResult(; nx = rd.nx, X = rd.X, ts = rd.ts, pnl = AssetPanel(; amsk = amsk, emsk = amsk .& (rd.X .> -0.03)))try cross_val_predict(mr, narrow, online)catch err showerror(stdout, err)endArgumentError: the carry of `EmpiricalPrior` folds its moments exactly, and the exact folds of the moment layer take an active mask and no estimation mask, so this route cannot honour an estimation universe narrower than the active one. This panel's `emsk` differs from its `amsk` at 30 cell(s). Wrap the prior in `Online` to refit it, which honours the estimation mask, pass the active mask as both, or fit in batch.3. What the loop does, written by hand
The loop calls two functions. partial_fit!(opt, rd) adds the rows of a returns result to the optimiser and solves nothing. optimise(opt) with no data computes the weights from the rows added so far, and solves once. The warm-up uses the first training window, and each later fold adds the rows its window gained since the one before. We write the loop by hand below, and the last line prints the largest difference between our weights and the weights of the loop.
est = partial_fit!(mr, cut(rd, train_idx[1]))hand = [optimise(est).w]for i in 2:length(train_idx) delta = (last(train_idx[i - 1]) + 1):last(train_idx[i]) global est = partial_fit!(est, cut(rd, delta)) push!(hand, optimise(est).w)endmaximum(maximum(abs, a - b) for (a, b) in zip(hand, weights(o_mr)))0.0The loop keeps the state in the cache fields of the estimator, and it starts from an estimator with no state. An estimator that already has a state throws an error at the warm-up that names it, so the estimator you give the walk-forward is always a configuration and never a half-fitted run. A TimeDependent schedule on the prior, or on the optimiser itself, throws at the warm-up for the same reason, because the schedule would replace the estimator that holds the state. A schedule on any other field works as it does in batch, so the weight bounds below tighten as the folds advance, online as in batch.
n = length(train_idx)caps = TimeDependent([WeightBounds(; lb = 0.0, ub = ub) for ub in range(0.4, 0.25, n)])mr_caps = MeanRisk(; opt = JuMPOptimiser(; pe = pe, slv = slv, wb = caps))gap(cross_val_predict(mr_caps, rd, online), cross_val_predict(mr_caps, rd, batch))5-element Vector{Float64}:
0.0
0.0
0.0
0.0
0.04. A prior with no update formula refits from its buffer
A FactorPrior regresses the assets on the factors, and the library has no update formula for a regression. You wrap it in Online instead. Online keeps a buffer of rows in the cache of the prior. Each update appends the new rows to the buffer, with the factor rows beside them, because the regression needs both. To compute weights, the library runs the batch fit of the prior over the buffer. The buffer holds the rows the batch fold uses, so the two runs fit the same sample. We compare the weights of the two MeanRisk runs, one batch and one online.
fp_batch = MeanRisk(; opt = JuMPOptimiser(; pe = FactorPrior(), slv = slv))fp_online = MeanRisk(; opt = JuMPOptimiser(; pe = Online(FactorPrior()), slv = slv))(weights(cross_val_predict(fp_online, rdf, online)) == weights(cross_val_predict(fp_batch, rdf, batch)))trueOnline wraps the estimator in its field, and it does not survive the run. The loop replaces it at the warm-up with the ordinary estimator and a state, and no Online exists after that. An estimator whose parts mix the two kinds updates each part that has an update formula, and refits each other part from the rows it keeps. You therefore write the same estimator for an online run as for a batch run.
5. A capped buffer is the rolling window
An online run only ever grows its history, so the estimator declares a rolling window, not the loop. Online(pe; max_history = w) keeps the last w rows and drops the oldest as each new one arrives. A rolling batch scheme of window w + p with purge p trains over w rows, and the capped online run computes its weights over those same rows. We check the window length and compare the weights and the masks of the two runs.
rolling = IndexWalkForward(w + p, t; purged_size = p)stepped = OnlineIndexWalkForward(w + p, t; purged_size = p)cap(pe) = Online(pe; max_history = w)hrp_cap = HierarchicalRiskParity(; opt = HierarchicalOptimiser(; pe = cap(pe), cle = cle))b_roll = cross_val_predict(hrp, rd, rolling)o_roll = cross_val_predict(hrp_cap, rd, stepped)(all(length.(split(rolling, rd).train_idx) .== w), weights(o_roll) == weights(b_roll), masks(o_roll) == masks(b_roll))(true, true, true)A cap on a prior that updates its moments does something else. max_scenarios on a prior bounds the rows its result keeps for the scenario risk measures, and it leaves the moments fitted over every observation. A prior capped that way therefore matches no batch fit. max_history on Online limits the whole fit to a window, and it has a batch equal, which is the comparison above. You can set both, and they nest.
6. A search picks the batch candidate
A search scores every candidate through the same fold loop, whatever the fit. The grid tunes the weight bounds, which bind and so separate the candidates. We compare the two score matrices and the column each search picked.
r = ConditionalValueatRisk()grid = ["opt.wb" => [WeightBounds(; lb = 0.0, ub = 1.0), WeightBounds(; lb = 0.0, ub = 0.2), WeightBounds(; lb = 0.1, ub = 1.0)]]gs(cv) = GridSearchCrossValidation(grid; cv = cv, r = r, train_score = true)s_b = search_cross_validation(hrp, gs(batch), rd)s_o = search_cross_validation(hrp, gs(online), rd)(s_o.test_scores == s_b.test_scores, s_o.train_scores == s_b.train_scores, s_o.idx == s_b.idx, s_o.val_grid[s_o.idx])(true, true, true, (WeightBounds
lb ┼ Float64: 0.0
ub ┴ Float64: 1.0
,))Under an online scheme the folds run in sequence whatever executor the search is given, because fold i starts from the state that fold i - 1 left. The candidates are what gains from threads, and the ex of GridSearchCrossValidation applies to them.
RandomisedSearchCrossValidation takes an online scheme too, because it samples a grid from the search space and runs a GridSearchCrossValidation over it.
7. A run resumes from its result
The MultiPeriodPredictionResult of an online run holds the estimator in opt, as it stood at the end of the last training window. When more rows arrive, Resume gives that result back to the loop with the full history and the same scheme. The loop skips the folds the result holds, adds the rows between the last training end and the new end to a copy of the state, and continues from the next fold. The resumed result holds the new folds alone, and vcat stacks the two.
We compare the stack with the run over the full history at once. The loop finds the fold to resume from by the last timestamp the state holds, so a run that resumes needs timestamps, and the panel has dates. The first run gets the first 260 rows, and the resumed run gets all 300.
short = cut(rd, 1:260)res_1 = cross_val_predict(hrp, short, online)res_2 = cross_val_predict(Resume(res_1), rd, online)stacked = vcat(res_1, res_2)(length(res_1.pred), length(res_2.pred), maximum(gap(stacked, o_hrp)), stacked.mrd.X == o_hrp.mrd.X)(4, 1, 0.0, true)Resume copies every state when it starts, so it never writes to res_1, and one result resumes any number of times. To deploy a resumed state, you update it by hand from the last training end with the value form. partial_fit(res.opt, rows) updates a copy of every state and leaves res resumable. The form with a bang, partial_fit!, writes the held timestamps in place, and Resume(res) then refuses the result, so use it on an estimator you keep and will not resume. The result keeps the state at the end of the last training window. The library does not update it through the purge and test rows, because such a state matches no fold of any run, and an update cannot be taken back.
8. Speed and accuracy of the moment update
Everything above uses partial_fit! on the moments. One row updates a covariance in O(N²). A refit over a window of m rows costs O(m · N²), so its cost grows with the window. The update is also more accurate, and this section measures both.
The update is a Welford recursion, and Welford is not the textbook one-pass formula (Σ xxᵀ − n μμᵀ) / (n − 1). On a level series such as the one below, with a mean near a thousand and a spread near one, the textbook formula subtracts two large numbers and loses most of its digits. The recursion updates around the running mean and loses none. You meet that case as soon as you update with a level, such as a price, rather than a change. The batch estimator centres the rows before it multiplies them, so it avoids that subtraction. We take it as the reference, and the cell prints the largest entrywise difference between it and each of the two formulas.
rng = StableRNG(987654321)Z = randn(rng, 50, 4) .+ 1000.0fold(est, rows) = foldl(partial_fit!, eachrow(rows); init = est)function textbook(Z) return (transpose(Z) * Z - size(Z, 1) * mean(Z; dims = 1)' * mean(Z; dims = 1)) / (size(Z, 1) - 1)endexact = cov(Covariance(), Z)(maximum(abs, cov(fold(Covariance(), Z)) - exact), maximum(abs, textbook(Z) - exact))(4.907185768843192e-14, 4.72346398106005e-10)The update sits at the rounding floor of the exact answer, and the textbook formula sits several orders of magnitude above it on fifty rows. The gap widens with the level and with the sample.
The update is faster as well. The cost of one update does not grow with the window, and the cost of a refit does. We print the cost of one refit over the cost of one updated row, timed on a sample of the panel's size with no gaps.
Xs = randn(rng, T, N) ./ 100step_cost = let est = fold(Covariance(), Xs[1:(end - 1), :]), row = Xs[end, :] minimum(@elapsed(partial_fit!(est, row)) for _ in 1:200)endrefit_cost = minimum(@elapsed(cov(Covariance(), Xs)) for _ in 1:200)round(refit_cost / step_cost; digits = 1)60.59. The gain through the loop, measured
That ratio is for the moments alone, not for the loop. In the fold loop a fold costs the moment update plus the cost of computing the weights, and that second cost decides whether the update saves time. Two things decide it, and the table below measures each one on this panel. Each number is the minimum of three runs after a warm one, so read it as a direction and not as a benchmark.
The prior comes first. Without a CoveragePolicy, the batch covariance is one BLAS product over the window. The product is cheap, and the bookkeeping of the loop costs what the product saves, so the rows labelled plain show no gain. With a CoveragePolicy, the batch fit itself runs the update row by row, because each entry uses its own rows. There the online loop does that arithmetic once instead of once per fold, and that is where the gain comes from.
The optimiser comes second. HierarchicalRiskParity computes its weights with a clustering over the moments, so its fold costs the moment fit, and the gain shows. MeanRisk computes its weights with a solve, which the update does not change, so its ratio sits near one on this panel.
function ratio(opt) cross_val_predict(opt, rd, batch) cross_val_predict(opt, rd, online) tb = minimum(@elapsed(cross_val_predict(opt, rd, batch)) for _ in 1:3) to = minimum(@elapsed(cross_val_predict(opt, rd, online)) for _ in 1:3) return to / tbendplain = EmpiricalPrior()gain_df = DataFrame(; prior = ["plain", "plain", "policy", "policy"], head = ["hierarchical", "JuMP", "hierarchical", "JuMP"], online_over_batch = [ratio(HierarchicalRiskParity(; opt = HierarchicalOptimiser(; pe = plain))), ratio(MeanRisk(; opt = JuMPOptimiser(; pe = plain, slv = slv))), ratio(hrp), ratio(mr)])pretty_table(gain_df; formatters = [numfmt])[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 5 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 6 asset(s) left the investable universe and are excluded from this optimisation: ["A02", "A03", "A04", "A05", "A06", "A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A08"] carry a non-finite return at 36 held (observation, asset) pair(s), the first at observation 5. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A07"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A04"] carry a non-finite return at 8 held (observation, asset) pair(s), the first at observation 33. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
[ Info: 1 asset(s) left the investable universe and are excluded from this optimisation: ["A04"]. A constraint, bound or rate stated for one of them is dropped, and a liquidation charge is priced over them.
┌ Warning: a portfolio cannot earn a return an asset did not have. Assets ["A06", "A08"] carry a non-finite return at 45 held (observation, asset) pair(s), the first at observation 32. Those pairs contribute zero, so the weight of a missing asset sits in cash on that observation and the series understates the portfolio by whatever it would have earned. Pass `strict = true` to refuse instead, zero the weights over the observations the asset is inactive, or pass a weight history.
└ @ PortfolioOptimisers ~/work/PortfolioOptimisers.jl/PortfolioOptimisers.jl/src/01_Base/06_Messages.jl:278
┌────────┬──────────────┬───────────────────┐
│ prior │ head │ online_over_batch │
│ String │ String │ Float64 │
├────────┼──────────────┼───────────────────┤
│ plain │ hierarchical │ 1.434 │
│ plain │ JuMP │ 1.067 │
│ policy │ hierarchical │ 0.6639 │
│ policy │ JuMP │ 1.006 │
└────────┴──────────────┴───────────────────┘With a prior that has no CoveragePolicy, reach for the update for the accuracy of section 8 and for the resume of section 7, not for the speed.
10. What to take away
OnlineIndexWalkForward(w, t)is the whole declaration. It sets the expanding window, and a rolling window isOnline(pe; max_history = w)on the prior.- The online run gives the weights of the batch expanding run, fold by fold. Through
HierarchicalRiskParitythe numbers are the same, and throughMeanRiskthey sit within the tolerance of the solver. Above the prior, both runs compute the weights with the same batch code, over a returns result rebuilt from the prior's rows. - A prior with no update formula, such as
FactorPrior, goes inOnlineand is refitted from the rows it keeps, so you write the same estimator for both runs. - A search scores through the same loop whatever the fit. A result resumes a run over a longer history. A
Pipelinepasses the update to its steps. - The update is a Welford recursion, and it keeps its digits on a level series where the textbook formula does not. It saves time through the loop where the batch fit itself runs row by row, as with a
CoveragePolicythroughHierarchicalRiskParity. It saves none with a prior that has noCoveragePolicy, whose batch fit is one product.
This page was generated using Literate.jl.