Migration guide

This page lists every change that can break code written against an earlier release, and the code to write instead. Each version has its own section. Read the section for the version you upgrade from, and every section after it.

From v0.30 to v0.31

v0.31 is a large release. The changes fall into seven groups, and most code needs at most the first three.

  1. Names that were removed, and what replaces each.
  2. Loading prices. prices_to_returns now converts prices and nothing else. Joining, filling and filtering are separate steps.
  3. Asset features. An asset panel, one object that holds every feature of every asset, replaces the feature matrix Z.
  4. Fees. The fixed fees are charged once per holding period, and calc_fees returns a pair.
  5. Renamed keywords and changed defaults.
  6. Calls that now raise an error where they used to return a value.
  7. Results that move. These are the configurations whose numbers differ from v0.30, and the reason for each.

Two more sections cover code that extends the library with its own estimators, and links into the documentation.

v0.31 supports Julia 1.11, 1.12 and 1.13.

Names that were removed

RemovedWrite instead
Imputer, ImputerResult, and the Impute extensionPriceGapFill(; fill = CarriedPrice()) on prices, or MissingDataFilter to drop rather than fill. See Loading prices.
FeaturePriorNothing wraps the prior any more. Put the features on the returns as an asset panel, and select them on the distance. See Asset features.
RegressionFeaturesFeatureDistance(; ape = RegressionPanel())
PhylogenyFeaturesFeatureDistance(; ape = PhylogenyPanel(; pl, alg))
AssetSetsFeatures, asset_sets_features, asset_sets_feature_names, resolve_feature_valuepanel_input(sets, key) builds the input of one panel field from a UniverseSets key, and asset_panel(inputs) builds the panel.
ScaleA graded classification is a TensorPanelInput with its own labels.
MuEllipsoidalUncertaintySet, SigmaEllipsoidalUncertaintySetMuUncertaintySetClass, SigmaUncertaintySetClass. These are the same tags, renamed because they now also class the norm-ball sets.
The nz and Z keywords of prices_to_returns, ReturnsResult and PricesResult, and the Z field of LowOrderPriorThe pnl keyword, an AssetPanel.
The z_src keyword of JuMPOptimiser, HierarchicalOptimiser, NestedClustered and every optimiser that took itGone. Features reach a distance through the panel on the returns, or through FeatureDistance(; ape).
The zkey keyword and field of UniverseSetsGone. A classification enters through panel_input.
feature_matrix(ze, pr, X, F, sets)feature_matrix(pnl) and feature_matrix(pnl, sel) stack an asset panel, and feature_labels names the columns.
calc_fees(w, p, …), calc_asset_fees(w, p, …) and the other fee methods that take pricesThe finite allocation charges its fees inside its own model, on the shares it buys. Read them from DiscreteAllocationResult.fees or GreedyAllocationResult.fees.

Loading prices

prices_to_returns used to do five jobs with one keyword list: join the factor and benchmark tables onto the assets, collapse to a lower frequency, impute or delete gaps, apply a function, and compute returns. It now computes returns, and each of the other jobs is a named step you compose. The keywords that remain are ret_method and padding, plus a new gap_return_alg.

In v0.30:

rd = prices_to_returns(X, F; B = B, iv = iv, ivpa = ivpa,                       join_method = :outer, collapse_args = (week, last),                       missing_col_percent = 0.9, missing_row_percent = 0.9,                       impute_method = Impute.Interpolate(), map_func = f)

In v0.31:

pr = price_ingestion(PriceIngestion(; join_method = :outer, collapse_args = (week, last)), X;                     F = F, B = B, iv = iv, ivpa = ivpa)#! Keep one of the next two lines: the first drops the assets and rows with too many gaps, the second fills the gaps.mdf = fit_preprocessing(MissingDataFilter(; col_thr = 0.9, row_thr = 0.9), pr)mdf = fit_preprocessing(PriceGapFill(; fill = CarriedPrice()), pr)rd = prices_to_returns(apply_preprocessing(mdf, pr))

The one-line form prices_to_returns(X; kwargs...) still works. It ingests the prices with the default PriceIngestion() and passes kwargs to the conversion. The factor, benchmark and implied-volatility tables now go through price_ingestion.

These are the changes to the conversion, and what each one does to a result.

  • Gaps are no longer deleted. An asset that lists late, delists, or is suspended stays in the table, with NaN where it had no price. The ReturnsResult holds an AssetPanel whose two masks say which assets are in the universe at each date, and which of them can be estimated. Every optimiser reads those masks, fits on the assets it can trade, and gives the other assets a weight of exactly zero. So a walk-forward over such a table runs each fold on the assets listed in that fold. v0.30 either dropped the asset from the whole run, or held it after it delisted. On a table with no gaps, nothing changes.
  • The join is :left by default, where it was :outer. A factor or benchmark table with more dates than the assets no longer adds dates to the observations. The ingestion pads it onto the asset dates and reports the padding. Pass PriceIngestion(; join_method = :outer) for the old dates.
  • missing_row_percent = nothing has no counterpart. It kept the columns whose count of missing rows equalled the most common count. MissingDataFilter(; col_thr = 0.0) states the condition that it approximated.
  • map_func has no counterpart. Apply the function to the TimeArray before the ingestion.
  • nan_to_missing is gone, because the ingestion writes every missing price as NaN.
  • A price of Inf raises an error at the ingestion. In v0.30 it reached the conversion and gave a -100 % return.
  • A column name that two tables share, or that a table shares with the timestamp column, raises an error. v0.30 matched such columns by position.

If you build a PricesResult or a ReturnsResult by hand, the pnl keyword replaces the nz and Z keywords. PricesResult also gains span, a Boolean matrix that says which assets are listed at each observation, and the conversion reads it.

Asset features

In v0.30 a feature reached a clustering optimiser as a matrix Z and its labels nz, stored on the returns. The z_src keyword of the optimiser chose between the data and a FeaturePrior that made the features. One object replaces all of that. The asset panel is stored on the returns as rd.pnl, and it holds each feature as a named field. A field is numeric, categorical, or a tensor with its own labels.

In v0.30:

rd  = prices_to_returns(X; nz = ["nx_sector"], Z = Z)pe  = FeaturePrior(; pe = EmpiricalPrior(), ze = AssetSetsFeatures(; vals = ["nx_sector"]),                   sets = sets)opt = HierarchicalOptimiser(; pe = pe, cle = ClustersEstimator(; de = FeatureDistance()),                            z_src = :prior)

In v0.31:

rd  = ReturnsResult(; nx = rd.nx, X = rd.X, ts = rd.ts,                    pnl = asset_panel([panel_input(sets, "nx_sector")]))opt = HierarchicalOptimiser(; pe = EmpiricalPrior(),                            cle = ClustersEstimator(; de = FeatureDistance(; sel = ["sector"])))

The name of a field built from UniverseSets is the key without its prefix, so "nx_sector" becomes "sector". A numeric feature that you hold as a vector or a matrix is a NumericPanelInput(; name, vals). A graded classification with its own column labels is a TensorPanelInput(; name, vals, axis, labels).

  • FeatureDistance() with no sel stacks every field of the panel. sel takes field names, name => [levels], name => level or name => :observed. It no longer takes an integer column index, so sel = [3] becomes the name of the column.
  • The ape keyword replaces the two feature producers. FeatureDistance(; ape = RegressionPanel()) clusters on the factor loadings of the prior's regression. FeatureDistance(; ape = PhylogenyPanel(; pl, alg)) clusters on a phylogeny that PhylogenyPanel builds when the distance is computed.
  • A blank in a feature is missing, nothing or NaN. The field's fill policy fills it, so no blank reaches the code that reads the panel. The policies are NoPanelFill, ConstantPanelFill, ForwardPanelFill and BackwardPanelFill. The fill policy of a categorical field must name a level. CategoricalPanelInput(; alg = ForwardPanelFill()) without a value raises an error. The table of calls that now raise gives the v0.30 behaviour.
  • feature_matrix(pnl) stacks a panel, and feature_labels(pnl) names its columns. The labels are also a selector, so feature_matrix(pnl, feature_labels(pnl)) builds the same matrix again.

Fees

v0.31 changes when each fee is charged. The proportional fees l and s and the turnover fee tn are charged on every observation. The fixed fees fl and fs are charged once for the holding period. v0.30 charged the fixed fees on every observation and the turnover fee once, so a fold of T rows paid a fixed fee T times. Any backtest with a fixed fee reports a different net return.

  • calc_fees(w, fees) is now calc_fees(w, T, fees), and it returns the pair (periodic, one_off). The one number that a caller used to read is calc_total_fees(w, T, fees), the cost of the whole holding period. calc_total_asset_fees gives the same cost per asset. On one observation, calc_total_fees(w, 1, fees) gives the old sum when fees.fa is nothing.
  • Fees(; fa = AmortisedFees()) spreads the one-off charge over the period instead. FirstObservationFees() and nothing charge it on the first observation. A cross-validation scheme's own fa overrides the fee's fa on each fold's return series.
  • Fees and FeesEstimator gain lq and flq, a proportional and a fixed charge on the position of an asset that leaves the universe during a fold. Each one is a Turnover stated over the full universe. A walk-forward over a delisting reports a return that is lower by the liquidation charge of each exit.
  • The finite allocations, DiscreteAllocation and GreedyAllocation, price their fees on the shares they buy, inside their own models. The calc_fees(w, p, …) methods that took prices are deleted, and the fees field of the result holds the charge.

Renamed keywords and changed defaults

Wherev0.30v0.31
UniverseSetsfkey, ufkeytfkey, utfkey (time-series factors). cfkey, ucfkey (cross-sectional factors) and nikey (assets that left the universe) are new. The default key strings are unchanged, so a dict built for v0.30 still resolves.
ConditionalValueatRiskRange and every other …Range measurebeta = 0.05 regardless of alphabeta = alpha. A call that states alpha and not beta now gets a symmetric range. State both to keep the old measure.
RelativisticValueatRiskRangekappa_b = 0.3kappa_b = kappa_a, likewise.
RegimeAdjustedExpWeightedVarianceregime_lohi_mult = (0.7, 1.6), but the clamp never ranregime_lohi_mult = nothing. An estimator built with the defaults returns the same variance. A caller who set the bounds now gets the clamp they asked for, and a different variance.
RegimeAdjustedExpWeightedVarianceA covariance estimatorA variance estimator, with std. You can still pass it to every ve keyword. A call of cov or cor on it throws a MethodError, and RegimeAdjustedExpWeightedCovariance is the covariance form.
PriceIngestion (was prices_to_returns)join_method = :outerjoin_method = :left
ResourceLimitsNo such keywordmax_ep_grid = 10_000 caps the K of a grid entropy-pooling view. A larger K raises an error at construction.
PrintingA field holding nothing printed as w ┴ nothingThe field is hidden. PortfolioOptimisers.set_show_nothing_fields!(true) restores it.
PredictionReturnsResultiv, ivpa documented as "investment vehicle"Documented as implied volatility. The fields did not change.

Calls that now raise

In v0.30 each of these calls returned a value that did not follow the configuration. In v0.31 each call raises an error that names the cause and, where one exists, the fix, or it does what the table says.

Callv0.30v0.31
A moment estimator (cov, mean, …) on a sample that contains NaNSome estimators passed the NaN into the result, some raised an error from inside LAPACK, and GerberIQCovariance spread it into the other assetsAn IsNonFiniteError that gives the count and the first position of the non-finite entries. Use an estimator of the exponentially weighted family (ExpWeightedExpectedReturns, ExpWeightedVariance, ExpWeightedCovariance), which handles a masked sample. You can also put a CoveragePolicy on the estimator, or let the prior fit on the assets that have a price at every row of the window, which is the default.
A bound vector shorter than the universe on WeightBoundsAssets past the end were unboundedDimensionMismatch
WeightBounds(; lb = Inf) or (; ub = -Inf)The infinite bound became the free bound of its side, so the tightest bound became the loosestThe bound keeps the value you give it.
risk_budget_constraints with a vector for the :rkb targetAcceptedMethodError. The target takes a scalar.
JuMPOptimiser with an empty l2, lp or lpc vectorSilent no-opArgumentError
ShrunkExpectedReturns on a degenerate sampleNaN, or a wrong-signed coefficientDomainError
SmythBrobyCovariance with a negative severity exponentAcceptedDomainError
A dimension-reduction regression whose maxoutdim equals the factor countA bare LAPACK error from inside the fitDomainError naming maxoutdim and the factor count
A Black-Litterman view set in which no name resolves, under strict = falseFieldErrorAn IsNothingError that names the universe and the strict keyword
An entropy-pooling covariance or correlation view that names an unknown asset, under strict = falseRaised an error whose message named an empty equationThe view drops the row and reports it, as the linear views already did
CategoricalPanelInput(; alg = ForwardPanelFill())Made up a level "0.0"ArgumentError. Name the level.
A walk-forward with test_size = 0Ran foreverArgumentError
A hyperparameter search key on a Pipeline that does not start with stepsSilently matched nothingArgumentError
A calibration rule that reads the sample length under a dynamic observation weightMethodErrorObservationWeightsError
A price of Inf, or a column name that two price tables shareA -100 % return for the price, and a match by position for the nameDomainError for the price, and ArgumentError for the name
A predict on a fold that still holds an asset with a missing returnThe NaN propagatedThe weight of that asset goes to cash for that row, and the fold warns once. strict = true on the scheme makes it an ArgumentError.

Results that move

A result from v0.30 is approximate where a correction moved a number, and wrong where the old answer did not follow the configuration. Recompute any of the following.

These results were wrong in v0.30:

  • AugmentedBlackLittermanPrior in any configuration, because the prior added the regression intercept twice. FactorBlackLittermanPrior and AugmentedBlackLittermanPrior with a non-zero rf are approximate.
  • An entropy-pooling value-at-risk view whose coefficient is not one selected the wrong tail. A view with a target of 0 was dropped with no warning. OptimEntropyPooling ignored a sc1 other than the default.
  • WeightBounds with an infinite scalar bound, or a vector bound shorter than the universe (now an error, see the table above).
  • A weighted pipeline holding ImpliedVolatilityRegression computed the realised volatility unweighted.
  • A hyperparameter search over "opti[1].opt.l2". The penalty never entered the model, and the search reported success.
  • The effective-asset norm ceiling at any p != 2. The ceiling was weaker than asked.
  • distance_wei, the private shortest-path function of DBHT, returned a wrong edge count for each path in B, its second output. DBHT uses only the path lengths, and this defect moved no cluster. Three more DBHT defects moved clusters on a tie and on a repeated call.
  • A KFold run through the Pipeline passed the weights of the previous fold to the next fold, where a run of the optimiser alone did not. FeesEstimator.tn passed the turnover through unchanged, so every fold charged the turnover fee against old reference weights.
  • MultipleRandomised with a seed draws different subsets, because it now draws from the assets listed in each window.

These results were approximate in v0.30:

  • A moment estimator with observation weights (SimpleVariance, Covariance, Coskewness, Cokurtosis) now weights its centre as well as its spread.
  • A co-movement matrix of the Gerber or Smyth-Broby kind has a diagonal of ones, and a return of exactly zero at a zero band edge is neutral rather than a crossing.
  • GerberIQCovariance under Gerber2 now reads the bound for each pair.
  • The library widens a histogram edge by one ulp rather than by eps. So mutual information, and every caller of calc_hist_data on standardised data, prices or levels, moves in the last digits.
  • cor on an implied-volatility estimator, collapse_features with MedianCollapse over a narrow element type, and the output element type of pre_order with a custom traversal strategy.
  • A weighted RelativisticValueatRisk, its range, and the two relativistic drawdown measures.
  • A Fees resolved from a FeesEstimator carrying a non-default kwargs.
  • An upper-bound GridRelativisticValueatRiskView.
  • An EntropyPoolingPrior over a FactorPrior with a StepwiseRegression. The nested prior now fits first, so it selects the same factors as the FactorPrior alone.
  • Every backtest with a fixed fee, a turnover fee, or a delisting. See Fees.
  • A walk-forward search (GridSearchCrossValidation, RandomisedSearchCrossValidation) over an optimiser with a TimeDependent schedule, or with a Turnover, tracking or fee term that reads the previous weights. The search now scores each candidate with one run of its folds in order, and no longer fits each fold on its own.
  • A walk-forward in which a fold failed and a later fold read the previous weights. The later fold now reads the last solved fold's weights instead of raising an error.

These results keep their numbers, but their meaning changed:

  • The Max and log-sum-exp scalarisers put an upper bound on model[:risk], so model[:risk] is not the aggregate. Read the exact value with expected_risk.
  • The order-p effective number of assets behind an lpc ceiling is (sum_i |w_i|^p)^(1/(1 - p)), where v0.30 used 1 / sum_i |w_i|^p. To ask for at least m such assets, set val = m^(1/p - 1), not m^(-1/p).
  • res.fb on an optimisation result holds the fallbacks that failed before the answer, as (estimator, result) pairs. In v0.30 it was always nothing.
  • Every optimisation result has imsk, the assets it was allowed to trade. On a table with no gaps it is all true.

If you extend the library

  • A prior estimator's method on a returns matrix takes the asset panel as its third positional argument. The signature is prior(pe, X, F = nothing, pnl = nothing; kwargs...). When you pass a ReturnsResult, the library calls this method with all three arguments. A method that takes only two arguments raises a MethodError. Give it a third argument, even one it ignores.
  • An uncertainty-set estimator for which reads_prior_result returns true receives an rd keyword, which it can ignore.
  • LowOrderPrior.rr now takes an AbstractLoadingsRegressionResult. A regression result that is an AbstractRegressionResult but not a loadings result raises a MethodError when you store it there.
  • Regression gains a fourth field, esigma, the idiosyncratic variances, when the regression is fitted with rsd = true. Code that constructs or compares it by position must handle the extra field.
  • SubsetResamplingResult, NestedClusteredResult and StackingResult have imsk before fb. Keyword construction is unaffected.
  • Weight bounds are validated against the stated asset count with DimensionMismatch, so a constraint generator outside the library that relied on truncation now raises an error.

Links into the documentation

The API pages follow the new source layout, and each source file has a public page under public_api/ and a private page under private_api/. The build writes no page under api/, and a bookmark into api/24_Plotting, api/25_Aliases, api/19_RiskMeasures or api/20_Optimisation on the stable site finds no page. The public pages are now public_api/22_Plotting, public_api/23_Aliases, and the directories public_api/16_RiskMeasures and public_api/17_Optimisation. Find a page from the API introduction rather than by its number.

From v0.31 to v0.32

v0.32 adds the online portfolio selection family. It also removes OnlineStep, the ff keyword, the ddof keyword of LInfNorm, the dims keyword of every call on a ReturnsResult or a prior result, and some unexported functions. It gives the naive optimisers a fees field and adds fields to some results. The rank statistics give a tie its mean rank. Some calls that ran in v0.31 now raise an error, some calls that raised now answer, and the results in Results that move change.

Names that were removed

RemovedWrite instead
OnlineStep, and the ff keyword of IndexWalkForward and DateWalkForwardThe online step is a scheme wrapped in Online, and each scheme has its own constructor. OnlineIndexWalkForward(train_size, test_size; …) and OnlineDateWalkForward(train_size, test_size; …) take every keyword of the plain scheme except expand_train, which an online run sets. IndexWalkForward(60, 1; ff = OnlineStep()) becomes OnlineIndexWalkForward(60, 1). An Online(cv) that you write by hand on a scheme raises an error that names the three constructors.
The derived expand_train, which was nothing on the two walk-forwardsexpand_train is a plain Bool keyword again, false by default, as in v0.30.
fold_fit, cv_online_info, cv_resume_info (unexported)Nothing replaces them. The fold loop reads the type of the scheme to decide whether it steps online.
The ddof keyword and field of LInfNormLInfNorm(). The largest single-period difference carries no degrees of freedom, so the norm is not scaled. LInfNorm(; ddof = 1) raises a MethodError.
The dims keyword of optimise on every optimiser, of prior, ucs, mu_ucs and sigma_ucs on a ReturnsResult, and of clusterise, phylogeny_matrix, phylogeny_constraints, centrality_vector, average_centrality, asset_phylogeny, centrality_constraints, plot_dendrogram and plot_clusters on a prior resultNothing. A ReturnsResult and a prior result hold the observations along the rows, so dims = 1 is the one correct value. These calls ignore a dims that you pass. A method that takes a matrix keeps dims.
find_complete_indices (unexported)CompleteAssetSelector keeps the assets with no gap, and MissingDataFilter drops rows and columns. The function counted a column with an Inf as complete.
assert_returns_result_dims (unexported)Nothing replaces it, because no call takes dims on a ReturnsResult.
has_X, get_X, has_Xap1, get_Xap1, has_ddap1, get_ddap1, has_dd, get_dd and set_asset_neg_returns_plus_one! (unexported)Keep the value that the builder of the entry returns. For the negated returns, pass -X to set_asset_returns_plus_one! under a prefix of your own. No code in the library called these functions.

Renamed keywords and changed defaults

  • The naive optimisers charge fees. EqualWeighted, InverseVolatility, RandomWeighted and PreviousWeights take fees, and NaiveOptimisationResult stores it. The keyword constructor does not change. The positional constructor of NaiveOptimisationResult takes fees as its third argument, NaiveOptimisationResult(pr, wb, fees, retcode, w, imsk, fb).
  • PerformanceSummaryResult has four more fields, excess_ret, tracking_error, information_ratio and turnover, so its positional constructor takes sixteen arguments. performance_summary takes a benchmark and fills the first three. Without a benchmark they are NaN, and turnover is nothing unless the result holds the path of the weights.
  • plot_performance_summary is one method over an array, an OptimisationResult or a prediction result, with benchmark as a keyword. v0.31 had six methods with different numbers of arguments. Every call written against v0.31 still works.
  • The opt argument of the risk-measure builders is a RiskConstraintOwner, which is a JuMP optimiser or a ProgrammeAllocationSet. Every method keeps its argument list, and a method that you added under the old type bound still dispatches.
  • LpNorm defaults to ddof = 1, where v0.31 used 0. So LpNorm(; p = 2) equals L2Norm(). At T = 252 the factor of LpNorm() is 251^(1/3), not 252^(1/3). State ddof = 0 to keep the v0.31 error. L1Norm gains a ddof keyword whose default 0 keeps the v0.31 factor T.
  • GridEntropicValueatRiskView and GridRelativisticValueatRiskView take M = 1, where v0.31 used 10. M now multiplies the smallest constant that releases each row, so it must be at least 1.
  • An upper bound over several assets on an EVaR or RLVaR view, and an equality below the prior value, take the sequential formulation when alg = nothing. v0.31 sent them to the grid, which holds one asset, so the view raised an ArgumentError. A group lower bound stays conic.
  • plot_histogram(…; reference = true) draws the pdf of the Normal fitted to the returns, and reference = false draws no curve. v0.31 drew a kernel density under the label "Normal" for true, and the Normal for false.
  • plot_factor_risk_contribution names its last bar "Off-factor", where v0.31 named it "Constant". The factor names apply only when they count the columns of the loadings. Otherwise the bars are numbered.
  • plot_performance_summary draws four more bars: the excess return, the tracking error, the information ratio and the turnover.
  • The rank statistics give a tie its mean rank. forecast_evaluation, exposure_ic, exposure_ic_summary, idio_vol_ic and idio_vol_residual_dependence take ties = :average by default, and forecast_ic, forecast_factor_correlation and the :rank book of forecast_portfolio read the ties of the evaluation. v0.31 ranked a tie by the order of the assets, so a constant forecast scored a Spearman coefficient of 1 or -1. State ties = :ordinal to keep the v0.31 numbers.
  • covariance_forecast_compare caps its default lags at the number of steps less one. So a run with fewer steps than the horizon no longer refuses its own default.
  • A finite allocation below a unit budget splits the cash by the new collateral algorithm, ProceedsCollateral by default. See Results that move.
  • The keyword N of the plots that keep the largest assets counts the effective number of assets from the shares of the magnitudes. So the count no longer changes when you scale the weights.

Calls that now raise

In v0.31 each of these calls returned a value that did not follow the configuration, or raised an error that did not name the cause. In v0.32 each call raises an error that names the cause.

Callv0.31v0.32
cross_val_predict on HierarchicalRiskParity, HierarchicalEqualRiskContribution or SchurComplementHierarchicalRiskParity whose opt.pe is a prior resultEvery fold used the prior of the full sample, so each fold read its own test rows. Under KFold all five folds gave the same weights.ArgumentError. Give an estimator, such as EmpiricalPrior(), so each fold fits its own prior.
search_cross_validation on an optimiser whose prior is a prior result, or a grid that writes oneThe search scored every candidate on the prior of the full sampleArgumentError, before any candidate is scored
A TimeDependent schedule whose entries or default hold a prior result, in the fold loopAccepted, and every fold read the full-sample priorArgumentError. A callable schedule still runs.
A walk-forward on a Frontier sweep with a term that reads the previous weights, such as Turnover(; w)Ran, and charged every fold against the stated w, because no one portfolio of the sweep is the previous oneArgumentError. A fixed = true turnover still runs.
GridEntropicValueatRiskView(; M) or GridRelativisticValueatRiskView(; M) with M < 1AcceptedDomainError
ExpWeightedExpectedReturns, ExpWeightedVariance, ExpWeightedCovariance, RegimeAdjustedExpWeightedVariance or RegimeAdjustedExpWeightedCovariance with a decay outside (0, 1)decay > 1 was accepted, and the estimate could be negative. On one example, decay = 1.5 gave the variances -1.5e12 and -1.24e12. decay = 1 raised InexactError: Int64(Inf), and a negative decay raised a DomainError of log2 that did not name decay.DomainError that names decay
Fees with a tn, lq or flq whose val is not finiteAccepted. Inf gave a model with an infinite coefficient and NaN weights.DomainError that names the field
GridSearchCrossValidation or RandomisedSearchCrossValidation with an empty vector of values, such as "opt.l1" => Float64[]The search fitted nothing, and it raised an error that said that every candidate failedIsEmptyError that names the key, before the search builds the grid
AssetPanel whose fields derive one column name of the feature matrix twice, such as "beta=size" beside a tensor field beta with the label sizepanel_feature_matrix gave the name twiceArgumentError that names the column and both fields
ReturnsResult(; X, nb) with no BAcceptedIsNothingError that names nb and B
UncertaintySetVariance with a sigma that is not squareAccepted, and a box set ranDimensionMismatch, as Variance gives
DistributionallyRobustConditionalValueatRisk(; w) with a negative or non-finite weightAcceptedDomainError
prior(CrossSectionalFactorPrior(…), rd) whose regression fits an interceptAccepted. mu, sigma and the scenarios dropped the share of the intercept.ArgumentError that names the remedy
cross_sectional_factor_sets with a factor label that starts with a key prefix of the universe, or that equals its nikeyA label such as "ni" became an axis. Other labels gave an unrelated DimensionMismatch or KeyError.ArgumentError that names the label
IntegerPhylogeny in the frc_ple of FactorRiskContribution when the asset bounds are nothing or not finiteThe phylogeny had no effectArgumentError. With finite bounds the phylogeny now binds the factor weights, and it needs a MIP solver.
ResidualInflation with no dof on a hand-built Regression that records no edofThe radius took a count of degrees of freedom from the type of the blockIsNothingError
MissingDataFilter applied to a window that lacks a fitted assetThe filter dropped the asset with no errorArgumentError
merge_states of two returns buffers with different capsMerged to the smaller capArgumentError
PriceIngestion(; join_method) with :right or a misspelt symbolAccepted. :right let a covariate set the clock.ArgumentError
panel_dataframe on a panel whose field name or asset name equals a column that the table writes, such as "asset" or "observation"The table replaced the column with no errorArgumentError that names the column
A Pipeline with a capped Online prior two levels down, such as opt.pe.pe, after a PriceGapFill stepRan, although the same prior one level down raised an errorArgumentError
partial_fit! on a Pipeline whose Online step no warm-up resolvedThe step dropped the wrapper and its cap. Online(EmpiricalPrior(); max_history = 30) folded 80 rows.ArgumentError
plot_rolling_drawdowns with a window longer than the seriesDrew an empty plotDomainError
RollingLogReturn, Reversal, RollingMax or MaxReturn on returns that hold an infinite valueAccepted. RollingLogReturn gave NaN in every later window, also in a window that does not hold the infinite return, and RollingMax gave Inf.DomainError that names the observation and the asset
EWResidualVolatility(; beta_half_life = Inf)DomainError that named half_lifeDomainError that names beta_half_life
factor_family_basis when the dropped member of a family has a zero benchmark-weighted exposureDivideError on Rational data, and on floating-point data an IsNonFiniteError that did not name the memberIsNonFiniteError that names the member, the family and the observation
PredictionReturnsResult(; iv) with no XMethodErrorIsNothingError that names X and iv

Calls that now answer

Callv0.31v0.32
A library estimator that holds a bare StatsBase covariance estimator, such as Covariance(; ce = SimpleCovariance()), inside a prior or an optimiserMethodError, because the bare estimator refused the library's keywords and the asset panelRuns. A working path keeps its numbers.
ExpWeightedExpectedReturns, ExpWeightedVariance, ExpWeightedCovariance or one of the two regime-adjusted forms on a transposed sample with an asset panel, dims = 2DimensionMismatchThe same answer as dims = 1
An upper bound over several assets on an EVaR or RLVaR view, with alg = nothingArgumentErrorThe sequential formulation meets the view.
An upper-bound grid EVaR view at half the prior valueOn a 100-row example, a DomainError on the posterior weightsThe posterior meets the bound to 1e-10.
optimise(opt, rd; dims = 2) on EqualWeighted, RandomWeighted or a hierarchical optimiser, and plot_dendrogram or plot_clusters on a prior result with dims = 2ConflictingArgumentError, DimensionMismatch or BoundsErrorThe call ignores dims, and it gives the answer of dims = 1.
Integer returns in HierarchicalRiskParity, HierarchicalEqualRiskContribution, SchurComplementHierarchicalRiskParity, InverseVolatility, EqualWeighted, RandomWeighted, PreviousWeights, the three exponentially weighted moment estimators, RegimeAdjustedExpWeightedVariance, RegimeAdjustedExpWeightedCovariance, phylogeny_features, factor_model_summary, the exposure, regression and idiosyncratic diagnostics, CrossSectionalFactorPrior, factor_family_basis and OrthogonalUncertaintySet. In descriptor: the rolling Descriptors, such as RollingLogReturn and RollingMax, EWMean and the named Descriptors that it builds, such as EWMomentum, EWMarketBeta with agg_obs > 1, and EWMacroSensitivity, also with an integer refInexactError, or MethodError for eps(::Type{Int64})The answer of the Float64 copy of the data. Float32 data stays Float32.
An optimiser whose fallback fb is a precomputed result, such as fb = optimise(EqualWeighted(), rd), when the first solve failsMethodErrorThe fallback returns that result. A failed precomputed result ends the chain.
MonotonicSchurComplement on a bracket narrower than about 0.18 * tolThe search did not iterate. It warned that it did not converge, or it raised under strict = true.The search stops when the bracket is at most tol wide.
feature_matrix(…, rows) with a Bool maskDimensionMismatchThe stack holds the rows where the mask is true.
The compact covariance uncertainty set on a singular covariancePosDefExceptionRuns, as Variance does
mean(StandardDeviationExpectedReturns(SimpleCovariance()), X), the same for VarianceExpectedReturns, and either one inside EmpiricalPrior(; me = …)MethodErrorRuns
covariance_forecast_evaluation of a PortfolioOptimisersCovariance or CorrelationCovariance that holds a StatsBase estimatorMethodErrorRuns
covariance_forecast_summary on a one-step evaluation, or on a step with a NaN standardised returnArgumentError about quantiles in the presence of NaNThe bias columns are NaN.
FactorRiskContribution with an estimator in frc_ple, when optimise receives a keyword that the optimiser does not readMethodErrorRuns
FactorRiskContribution with a vector frc_pleThe model solved, then a TypeError stopped the resultRuns, and frc_plr holds the vector
An sgcarde whose column count equals the row count of sgmtx when the row count does not, or on an optimiser where an asset is not investableDimensionMismatchRuns. An asset that departed removes a column of sgmtx, not a sub-group.
A vector sglt or sgst with no card or gcardMethodErrorRuns
NearestQuantilePrediction, sort_by_measure, quantile_by_measure, expected_risk(r, ppred) or rolling_window_measure(r, ppred, window) on a PopulationPredictionResult of single-fold PredictionResultsFieldError or MethodErrorRuns. Each member takes its own method.
train_test_split or TrainTestSplit with a Rational fraction, such as train_size = 1 // 5MethodErrorRuns
MissingDataFilter with a vector ivpa and no iv, when the filter drops a columnDimensionMismatchRuns
merge_states of the empty sample buffer that an Online wrapper seeds with a folded buffer, and port_opt_view of an empty bufferDimensionMismatch or BoundsErrorA copy of the folded buffer, and a view
price_ingestion on a table of Union{Missing, Rational{Int}} that holds no missingDomainErrorRuns
A price_ingestion collapse whose timestamp function makes new timestamps, on a time-varying panelArgumentErrorRuns
linear_constraints with a group that sheds every member while the other side is not emptyBoundsErrorRuns
predict of a Frontier optimisation on a ReturnsResult with iv and no ivpa, and PredictionReturnsResult with one iv vector for each member and no ivpaMethodErrorRuns. The iv of each member is iv * (abs.(w) / sum(abs, w)).
CrossSectionalFactorPrior(; neutralise) with a Symbol target, such as "size" => :valueThe constructor accepted it, and the fit raised a MethodErrorThe answer of the String target
plot_factor_mu, plot_factor_sigma, plot_factor_forecast_correlation and plot_factor_forecast_volatilities on a HighOrderPrior over a FactorPriorFieldErrorRuns
plot_composition of a prediction with a masked fold, plot_dendrogram and plot_clusters on a prior with gaps, plot_measures on a PredictionResult, and plot_asset_cumulative_returns(…; N = 0.5)An error. A masked fold gave a BoundsError, a prior with gaps an IsNonFiniteError, and a fractional N a TypeError.Runs

Results that move

These results were wrong in v0.31:

  • An LInfNorm tracking error divided the largest difference by T - ddof. With 252 rows, err = 2e-2 let one day differ by 5.04, so the bound did not bind. The error is now the largest difference, and err is the bound on one period.
  • MonotonicSchurComplement returned the weights of a gamma other than the one it reported. The difference reached 8e-6 in a weight. The bisection also returned the weights of a midpoint that it rejected.
  • SchurComplementHierarchicalRiskParity dropped its fee. The result had no fees field, so calc_net_returns gave the gross return, and a fold charged no forced exit. The result now carries the fee.
  • After factory, the skewness term of a VarianceSkewKurtosis had scale 1 and no floor, so expected_risk of the stored measure did not match the model. The weights did not move.
  • IntegerConditionalValueatRiskView did not reach the posterior of least divergence. On a 60-row example, the divergence falls from 0.0189 to 0.0175 for an upper bound, and from 0.0858 to 0.0415 for an equality. The view now warns when its window of sbar losses binds.
  • An IterativeWeightFinaliser that stalled or diverged reported success with weights that broke the bounds. It now returns the Euclidean projection of its input. A bound set that cannot hold the budget now fails, so the fallback chain runs.
  • A walk-forward that charged a turnover fee on a naive optimiser priced the fee against the reference weights w of its Turnover on every fold, never against the weights that the fold held. Buy-and-hold paid the most, and a constant rebalanced portfolio paid nothing. The fee is now charged against the previous weights that the fold loop passes on. The first fold's fee is the trade from those reference weights.
  • optimise(opt, rd; dims = 2) on MeanRisk, InverseVolatility or another optimiser that fits a prior fitted the prior on the transpose, and gave one weight per observation. prior(pe, rd; dims = 2) and the clustering calls on a prior result also read the transpose. Now dims has no effect.
  • Under MaximumRatio, the squared L2 penalty of RSOCRiskExpr, SquaredSOCRiskExpr and QuadRiskExpr scaled as k^2 ‖w‖^2, so its strength moved with ohf. The weights moved by 0.25 between ohf and 10 ohf. The penalty is now k ‖w‖^2, of degree one, as every other penalty is.
  • With a fee, a moment risk measure whose target is per asset centred the net returns on the gross mean, so each deviation carried the mean fee. A target is per asset when you state a mu vector, or when factory fills the prior mean. The target now subtracts the mean fee of each period, in the model and in the functor. This covers the low- and high-order moments, Kurtosis, MedianAbsoluteDeviation, the third central moment and the skewness.
  • LowOrderMoment(; w, alg = SecondMoment()), HighOrderMoment with a standardised algorithm and Skewness(; w) did not pass w to their variance estimator. So the functor ignored the weights in the variance. On one example it gave 2.7574, and the optimiser gave 2.9726.
  • expected_risk of a RiskTrackingRiskMeasure with IndependentVariableTracking and a fee charged the fee of w - wb, which is zero at wb, while the model charged the fee of w. With Fees(; l = 0.002) and a CVaR at w = wb, the functor gave about 0 and the model 0.002. The functor now reads the series of the model. The weights do not move.
  • A SemiDefinitePhylogeny dropped its penalty p tr(W) when any variance was in the model. It now drops the penalty only when the objective minimises that variance: MinimumRisk, MaximumUtility with l > 0, and the return form of MaximumRatio. A variance ceiling, MaximumReturn, MaximumUtility with l = 0 and the risk form of MaximumRatio keep the penalty, so their weights move. The same rule now holds for a SemiDefinitePhylogeny in the frc_ple of FactorRiskContribution, which v0.31 always penalised.
  • A RiskTrackingRiskMeasure with DependentVariableTracking of a semidefinite Variance, and a dependent RiskTrackingError, built the tracking variance on a second lifted matrix, which the rows of a SemiDefinitePhylogeny did not bind. The tracking variance now reads the lifted matrix of the optimiser.
  • An IntegerPhylogeny in the frc_ple of FactorRiskContribution had no effect. It now binds the factor weights.
  • Under FactorRiskContribution(; flag = true), the variance read the factor part b1 * w1 alone and omitted the off-factor weights. On one example the model value was 43 % below the variance of the returned weights. The variance now covers the whole decision vector.
  • Under RelaxedRiskBudgeting with FactorRiskBudgeting(; flag = true), the relaxed risk priced b1 * w1 alone. On one example psi was 0.219, and the standard deviation of the weights was 1.88. The marginal risks now read the asset weights.
  • RelaxedRiskBudgeting with a RiskBudget whose values do not sum to one did not meet the budget. RiskBudget(; val = 20:-1:1) gave contribution ratios from 0.19 to 1.64 against a target of 20. The cones now read val / sum(val).
  • Under MaximumRatio, an upper bound on the compact covariance uncertainty set bounded the worst-case variance by ub / k, so a bound that MaximumReturn meets made the model infeasible. The set now bounds the square root by sqrt(ub).
  • When smtx and sgmtx were the same matrix, the model ignored sglt and sgst. It now keeps them unless they are the same objects as slt and sst.
  • risk_contribution of a vector of risk measures under MaxScalariser or MinScalariser took the wrong measure when the measures had different degrees. The chain-rule weights now come from the scaled risks, and the log-sum-exp contributions move too. SumScalariser does not move.
  • The Laplace z-score of a parametric ValueatRiskRange was wrong. At beta = 0.05 it was -0.454 where the quantile of the unit-variance Laplace is -1.628, so the range was about 2.08 standard deviations in place of 3.26. The lower tail at alpha > 1/2 was also wrong.
  • The empirical ValueatRisk, ValueatRiskRange, DrawdownatRisk and RelativeDrawdownatRisk took the order statistic ceil(alpha T). When alpha T rounds above an integer, as 0.07 × 100 does, the functor returned the 8th smallest return and the MIP model the 7th. The functor now takes the order statistic of the model.
  • HierarchicalEqualRiskContribution chose the nodes above the cut by their height. When two heights tied at the cut, every weight was NaN, and the result was a failure. It now takes the nodes that cutree leaves. Under LogSumExpScalariser the shares inside a cluster did not sum to one, and at gamma = 1e-3 the weights moved by up to 5.6e-3.
  • DBHT clustering turned Inf * 0 into NaN where two vertices have no path, and then chose the NaN. The bubble assignment and the tree move on such a network.
  • ExpWeightedCovariance, and RegimeAdjustedExpWeightedCovariance with one decay, let the variance of an asset decay on a holiday of another asset while their covariance stayed. So the estimate was not positive semidefinite. Two equal series, one of them with five holidays, gave an implied correlation of 2.37 under ExpWeightedCovariance and 2.44 under the regime-adjusted form. Each asset now ages its observations on its own clock, and a holiday holds the correlation of each pair that contains its asset. A sample with no holiday keeps its numbers.
  • RegimeAdjustedExpWeightedCovariance with a separate cor_decay divided each pair by its own count of common observations. With holidays, the smallest eigenvalue reached -0.1075 times the largest entry. A holiday now holds the correlation of each pair that contains its asset. A sample with no holiday keeps its numbers.
  • IdiosyncraticVarianceScaling read only the diagonal of a full idiosyncratic covariance, which a CrossSectionalFactorPrior with th != 0 writes. On a six-asset example with a correlated esigma, the scaling missed the full covariance by 0.0032. It now reads the whole matrix.
  • A PreviousWeights fallback kept its whole w under an asset subset. So a cluster of NestedClustered, or the asset subset of MultipleRandomised or SubsetResampling, whose solve failed gave weights of the wrong length. A view now slices w, fees and fb, and it does not rescale the slice.
  • DiscreteAllocation had three defects. It multiplied the weights of a side by the cash of the side, which already held the budget of the side. So when a side budget b is not 1, the targets summed to b^2 times the cash. The two relative formulations bounded x C / (w p) - 1, where x is the count of shares, p the price, w the weight and C the cash. The correct relative error is x p / (w C) - 1. The relative objective added a unitless error to the cash. On w = [0.4, 0.4], p = [10, 100] and cash = 1250, it bought [40, 4] where the exact book is [50, 5].
  • Below a unit budget, the long side of a finite allocation took the cash that the short side did not use. So a book could spend more than its cash. On [1.2, -0.5] a book spent 170 of a cash of 100, and a market-neutral book became all long. When the short side paid a fee, the long side also received an excess of twice that fee. The default ProceedsCollateral now bounds the net money, and CashCollateral bounds the gross money.
  • GreedyAllocation bought an asset with a zero target weight when its first pass bought nothing, and a side whose targets are all zero gave NaN shares and cash.
  • A fixed fee on a MIP optimiser charged the binary variable, which does not scale with k, so under MaximumRatio the weights depended on ohf. The fee now charges the binary times k. A fee with fixed terms alone did not reach the net returns, so a risk measure on the net returns did not see it.
  • prices_to_returns let the gap-return algorithm of the caller overwrite the -1, -Inf and Inf returns next to an observed zero price. Those cells read two observed prices, and the algorithm no longer writes them. CatchUpGapReturn writes the same values as before.
  • prices_to_returns(…; padding = true) on a view of a ListingSpan made the first return row active for an asset listed before the window, with a NaN return. The row is now inactive.
  • PriceGapFill with CarriedPrice carried a price across an absence in the span of the caller, and across an absence at the end of the training window. So the return after the gap was an active move across the absence. An absence now clears the carry.
  • A price_ingestion collapse such as (Dates.week, first, last) took the prices of each period from its last row, but the values of the panel fields from its first row. Each period now takes the values of its last row.
  • MissingDataFilter dropped a row whose share of missing assets equals row_thr, and a Float32 col_thr dropped a column at its threshold. The apply step kept the column order of the window, not the fitted order.
  • train_test_split and TrainTestSplit with a fraction lost a row to round-off. For example, train_size = 0.29 on 100 rows gave 28 rows. The count is now the largest n with n / N <= s.
  • merge_states of two capped returns buffers trimmed X to max_history, but not ts or B.
  • panel_dataframe shared memory with the panel in the static long layout, so a write to the table changed the panel. It now copies.
  • Under ResetCoverage, the semi-covariance, the coskewness and the cokurtosis gave the answer of DecayCoverage. They now drop the history before the last delisting.
  • The online answer of a HighOrderPriorEstimator refitted a co-moment that does not fold over the capped or zero-filled pr.X. Under a cap of 25 scenarios on 80 rows, the coskewness missed the batch fit by 24 %. It now refits over the rows that the embedded prior folded.
  • linear_constraints read only the first two factors of a product: "2*3*x <= 1" lost x, and "2*x*3 <= 1" gave 2x. UniformValues under datatype = Rational{Int} gave 6004799503160661//18014398509481984 for 1//3.
  • covariance_forecast_evaluation of a prior centred the test rows on the mu that the prior publishes. For an EmpiricalPrior whose me shrinks the mean, this read a bias that the forecast did not have. The centre is now the centre of the sigma of the prior. The default pair does not move.
  • covariance_forecast_evaluation of a PortfolioOptimisersCovariance that holds a mask-aware estimator dropped an asset that listed after the start of the sample. Under an online cross-validation scheme with store_forecasts = true, every stored location was the vector of the last fold, so covariance_forecast_portfolio of such a run was off by up to 0.76.
  • performance_summary of a constant return series gave a sharpe of about 2e16, and a constant excess series gave an information_ratio of 2e16. Each is now NaN, as the docstring states.
  • forecast_portfolio under :zscore turned a flat cross-section into a short book of 200 % gross. The row now stays zero. The series summary gave a constant series an information ratio of about 2e16, which is now NaN.
  • forecast_coverage and its summary counted an asset with an infinite weight, which the Pearson column drops. They now admit 0 < u < Inf.
  • factor_model_summary of a constant factor series gave a Sharpe ratio up to 1.3e17 and an autocorrelation of ±1. The exposure diagnostics counted a zero weight toward a pair, and one NaN weight made an observation NaN. A constant cross-section gave an exposure correlation of 0.0 and a cs_regression_r2 up to 8.1e31. Each of these is now NaN.
  • idio_skewness and idio_kurtosis of a constant cross-section gave a finite value up to 2.45, where the docstring states NaN. idio_tail_rate counted an infinite entry in the numerator and not in the denominator, so [Inf 0.5 4 NaN -5] gave 1.0 where the rate is 2/3.
  • A PanelFieldRatio whose num or den sums several panel fields took the number type of the first term. So a Float32 first term rounded a Float64 term. With num = ["f32" => 1, "f64" => 1], a Float64 term of 1e-6 became 9.54e-7, and the reverse order gave 1e-6. The sum now takes the type that every term promotes to.

These results were approximate in v0.31:

  • A tracking error on LpNorm(), whose default ddof moved from 0 to 1.
  • The t-statistic of every information-coefficient summary treated the forward windows as independent rows. The windows overlap in three cases: forecast_holding_period from its second row on, forecast_evaluation_summary at any step < horizon, and exposure_ic_summary on a block at any horizon > 1. In these cases the statistic now uses a Newey-West variance at the known overlap order, so it is smaller. ic_ir does not move.
  • MIPValueatRisk, DrawdownatRisk and ValueatRiskRange with b = nothing used a big-M constant of 1000. A solver integrality tolerance of 1e-6 then loosened a row by about 1e-3, so the model risk and the measure disagreed. The builder now derives the smallest exact constant from the weight bounds and the spread of the losses. It keeps 1000 for a free weight scale, a tracking shift, fees or a NaN in X. On one example, a NestedClustered VaR portfolio falls from 0.013824 to 0.013200.
  • The ResidualInflation radius took one count of degrees of freedom from the type of the block, so its level fell to 0.904 at T = 30, K = 3 and to 0.769 at K = 8, against 0.95. The fit now records the count of each asset, and the level is 0.942 and 0.946.
  • The three exponentially weighted estimators divided the cold-start correction by max(1 - decay^n, eps). The floor is gone. It changed an answer only where 1 - decay < eps.
  • A bin edge of forecast_calibration that falls on an order statistic could land one ulp above it, and move a pair to the bin below.
  • Under Optim 2.3 and later, the entropy-pooling solve takes Fminbox(; mu0 = 1e-5), as it does under Optim 2.0.1 to 2.2. v0.31 took the default mu0 of Optim there, which can give a NaN.

This result keeps its numbers, but its meaning changed:

  • PopulationPredictionResult gives each member whose id is nothing its position, so a scorer that selects a path names it.

These results keep their numbers, but their number type changed:

  • EqualWeighted on Float32 returns gives Float32 weights. v0.31 gave Float64.
  • factor_attribution and the realised attribution family take the number type of the data. v0.31 gave Float64 volatilities and errors for Float32 data.
  • forecast_evaluation_summary(fe; quantiles = 0.2) stores quantiles as a vector of one. v0.31 stored a 0-dimensional array.

If you extend the library

  • A risk-measure builder set_risk_constraints!(model, i, r, opt, pr, …) receives opt::RiskConstraintOwner. A method bound to RiskJuMPOptimisationEstimator alone is not called for a ProgrammeAllocationSet.
  • SchurComplementHierarchicalRiskParityResult has a fees field after clr, so its positional constructor takes one more argument. The keyword constructor needs fees too. Pass fees = nothing for a result with no fee.
  • L1Norm has a field, ddof, and LInfNorm has none. Code that constructs either by position must follow.
  • ForecastEvaluationResult has a ties field after min_count, so its positional constructor takes one more argument.
  • Regression and CrossSectionalFactorModel have the fields edof and ediv, so their positional constructors take two more arguments.
  • FactorRiskBudgeting has a hedge field, false by default, so its positional constructor takes one more argument.
  • FiniteAllocationInput has a field ca, the collateral algorithm, so its positional constructor takes one more argument.

From v0.32 to v0.33

v0.33 removes brt. Each reader of the returns now states the returns that it fits on in its own x_src field: nothing, DataSource(), ExcessSource() or PriorSource(). ExcessSource() reads X - B, the returns in excess of the benchmark, as brt = true did. A head holds no source and passes none to its readers, so you state the source on each reader. The Symbol field x_src of JuMPOptimiser, HierarchicalOptimiser and NestedClustered is gone too, and a clustering, phylogeny or centrality estimator at the default reads the returns data, where v0.32 read the prior. A call that passes brt raises a MethodError.

v0.33 also brings the cross-sectional factor prior to parity with the oracle, and that changes its defaults: a default fit of CrossSectionalFactorPrior moves, and Renamed keywords and changed defaults gives the keywords that keep the v0.32 mu. The empirical Value at Risk, the regime-adjusted and exponentially weighted moments, the chi-squared radius of an uncertainty set and the default leaf order move too. Some calls that ran in v0.32 now raise an error, some calls that raised now answer, and the results in Results that move change.

Names that were removed

RemovedWrite instead
brt of JuMPOptimiser, HierarchicalOptimiser, InverseVolatility, NestedClustered, Stacking and SubsetResamplingState x_src = ExcessSource() on each reader in the head: the prior, JuMPOptimiser(; pe = EmpiricalPrior(; x_src = ExcessSource())), and each clustering, phylogeny, centrality or regression estimator and each prior of an uncertainty set that must read X - B. A regression estimator at nothing reads the loadings of a prior that gives them, as it did under brt = true. A head that holds a reader at nothing beside a reader at ExcessSource() warns once when you build it. State DataSource() on the raw reader to silence the warning. An inner optimiser, a fallback and the outer optimiser of a meta-optimiser state their own sources, as they applied their own brt. On returns data with no benchmark, brt = true read the raw returns, and a reader at ExcessSource() raises an ArgumentError.
returns_result_picker(rd, brt::Bool)rd for false. For true, benchmark_relative_returns(rd, ExcessSource()) gives the matrix X - B, and ReturnsResult(; nx = rd.nx, X = benchmark_relative_returns(rd, ExcessSource()), nf = rd.nf, F = rd.F, ne = rd.ne, E = rd.E, ts = rd.ts, iv = rd.iv, ivpa = rd.ivpa, pnl = rd.pnl) gives the returns data with no benchmark that v0.32 gave. A reader at ExcessSource() reads X - B itself, so a call that passed the picked data to a reader passes rd now. On returns data with no benchmark, v0.32 returned rd, and benchmark_relative_returns(rd, ExcessSource()) raises an ArgumentError.
The x_src field, :prior or :data, of JuMPOptimiser, HierarchicalOptimiser and NestedClustered, and the x_src keyword of clusterise and the other graph verbsState the source on the graph reader. x_src = :prior becomes PriorSource(): HierarchicalOptimiser(; cle = ClustersEstimator(; x_src = PriorSource())) and JuMPOptimiser(; ple = SemiDefinitePhylogenyEstimator(; x_src = PriorSource())). x_src = :data becomes nothing or DataSource(). A graph verb reads the source of its estimator: clusterise(ClustersEstimator(; x_src = PriorSource()), pr; rd = rd).
The keyword and field centred of ExpWeightedVariance, ExpWeightedCovariance, RegimeAdjustedExpWeightedVariance and RegimeAdjustedExpWeightedCovariancecentring = PreCentred() for centred = true, and centring = ZeroStartCentring() for the v0.32 numbers of centred = false. The new default EstimatedCentring() replaces that location with an unbiased one. See Results that move. Code that reads ce.centred reads ce.centring isa PreCentred. A call that passes centred raises a MethodError.

Renamed keywords and changed defaults

  • One annualisation keyword, ppy, with the default 1. performance_summary and plot_performance_summary take ppy, where v0.32 took periods_per_year = 252, and the field of PerformanceSummaryResult is ppy. The default 1 states each figure per period, which is right at any data frequency, as factor_model_summary, factor_attribution and forecast_evaluation already did. Write ppy = 252 to keep the v0.32 numbers on daily returns. A call that passes periods_per_year raises a MethodError.

  • ImpliedVolatility takes ppy, with no default, where v0.32 took af = 252. The implied volatility is annual, and ppy converts it to the period of the returns, so the caller states it. ImpliedVolatility(; ppy = 252) gives the v0.32 default, and ImpliedVolatility() raises an UndefKeywordError.

  • RegimeAdjustedExpWeightedVariance and RegimeAdjustedExpWeightedCovariance take debias = ExactDebias(). The regime statistic divides by the bias of the estimate that it reads, and it skips an estimate too young for its statistic to have a finite variance. State debias = RawStatistic() to keep the v0.32 statistic. LawDebias() divides by the law of the estimate alone, and takes the deviation as independent of the estimate. See Results that move.

  • The two regime-adjusted estimators take regime_lohi_mult = (0.7, 1.6) and min_val = 1e-12, where v0.32 took nothing and sqrt(eps()). The floor sqrt(eps()) removed from the statistic each asset whose variance was below 1.5e-8, so a change of units moved the multiplier: on returns one thousand times smaller each variance moved by up to 32 %. State regime_lohi_mult = nothing, min_val = sqrt(eps()) to keep the v0.32 numbers.

  • hac_floor = NoHacFloor(). RegimeAdjustedExpWeightedVariance, and the variance of the separate correlation path of RegimeAdjustedExpWeightedCovariance, floored each HAC square at zero. On returns with no autocorrelation, that made the variance 6.7 %, 16 % and 41 % too large at one, two and five lags. Each square now keeps its sign, and the scalar estimator floors the variance that it returns at zero. State hac_floor = PerTermHacFloor() to keep the v0.32 numbers.

  • hac_vol_before = VolatilityBeforeUpdate() on RegimeAdjustedExpWeightedCovariance. On the separate correlation path under HAC, each row of the correlation now divides by the volatility before its update. The rule after the update amplified a negative HAC diagonal, so it had 9 % to 19 % more mean squared error at two lags. State hac_vol_before = VolatilityAfterUpdate() to keep the v0.32 numbers. Without HAC, or with one decay, the keyword changes nothing.

  • cor_vol = BiasCorrectedVolatility() on RegimeAdjustedExpWeightedCovariance. On the separate correlation path each product now divides by the variance state over its weight 1 - λ^K. The raw state, seeded at zero, gave the first products of the warm-up more weight than the bias tables of the regime statistic assume, so the factor of PortfolioTarget read up to 8 % high at 20 observations. The steady state does not move. State cor_vol = RawVolatility() to keep the v0.32 numbers. With one decay, the keyword changes nothing. Under HAC on the separate path, the regime statistic also skips a row whose covariance block is not yet built, and on either path PortfolioTarget skips a row whose direction has a variance at or below min_val, where v0.32 scored such a row at about 1e12.

  • PortfolioTarget(; indefinite = RefuseIndefiniteWarmUp()). A HAC block in the warm-up, and a block of assets with different histories, need not be positive definite, and a direction with a small positive variance on it scored a large statistic: on 8 assets, half-lives of 10 and 20 and two lags, one seed of 30 set the regime state to 51 after 8 rows. The default rule refuses a block with a negative eigenvalue while the gate of MahalanobisTarget for the same assets is closed, so the first scored row can come later, and it scores every block once the gate opens, so the steady state does not move. State indefinite = ScoreIndefiniteBlock() to keep the v0.32 numbers, or ClipIndefiniteBlock() to clip the eigenvalues of the correlation of the block at zero.

  • The square root of a covariance is a field, mtx_sqrt = EigenFallbackSquareRoot(). FactorPrior, CrossSectionalFactorPrior, FactorBlackLittermanPrior, Variance, StandardDeviation, DistributionValueatRisk, UncertaintySetVariance, ArithmeticReturn, RelaxedRiskBudgeting, Kurtosis, NegativeSkewness, NormBallUncertaintySetAlgorithm and OrthogonalUncertaintySet take it. On a positive definite matrix the default gives the Cholesky factor, so no risk and no weight moves. One stored value moves: under IdiosyncraticVarianceScaling() the map L of the mean set of OrthogonalUncertaintySet was G * sqrt(Λ), with G the orthonormal basis of the set and Λ its scaling, and it is now G times the Cholesky factor of Λ. The two maps give the same L L', so the set does not move. On a singular positive semidefinite matrix the default gives the eigen square root, where the three factor priors, Kurtosis and the norm ball raised a PosDefException in v0.32. State mtx_sqrt = nothing to keep the plain Cholesky factor, or RidgeCholeskySquareRoot() for the Cholesky factor of the matrix with a small ridge.

  • ChiSqKUncertaintyAlgorithm takes ambient = false. The radius of a full covariance set reads the free entries of a symmetric matrix. See Results that move. State ambient = true to keep the v0.32 numbers.

  • NormalUncertaintySet takes dc = DiagonalOfShape(), which takes the diagonal of the full shape, as v0.32 did. dc = ShapeOfDiagonal() sets each covariance to zero before it builds the shape, so each entry of the diagonal set is (1 + δ_ij) Σ_ii Σ_jj / T in place of (Σ_ii Σ_jj + Σ_ij²) / T.

  • branchorder = :optimal, the default, is the exact optimal leaf order. v0.32 passed :optimal to Clustering.hclust, which runs the heuristic of :barjoseph under that name. The tree and every cut do not change, but the order of the leaves can. See Results that move. State branchorder = :barjoseph to keep the v0.32 order.

  • CrossSectionalFactorPrior has new defaults. Each one moves a default fit. See Results that move for the size.

    • pe = EmpiricalPrior(; me = ExpWeightedExpectedReturns(), ce = RegimeAdjustedExpWeightedCovariance(; centring = PreCentred())), where v0.32 took EmpiricalPrior(). The factor prior decays with the half-life of ve, so the systematic part and the specific part of sigma read one horizon.
    • ve = RegimeAdjustedExpWeightedVariance(; centring = PreCentred()), where v0.32 took RegimeAdjustedExpWeightedVariance(). The model sets the mean of the idiosyncratic return to zero, so the variance is a second moment about zero. The v0.32 default measured it about a mean that it updated at each observation.
    • lambda = PrecisionBlend(), where v0.32 took lambda = 1.0. The rule gives the factor mean the weight max(0, 1 - K / (T_e B)), with B the squared distance of the spanned part of the return forecast from the factor mean in the metric of the factor covariance, K the rank of that covariance and T_e the effective sample size. With no rfe the spanned part is zero, so the rule shrinks the factor mean towards zero.
    • ofit = ScoreNeutralisation(). A fitted return forecast, ExpWeightedReturnForecast or TargetReturnForecast, neutralises its scores against every estimated factor, so its orthogonal part keeps the scale of its fit. v0.32 used the forecast as the member stated it.
    • pdm = Posdef(; alg = ClippedNearestCorrelation()) repairs the idiosyncratic block under a threshold th above zero. v0.32 repaired the block with mp.pdm, the nearest correlation matrix at the default mp. mp.pdm now repairs the asset covariance alone.
    • srep = NoSystematicRepair(). v0.32 repaired the systematic block with mp.pdm before the lift. Under the default srep, a matrix processing estimator of your own in mp raises an ArgumentError when you build the prior.
    • unseen = ZeroUnseenMember(). See Results that move.

    To keep the v0.32 mu, state lambda = 1.0, pe = EmpiricalPrior(), ve = RegimeAdjustedExpWeightedVariance(; centring = ZeroStartCentring(), debias = RawStatistic(), regime_lohi_mult = nothing, min_val = sqrt(eps()), hac_floor = PerTermHacFloor()), ofit = UnadjustedForecast(), unseen = SolvedUnseenMember(), srep = SystematicRepair(), pdm = Posdef(), l1mask = UnmaskedLeverageOne(). On one panel of 60 assets and 300 observations, these keywords gave the v0.32 mu exactly, and a sigma within 0.3 % of its largest entry. The rest of the difference comes from the corrections that the next section lists, which no keyword undoes.

  • ExpWeightedReturnForecast and TargetReturnForecast take min_obs = 1, where v0.32 took ceil(Int, half_life), which is 20 at the default half_life = 20. The weight 1 - λ^n multiplies both accumulators and the ridge, so the coefficients after n observations are the weighted least squares fit of those observations, and the fit needs no warm-up. v0.32 wrote NaN in the forecast history, and in the calibration slope of TargetReturnForecast, until 20 observations advanced the recursion: on one panel of 300 observations, 59 rows of the history were NaN, and now 40 are. State min_obs = 20, or ceil(Int, half_life) for your own half_life, to keep the v0.32 numbers.

  • TargetReturnForecast takes cv = PrequentialCalibration(), where v0.32 took cv = nothing. v0.32 calibrated on the in-sample predictions, and the fit made each of them from the same forward return that the calibration regresses on it, so the slope was too large. At each matured observation the calibration now reads the prediction of the model fitted on the samples whose target had matured there, which is the forecast that the member published. On one panel the slope at the defaults moved from 32.8 to -1.9. State cv = nothing to calibrate in sample again, or cv = KFold() for an out-of-fold calibration. Other corrections of the member also move the slope, so cv = nothing with min_obs = 20 gave 32.6 on that panel, not the v0.32 32.8.

  • The Neutralisation of DescriptorScores fits an intercept. The default is cre = CrossSectionalLinearRegression(; intercept = true), where v0.32 took CrossSectionalLinearRegression(), whose intercept is false. The residual is now orthogonal to the constant and to each target. Where the targets span the constant, as a market factor does, the two rules give the same residual. A recipe with no neutralise does not move. State cre = CrossSectionalLinearRegression(; intercept = false) to keep the v0.32 rule.

  • exposure_coverage of a CrossSectionalFactorModel takes weighting = RegressionWeightMetric(), where v0.32 took BenchmarkWeightMetric(). The universe of an observation is now the assets of positive regression weight, which is the estimation universe of the fit, so the answer is the coverage column of factor_model_summary. State weighting = BenchmarkWeightMetric() to keep the v0.32 numbers.

  • CrossSectionalTargetRegression takes alg = PseudoInverseFallback(). v0.32 gave the full design to the target, so a factor set that is dependent to round-off raised a PosDefException from GLM, and a set that was nearly dependent lost a column from a condition number of about 1e8. The target now fits the columns that the rank test keeps. State alg = UncheckedSolve() to keep the v0.32 fit.

  • cs_regression_aic, cs_regression_bic and cs_regression_adjusted_r2 take k = nothing, the rank of the design of each observation, where v0.32 read the number of factors, size(B, 3). On a singular design, a coefficient that the data do not identify has a NaN t-statistic and an infinite variance inflation factor, where v0.32 reported numbers from round-off, and the residual variance divides by n - rank. State k = size(B, 3) to keep the v0.32 scores.

  • The idiosyncratic diagnostics take ahead = true. idio_calibration, idio_tail_rate, idio_kurtosis, idio_skewness, their summary and their plots divide each residual by the volatility of the observation before it. v0.32 divided by the volatility of its own observation, which bounded the scaled residual and read the tails too thin. State ahead = false to keep the v0.32 numbers.

  • The information-coefficient summaries take a mean test, mt = WildBootstrapMeanTest(). forecast_ic_summary, exposure_ic_summary, exposure_ic_factor_summary, forecast_holding_period, forecast_decay and forecast_evaluation_summary read their t_stat from it. The test reads a fixed-bandwidth Bartlett variance and a wild bootstrap, so t_stat moves, and each summary also gives p_value, mean_ci_lower and mean_ci_upper. On one series of 80 coefficients t_stat moved from 3.0 to 4.0. At lags = 0, mt = OverlapMeanTest() gives the v0.32 t_stat. At lags above zero no keyword gives it, because v0.32 read a long-run variance that the mean test does not use.

  • performance_summary and plot_performance_summary of a prediction read the benchmark of its rows. When the returns data holds B, excess_ret, tracking_error and information_ratio are numbers, where v0.32 gave NaN. State benchmark = nothing to keep the v0.32 values.

  • factor_attribution takes unknown = EntrywiseUnknown(). v0.32 set to zero the whole row of a held asset in the warm-up of its variance. Now its exposures and its systematic numbers stay, and each number that reads the unknown variance is NaN. See Results that move.

  • feature_matrix takes placeholder = NaN, so a cell that holds a placeholder reads NaN, where v0.32 read the value that the panel stored in the cell. State placeholder = nothing to keep the v0.32 value. An integer panel that holds a placeholder now stacks in a floating-point type.

  • NestedClustered and Stacking take pcol = RenormaliseActive(). The panel collapse weighs only the members that are active at each observation. See Results that move.

  • An unset pws follows wd. A walk-forward or MultipleRandomised scheme that states a weight drift wd and no pws now takes the drifted weights, DriftedWeights(wd), as the previous weights of each fold. v0.32 took the target weights. State pws = TargetWeights() to keep the v0.32 numbers.

Calls that now raise

Callv0.32v0.33
A keyword other than strict, dims and cache_reg on prior over a ReturnsResult, for example prior(pe, rd; brt = true)Ran, and ignored the keyword.Raises a MethodError.
A keyword other than dims on ucs, mu_ucs or sigma_ucs over a ReturnsResultRan, and ignored the keyword.Raises a MethodError.
An optimiser with strict = true whose graph reader at the default meets an asset that has a gap in its rows and that a prior with a CoveragePolicy keepsRan, and the graph reader read the X of the prior, which fills the gap.Raises an IsNonFiniteError that names the asset and the two remedies: the same CoveragePolicy on the ce of the graph reader, or x_src = PriorSource().
A repair of Posdef whose last result is not positive semidefiniteWarned that the matrix could not be made positive definite, and returned it.Raises a PosdefRepairError that names the algorithm, the smallest eigenvalue and the tolerance. A result that is positive semidefinite to round-off returns with no warning.
A Bool radius, such as kappa = true on OrthogonalUncertaintySet, CompactCovarianceUncertaintySet or NormBallUncertaintySet, or k = true on EllipsoidalUncertaintySetAccepted, as the radius 1.Raises an ArgumentError.
ARCHUncertaintySet(; n_sim = 1) with an ellipsoid or a norm ballAccepted. The fit raised an error that named neither the cause nor the remedy.Raises a DomainError when you build the estimator. A box set still accepts one resample.
The mean set of OrthogonalUncertaintySet under IdiosyncraticVarianceScaling(), when the idiosyncratic covariance makes the scaling indefiniteReturned a set with a complex map L.Raises a LinearAlgebra.PosDefException. Only a loadings block that you build by hand can give such a scaling.
A risk measure whose observation weights w, its own or those of the prior, have a length other than the number of observationsRan. The weighted quantile kernels read the weights through the sort permutation of the returns, so a long vector passed in silence.Raises a DimensionMismatch that names the weights, at the first evaluation or model build that reads them.
A risk measure with observation weights that sum to zero, or LowOrderMoment with a negative weightAccepted.Raises a DomainError when you build the measure. A dynamic weight raises when it resolves.
LowOrderPrior whose sigma holds a value that is not finite between two investable assetsAccepted.Raises an IsNonFiniteError. An asset whose mu or variance is not finite is not investable, and its row and column are not checked.
CombinatorialCrossValidation with n_test_folds == n_folds, or a negative purged_size or embargo_size on it or on KFoldAccepted. n_test_folds == n_folds gave one split with an empty training set.Raises a DomainError.
DateWalkForward with an integer train_size = 0Accepted. Every fold trained on no row.Raises a DomainError when you build the scheme.
split or n_splits of a DateWalkForward with a fold whose training window holds no row after expand_train and purged_size, for example DateWalkForward(2, 1; period = Day(1)) over business days, where the two dates before a Monday are a weekendReturned the fold with an empty training range: 12 of the 86 folds over the weekdays of 2024 Q1.Raises an IsEmptyError that names the date where the test of the fold starts. Increase train_size, or reduce purged_size.
A CrossSectionalFactorPrior that holds a CompositeExposure or DerivedExposure whose bw is not the bw of the priorAccepted. The member read whatever field of the panel had the name of its own bw, or failed on a missing field.Raises an ArgumentError when you build the prior. A fit on a panel that already holds a field of the name bw of the prior also raises, where v0.32 replaced the field.
A CompositeExposure or DerivedExposure that reads a blank benchmark weight on an active cell, under strict = trueRead the blank as zero, with no message.Raises an ArgumentError. Under strict = false it reads the blank as zero and warns once with the count, the first observation and the assets. A blank on an inactive cell stays a silent zero.
EntropyPoolingPrior or MeucciEntropyPoolingPrior over a LowDimensionEnsemblePrior, or over a FactorPrior whose factor prior is oneRan. The posterior weights met the views, but mu and sigma were those of the ensemble with no view, because the ensemble reads no weights.Raises an ArgumentError when you build the estimator.
EntropyPoolingPrior or MeucciEntropyPoolingPrior over a factor prior or a Black-Litterman prior that holds an OpinionPoolingPrior with pe1Ran, and the views of the entropy pooling prior missed mu.Raises an ArgumentError when you build the estimator. Give the pool to the entropy pooling prior directly as its pe.
The first partial_fit! of an EmpiricalPrior or a HighOrderPriorEstimator whose member already holds a state, for example EmpiricalPrior(; me = partial_fit!(SimpleExpectedReturns(), X1))Ran with no message. The warm member read its earlier rows as well as the new rows, and every other part of the prior read the new rows alone.Raises an ArgumentError that names the path of the state, such as me.cache. Pass the member with its cache at nothing.
cov or cor of ImpliedVolatility with no iv, or a prior that holds one over a ReturnsResult with no ivRaised an UndefKeywordError, or a TypeError on the keyword iv.Raises an IsNothingError that names iv and the two remedies: pass iv to cov or cor, or fit the prior on a ReturnsResult that carries iv.
cov or cor of ImpliedVolatility with a gap in ivRead past the gap and priced the asset.Raises an IsNonFiniteError.
A named Descriptor on an asset panel whose price, market capitalisation, share count or total assets is at or below zero at an active, observed cell: BookToPrice, CashFlowToPrice, SalesToPrice, EarningsToPrice, ForwardEarningsToPrice, DividendToPrice, ForwardDividendToPrice, ShareholderYield, MarketLeverage, DebtToAssets, GrossProfitability, ReturnOnAssets, AssetTurnover, CashFlowToAssets, AccrualsCashFlow, AnalystDispersionToPrice, ShortInterest, LogMarketCap, EarningsChangeToPrice, CapexToAssetsChangeInIntensity, EWShareTurnover or EWAmihudIlliquidityWrote NaN in the cell, and the asset left the cross-section of that observation with no message.Raises a DomainError that names the panel field, the observation and the asset. PanelFieldRatio, PanelFieldLog, ChangeToScale and ChangeInIntensity with no guard keep the NaN. The two EW presets take gt0 = nothing to keep it.
BookLeverage or MarketLeverage with a negative debt, GrossMargin with negative sales, or EWShareTurnover, EWAmihudIlliquidity or DaysToCover with a negative volume, share count, price or short interestGave a number or NaN with no message. EWShareTurnover read a negative volume into its state, and DaysToCover gave a negative value.Raises a DomainError. Zero sales still give NaN under GrossMargin. nonneg = nothing on the EW presets and on DaysToCover keeps the v0.32 numbers.
EWMacroSensitivity whose reference return holds an infinite valueRan.Raises an IsNonFiniteError that names the observation. A NaN is still a gap that the recursion skips.
A batch cross-validation of more than one fold over an estimator that holds a ReturnsTrackingRan. A fold whose training rows had the length of the series solved against other rows with no message.Raises an ArgumentError that names the field. Use DataBenchmarkTracking, WeightsTracking or a TimeDependent schedule of one series per fold.
partial_fit! of an optimiser that holds a ReturnsTracking, or a ReturnsTracking whose length is not the number of rowsRaised a DimensionMismatch from the solver on an expanding window. Under max_history it ran against rows that did not align.Raises an ArgumentError. An OnlinePortfolioSelection with a series in a risk ceiling or in a RiskLoss raises when you build it, where v0.32 raised at the first row.
A graph verb, such as clusterise, phylogeny_matrix or centrality_vector, over a prior result with a keyword other than ivpa, branchorder, strict and dims, for example brt = trueRan, and ignored the keyword.Raises a MethodError.
A graph verb over a prior result whose returns data rd has a gap in XRead the X of the prior, which fills the gap.Raises an IsNonFiniteError that names the asset. State x_src = PriorSource() on the estimator to read the prior.
A Pipeline with an uncertainty-set step whose target is not :mu, :sigma or :both, a bare uncertainty-set step, a writes that is not the slot of its estimator, or a nested Pipeline that writes a data slot againBuilt, and gave the wrong slots or failed later.Raises an ArgumentError when you build the pipeline.
NestedClustered whose inner optimiser holds a TimeDependent schedule of precomputed results, such as LinearConstraint valuesBuilt. The fit raised a DimensionMismatch when a constraint of the whole universe reached a cluster.Raises an ArgumentError when you build the estimator, as a precomputed result outside a schedule did in v0.32.
fit_preprocessing of a MissingDataFilter whose row filter keeps no observation of the training windowThe fit ran, and apply_preprocessing raised the IsEmptyError.The fit raises the IsEmptyError. Under alg = SinglePassFilter() the fit runs, as in v0.32.

Calls that now answer

Callv0.32v0.33
partial_fit! of a prior or of an optimiser, and optimise or partial_fit! of an OnlinePortfolioSelection head, on a ReturnsResult that carries ivArgumentError: the online step takes no implied-volatility surface.The step carries iv and ivpa with the returns, and optimise or prior with no data equals the batch fit over the folded rows.
Posdef, Denoise or Detone on a covariance with a constant asset, a zero varianceArgumentError: matrix contains Infs or NaNsThe zero row and column stay, and the step runs on the block of the positive variances. Denoise reads the ratio of observations to assets of the block.
A factor prior, Kurtosis or a norm-ball set on a singular positive semidefinite covariancePosDefExceptionThe eigen square root, under the default mtx_sqrt
A prior whose covariance has a CoveragePolicy, on two assets that each have a variance and share too few observations for a covarianceRaised an IsNonFiniteError from the matrix repair, because the pair is NaN inside the finite block.Warns, and answers on the other assets. The default peel = MinimalPeel() removes the fewest assets that leave no such pair, and each removed asset is no longer investable. strict = true refuses with an ArgumentError that names the assets. State peel = NoPeel() to keep the v0.32 refusal.
ConditionalValueatRisk, EntropicValueatRisk, ConditionalDrawdownatRisk, EntropicDrawdownatRisk, RelativeConditionalDrawdownatRisk or RelativeEntropicDrawdownatRisk with alpha = 0DomainErrorThe largest loss among the observations of positive weight. Unweighted, it is the value of WorstRealisation or MaximumDrawdown. Every other tail measure still takes 0 < alpha < 1.
Fees with a short fee s between -l and zeroDomainErrorThe short side earns the credit -s. s = -l is the linear fee l w. A value below -l is not convex, so it still raises a DomainError.
MaximumRatio with an ℓ1 constraint set or a fee, on a problem where the return form was infeasibleThe solve failed as infeasible.The ratio takes the risk form, so the problem solves.
MaximumRatio with BudgetCosts or BudgetMarketImpact at ohf = 1e-2 or aboveThe solve failed.The cost rows scale with the ratio variable, so every ohf solves to one ratio.
NestedClustered, Stacking or SubsetResampling on integer returnsInexactErrorThe weights of the returns as floating point numbers. A Rational return keeps its type.
MultipleRandomised with a window of all the observations, window_size == TArgumentError: range must be non-emptyOne window of every row.
EntropyPoolingPrior or MeucciEntropyPoolingPrior with a view over a prior with max_scenarios, such as EmpiricalPrior(; max_scenarios = 40) or a factor prior over oneDimensionMismatchThe moments of the scenarios under the posterior weights. The posterior gives no weight to an observation that the cap removed.
partial_fit! of a CrossSectionalFactorPrior, or of an optimiser that holds one, on returns data whose asset panel holds panel fieldsArgumentError: the online step carries a time-varying asset panel through its masks alone.The prior folds the rows. Under the default carry = FoldOrRefit(), a part that does not fold is fitted again over its rows, and prior or optimise with no data equals the batch fit over the folded rows.
CrossSectionalFactorPrior with c above one, for example c = 2.0DomainErrorThe prior scales the orthogonal part of the return forecast by c. A stated c is finite and at least zero.
exposure_coverage or factor_model_summary on a CrossSectionalFactorModel with no regression weights rwIsNothingError that names rwThe coverage over every asset.
TargetReturnForecast with a cross-validation in cv, on fewer than two valid samples per foldArgumentError: an out of fold calibration needs at least two samples per fold.Under the default warmup = NaNWarmup() the calibration coefficient is NaN. warmup = InSampleWarmup() calibrates on the in-sample predictions.
A CrossSectionalFactorPrior on a sub-universe in which one level of a factor has no member, for example inside NestedClustered or SubsetResamplingArgumentError: matrix contains Infs or NaNsThe empty factor has a zero return and no variance.
A FactorPrior whose pe has a scenario capRaised an error at the fit.Fits on the rows that the cap keeps.
factor_attribution(pred, pr) of a MultiPeriodPredictionResult with a prior fitted over the whole sampleRefused.Matches each fold to its block by a row key. The realised attribution of a block under a scenario cap answers too, where v0.32 raised a BoundsError.
SubsetResampling or MultipleRandomised on about 70 assets or more at their defaultsOverflowError, for example from binomial(100, 80)The weights of the resampled subsets. A Rational subset_size or window_size answers too, where v0.32 raised a MethodError.
An OnlinePortfolioSelection whose fallback needs rows, such as EqualWeighted, InverseVolatility, an optimiser with an estimator prior, or PreviousWeights(; fb = ...), when the fallback answersArgumentError or IsNothingError: the fallback got no rows, and a walk-forward stopped.The head steps its fallback on its rows, so the fallback answers as it does in a batch fit.
cross_val_predict(pipe, data, split(cv, data)) of a Pipeline with a combinatorial or a randomised splitA combinatorial split raised a MethodError. A randomised split gave one series over every asset.The same answer as the scheme passed directly. Resume(res) over MultipleRandomised raises an ArgumentError that names the cause, where v0.32 raised a MethodError.
fit_and_predict(res, prices) of a PipelineResult on price dataMethodErrorTakes the price data, as predict(res, prices) does.
A search over a field of FactorPrior, a Black-Litterman prior, an entropy pooling prior or a high order priorRaised an error from setproperties.Searches the field.
A covariance_forecast_evaluation step with no active assetRefused the whole evaluation.Keeps the step, with no score.
investable_risk_gradient on a panel that does not cover an assetDimensionMismatchThe gradient over the investable assets.
A histogram of returns with a zero interquartile range under FreedmanDiaconis(), or under Knuth()FreedmanDiaconis() raised InexactError: Int64(Inf). Knuth() searched with no upper bound, and on such data could exhaust the memory.FreedmanDiaconis() takes the range over five as the width, and Knuth() searches from one bin to T bins. A constant column has one bin.
AdaptiveSubgradient at delta = 0 when an asset has no gradient mass yet, because each of its price relatives so far is zero or because a RiskLoss reads a window that does not price itDomainErrorSteps. The raw step leaves the weight of that asset as it is, and the projection takes the limit of a positive diagonal: the assets with mass keep their projected weights, and the others take the rest of the budget nearest the raw step.
AdaptiveSubgradient, or a GramProjection, on a ProgrammeAllocationSet when the set of investable assets changes between stepsDimensionMismatchSolves over the investable assets.
std(ve::SimpleVariance, state) of a folded SimpleVarianceMethodErrorThe square root of var(ve, state).
risk_contribution or the finite-difference risk_gradient with integer weights, and risk_gradient of a vector of measures with integer weightsInexactErrorThe contributions or the gradient, in the type of the step delta.

Results that move

  • A clustering, phylogeny or centrality estimator at the default reads the returns data rd.X. v0.32 read the X of the prior, x_src = :prior. The two differ when the prior changes its returns: a factor prior gives a reconstruction of rank equal to the number of factors, a prior with a scenario cap keeps fewer rows, and a prior that fills a gap writes a value where the returns data holds none. State x_src = PriorSource() on the graph reader to keep the v0.32 numbers. Under a prior whose moment estimators carry a CoveragePolicy, an asset that has a gap in the rows that the graph reader reads now gets a zero weight, and the optimiser warns once and names the asset, because the default ce of a graph reader has no CoveragePolicy. State the same CoveragePolicy on the ce of the graph reader, or x_src = PriorSource(), to keep the asset.
  • Every regime statistic of RegimeAdjustedExpWeightedVariance and RegimeAdjustedExpWeightedCovariance divided a realised square by an estimated variance, and the inverse of an estimate is too large on average. So under a correctly calibrated model the regime multiplier read the risk too large. Under the default method the variance was 1.3 % too large at the default half-life of 40, and 5 % too large at a half-life of 10. A MahalanobisTarget block with fewer observations than assets gave a statistic of about 1e12. The statistic now divides by the exact bias that its method reads. Every default fit of a CrossSectionalFactorPrior moves, because its ve is a regime-adjusted variance and its pe holds a regime-adjusted covariance.
  • The default location of ExpWeightedVariance, ExpWeightedCovariance and the two regime-adjusted estimators started at zero and was not divided by the sum of its weights, so it estimated (1 - λ^k) times the mean, and its deviations kept part of the mean. The variance was 2.4 % to 36 % too large in the warm-up, and 3.5 % too large at a half-life of 10 after it. The default EstimatedCentring() takes the normalised exponentially weighted mean, and divides each squared deviation, or product of a pair, by its exact factor 1 + 1 / n_eff, or 1 + c_ij. The estimate is unbiased from the second valid return, and the first return of an asset gives no term, so an asset needs two valid returns. Under HAC the factor also reads the mean of each lagged product. ZeroStartCentring() gives the v0.32 location and its numbers. PreCentred() does not move. The defaults of ce, ve and pe of CrossSectionalFactorPrior use it now, but in v0.32 only ce did. The bullet on CrossSectionalFactorPrior below gives the v0.32 defaults.
  • ExpWeightedCovariance and RegimeAdjustedExpWeightedCovariance divide each pair by its own weight. On a holiday, v0.32 shrank each correlation that met the holiday towards zero, and on the separate correlation path a late listing shrank each correlation of the late asset towards zero. A sample with no holiday and no late listing keeps its numbers.
  • The two regime-adjusted estimators clamp the multiplier of an estimate only. v0.32 also clamped the multiplier of one before regime_min_obs, and the multiplier of regime_method = nothing, so a clamp with a lower bound above one inflated a variance that had no regime estimate.
  • RegimeAdjustedExpWeightedCovariance with a separate cor_decay reports the variance 0 for a constant asset, where v0.32 reported min_val.
  • Every default fit of a CrossSectionalFactorPrior moves. On one panel of 60 assets and 300 observations, mu moved by 82 % of its largest entry and sigma by 16 %. The new defaults that Renamed keywords and changed defaults lists cause most of it. These corrections also move a fit, and no keyword undoes them:
    • The idiosyncratic variance and the regime statistic read the active mask and the estimation mask. An asset that delisted and listed again kept its variance over the inactive stretch in v0.32, and the regime statistic read active assets outside the estimation universe.
    • The prior divides the weights of the scenarios of its factor prior by their sum.
    • Each asset reads the factor moments only on the support of its loadings, so a factor with no moment changes no asset with a zero loading on it, and the investable set holds each asset whose loadings read only factors with moments. The fit refuses only when no asset has such loadings.
    • An asset in the warm-up of its variance has a finite mean and finite systematic covariances. v0.32 wrote NaN over its whole mean, row and column. The asset is still not investable, because its variance is not finite.
    • The idiosyncratic correlation under a threshold th above zero reads the residuals with no fill. v0.32 read the residuals that the scenarios read, which fill a holiday or a late listing with the mean of the other assets, and so correlated the asset with each of them.
    • A return forecast with min_obs = 1 gives a forecast earlier in the history, and TargetReturnForecast calibrates prequentially. See the two bullets on them above.
  • An unseen member of a constrained factor family has a return of zero. The exposures lag the returns, so the zero-sum condition of an observation reads the benchmark weights of the observation before it. When the last asset of a member leaves the sample, the condition still weights the member, and the design is rank deficient. In v0.32 the solve algorithm of cre then gave the member a return that depended on the dropped member of the family. Under unseen = ZeroUnseenMember() the member has a return of zero at that observation, and the condition holds over the other members. The factor returns, mu and sigma move only on a panel with such an observation. State unseen = SolvedUnseenMember() to keep the v0.32 numbers.
  • A CrossSectionalFactorPrior reads the residual of an asset that is alone in its level as a gap. When an asset is the only member of its level of a one-hot factor at an observation, the regression fits its return exactly, so its residual is zero whatever the return. v0.32 divided that zero by the variance of the asset, so an asset with a positive variance got a scaled residual of zero, and an asset with a zero variance got the mean scaled residual of its observation. v0.33 gives every such asset that mean in the scenarios X, and the idiosyncratic correlation leaves it out, so sigma moves under a threshold th above zero. A design in which every such asset has a zero variance keeps its numbers, and so does a design with no such asset. State l1mask = UnmaskedLeverageOne() to keep the v0.32 numbers.
  • The chi-squared radius of a full covariance set reads N(N + 1) / 2 degrees of freedom, the free entries of a symmetric matrix. This moves the Normal ellipsoid, the Normal norm ball and the bootstrap ellipsoid under diagonal = false. v0.32 read N², so the set was too large for its level: at N = 5 and q = 0.05 the radius was 6.136 and now is 5.000, and the old set covered 0.999 of the errors at a stated 0.95. A bootstrap ellipsoid with M resamples reads at most M - 1 degrees of freedom, on both axes. State ChiSqKUncertaintyAlgorithm(; ambient = true) to keep the v0.32 numbers. The default diagonal = true and the bootstrap norm ball do not move.
  • The view of a CompactCovarianceUncertaintySet is the projection of the set. A hierarchical or clustered optimiser takes this view of a set that you fit before. v0.32 fitted the basis again on the view, so a cluster portfolio paid less than the full set charges it, by 6.9 % and 14.9 % of the penalty on two examples. Now it pays what the full set charges it. An OrthogonalUncertaintySet estimator inside the optimiser still fits on the data of the cluster.
  • A covariance or a correlation with a CoveragePolicy peels the assets of an undetermined pair. v0.32 wrote NaN at the cell of a pair whose assets share too few observations, and kept both assets. v0.33 removes the assets that the peel rule chooses, writes NaN across the row and the column of each, and warns with their indices. The mean and the variance do not move. A call with no such pair keeps its numbers. On a fold, the peel runs each time the folded estimator answers, on the counts folded so far, so a walk-forward warns at each step that has such a pair, and the removed set can change from one step to the next. State peel = NoPeel() to keep the v0.32 numbers.
  • The default leaf order is the exact optimal order. clusterise, the phylogeny estimators, DBHT and every hierarchical and meta-optimiser at the default branchorder = :optimal can give another order of the leaves. The order is the input of the recursive bisection, so the weights of HierarchicalRiskParity and of the Schur complement optimiser can move. The clusters and every cut do not move. State branchorder = :barjoseph to keep the v0.32 numbers.
  • An empirical Value at Risk reads the upper alpha-quantile of the returns. ValueatRisk and ValueatRiskRange under the default MIPValueatRisk(), DrawdownatRisk and RelativeDrawdownatRisk take the order statistic at position floor(alpha T) + 1, the definition of Equation 7.50 of [12]. v0.32 took the position floor((alpha - s) T) + 1 with the slack s = 1e-5. The two positions differ when alpha T is an integer, for example at the default alpha = 0.05 on 100, 200 or 1000 observations, where the value moves by one order statistic: on 100 normal returns from 1.727 to 1.596. They also differ when the fractional part of alpha T is below 1e-5 T, so on 100 000 observations or more the value moves at every alpha. The risk of the MIP model moves in the same way, so the weights of an optimiser that reads one of these measures can move. With observation weights, the position is the first one whose cumulative weight exceeds alpha times the total weight, where v0.32 took the first one that reached it. The default s is now 1e-9, and the cardinality row of the MIP adds it to alpha, where v0.32 subtracted it. The conditional measures do not move. No keyword gives the v0.32 position.
  • MaximumRatio with a variance on the lifted weight matrix maximises the Sharpe ratio. This is a Variance that the model states on the lifted matrix W, or a box, ellipsoid or norm-ball UncertaintySetVariance. v0.32 divided the excess return by the variance, not by its square root, so the weights moved. Risk contribution rows rc under MaximumRatio now relax as they do under MinimumRisk. State ratio_alg = LinearRatio() to keep the v0.32 ratio. It gives the v0.32 weights to about 2e-4.
  • A weighted LinearModel or GeneralisedLinearModel scales its weights to their Kish count. GLM reads weights as frequencies, so v0.32 read probability weights that sum to one as one observation: every p-value was 1, and the AIC and the BIC read n = 1. A StepwiseRegression inside an entropy pooling or opinion pooling prior then kept one factor for each asset. The coefficients do not move, but the selected factor sets, the p-values, the AIC and the BIC do. FrequencyWeights keep the v0.32 numbers.
  • CombinatorialCrossValidation puts every trailing row in the last fold. When mod(T, n_folds) >= div(T, n_folds), v0.32 put a trailing row in no fold, so the row was in every training set and in no test set: row 13 of 13 at n_folds = 5. The splits move in that case only.
  • The factor attribution of a held asset in the warm-up of its variance. Under the default unknown = EntrywiseUnknown() its exposures and its systematic numbers stay, and each number that reads the unknown variance is NaN, where v0.32 set the whole row to zero. The split and the standard error of a pair of leverage one are NaN, and a pair with no idiosyncratic return adds nothing to any component. A static loadings matrix reads every observation at any lag, and trim = true cuts it. A held asset with no return on an active cell is a holiday. A held asset that is not active warns, or raises under strict = true. The predicted totals set to zero the row of an asset that is not investable. No keyword gives the v0.32 numbers.
  • The readers of an asset panel read only the active, observed cells. FeatureDistance reads each asset and each pair at its own active rows, and an asset that it cannot read leaves the investable set at a fit. The panel collapse of NestedClustered and Stacking weighs only the members that are active at each observation, under pcol = RenormaliseActive(). A panel with no inactive and no unobserved cell keeps its numbers.
  • A RiskLoss reads the last window rows when its head holds more rows. A tracking or turnover ceiling in a ProgrammeAllocationSet with fixed = false follows the allocation of each step, where v0.32 held the weights that you passed.
  • A forecast evaluation keeps the weights of its book after a date with no asset that it can score, so the turnover of the book moves.
  • ForwardPanelFill and BackwardPanelFill stop at the edge of a stretch in which the asset is not active. v0.32 walked each column over the whole axis, so an asset that delisted and listed again took, at a blank first cell of its second listing, the last value of its first listing, and lim counted the inactive cells as part of the run. A column with one stretch of activity keeps its numbers.
  • opt_weight_bounds with a JuMPWeightFinaliser leaves your weight vector unchanged. Under the two relative formulations v0.32 wrote eps into each zero entry of the vector that you passed: [0.7, 0.3, 0.0] became [0.7, 0.3, 2.2e-16].
  • The cross-sectional diagnostics return a FactorDiagnosticResult. exposure_coverage and the other diagnostic verbs over a CrossSectionalFactorModel returned a Vector in v0.32. The vector is now the field X of the result, which also holds the names and the families of the factors.
  • prices_to_returns computes each return from the change in price, (p_t - p_{t-1}) / p_{t-1}, and the log return as log1p of it. v0.32 took the simple return through a logarithm and lost about three bits, and its log return cancelled. Each return can move in its last bits, and so can each value computed from it.
  • MaximumRatio with an ℓ1 constraint set or a fee takes the risk form. Both forms state one optimum, so a problem that solved in v0.32 keeps its ratio, and its weights can move within the tolerance of the solver.
  • MaximumRatio with BudgetCosts or BudgetMarketImpact solves for weights that no longer move with ohf. v0.32 gave sum(w) + cost of 0.877 at ohf = 2.5e-4 and 0.970 at ohf = 1e-3, where the budget states 1.
  • BudgetMarketImpact under a constraint scale sc other than one. The power cone of the charge did not scale its middle entry, so the charge grew by sc^((1 - beta) / beta), and the weights stayed near the start portfolio w. At the default sc nothing moves.
  • The mean of BodnarOkhrinParolya divides its beta by the quadratic form of the target, as equation 7 of [58] states, where v0.32 divided by that of the sample mean. Every target of the library is a multiple of the vector of ones, so the three targets now give the same estimate.
  • The monotonic search of the Schur complement optimiser refines below tol and reaches the boundary where the augmented block stops being positive definite, so its gamma can move to a value of lower variance. A repaired block is written back after the repair, so a later split augments the repaired block.
  • UlcerIndex and RelativeUlcerIndex read the weights of the prior, as every other drawdown measure does. Under a weighted prior the index moves. Under no weights it does not.
  • The blended inverse-variance weights of a CrossSectionalFactorPrior with zero variances take the limit as those variances go to zero. With half or more of the variances of an observation zero, v0.32 dropped the inverse-variance part of the row, so the row summed to 1 - lambda, and with every variance zero it took the cap weights alone. A quantile level of the clamp that lands on an order statistic beside a zero variance gave no bound, and now gives that order statistic.
  • MultipleRandomised draws each start of a window, the last one included. A seeded draw can move.
  • An entropy pooling prior over a factor prior keeps the model of the fit that its views read. EntropyPoolingPrior and MeucciEntropyPoolingPrior over a FactorPrior or a FactorBlackLittermanPrior fitted the regression again under the posterior weights, so the scenarios moved, and a mean view missed mu: a view of 0.004 read 0.0040224 on one example. The posterior now weighs the same scenarios and keeps the loadings, the intercepts and the residual variances, so each mean view holds on mu. A nested entropy pooling prior or opinion pool keeps its model and does not solve its views again.
  • A high order prior fits its coskewness and cokurtosis under the weights of the prior that it wraps. Over an entropy pooling prior or an opinion pool, HighOrderPriorEstimator and HighOrderFactorPriorEstimator fitted them with no weights, so a skewness or kurtosis view reached no co-moment. HighOrderFactorPriorEstimator also takes off the residual variances that the prior added, where it measured them again. Under equal weights nothing moves.
  • A prior(...) reference in a skewness or kurtosis view reads the weights of the prior. In EntropyPoolingPrior and MeucciEntropyPoolingPrior, v0.32 read the skewness or the kurtosis of the reference from the scenarios with no weights. It now reads them under the prior probabilities w with H0_EntropyPooling, and under the weights of the prior of the stage with H1_EntropyPooling and H2_EntropyPooling, as a value at risk reference does. A view such as sk_views = LinearConstraintEstimator(; val = "A1 == prior(A1) * 1.2") then states a different target, so the posterior moves.
  • The covariance of an entropy pooling or opinion pooling posterior takes the correction of reliability weights, 1 / (1 - sum(p .^ 2)), where v0.32 took T / (T - 1). Under a view, sigma grows by the factor (n_eff / (n_eff - 1)) / (T / (T - 1)), with n_eff = 1 / sum(p .^ 2): by 2.2e-3 with one mean view on 60 observations. The posterior weights are AnalyticWeights. Give the prior w = pweights(...) to keep the v0.32 correction. With no view nothing moves.
  • MissingDataFilter reads the column shares again over the observations that its row filter keeps, until no asset drops. v0.32 read them one time, over the whole training window. So when row_thr dropped an observation, a kept asset could miss more than col_thr of the observations that stayed. The universe moves only when both thresholds are below one and the row filter drops an observation. alg = SinglePassFilter() gives the v0.32 universe.
  • A DateWalkForward drops a fold whose test window holds no row. Two dates of the range map to one row when the data has no row between them, for example the two days of a weekend under period = Day(1) over business days. v0.32 returned and counted such a fold: DateWalkForward(5, 1; period = Day(1)) over the weekdays of 2024 Q1 gave 83 folds, and 24 of them tested no row. v0.33 gives the 59 folds that test a row, and n_splits counts them.
  • A date of a DateWalkForward range after the last timestamp ends the range under previous = true too. A positive period_offset, or an adjuster, can make such a date. v0.32 mapped it to the last row, so the last fold counted as full and its test window left out the last row: DateWalkForward(2, 1; period = Day(3), period_offset = Day(2), previous = true) over 20 daily rows tested [7:9, 10:12, 13:15, 16:18, 19:19]. v0.33 tests [7:9, 10:12, 13:15, 16:18], as v0.32 did under previous = false. State reduce_test = true to test the last rows, 19:20.
  • DimensionReductionRegression fixes the sign of each component. Each column of the loadings L whose sum is negative changes sign, so the fit no longer depends on the sign that the projection returns. v0.32 kept that sign. The factor risk contributions and the span of the loadings do not move. The "loadings" field of a RegressionPanel, and the factor weights that FactorRiskBudgeting and FactorRiskContribution read under this regression, can move.
  • AdaptiveSubgradient takes the step of a zero gradient in its own norm. A RiskLoss gives a zero gradient while the head holds fewer than two rows. v0.32 took the Euclidean projection of the weights at such a step. v0.33 projects in diag(delta + s). While no asset has mass that norm is a multiple of the identity matrix, so the step is the Euclidean projection, except on a ProgrammeAllocationSet with a penalty in its objective: there the weight of the penalty against the distance changes, and at delta = 0 the step minimises the penalty and takes the weights nearest the raw step among its minimisers.
  • A projection in the entropic, Tsallis or log-barrier geometry on a ProgrammeAllocationSet sets each weight at or below sqrt(eps) to its floor, zero unless the set states a positive floor. v0.32 raised only a negative weight to zero, so the sign of the rounding of the solver decided whether a weight that the set forces to zero could recover. Such a weight is now zero whatever the sign of the rounding, and it stays at zero.
  • risk_contribution and the finite-difference risk_gradient keep their step under a narrow weight type. v0.32 rounded the step to the type of the weights: with Float32 weights each contribution was about 1.3 % off, and with Float16 weights each contribution was zero. v0.33 returns the vector in the type of the weights promoted with the step delta, a Float64 by default.
  • EntropyPoolingPrior and MeucciEntropyPoolingPrior leave the weights w that you pass as they are. v0.32 normalised a mutable w in place when you built the prior, so v = [1.0, 3.0]; EntropyPoolingPrior(; w = pweights(v)) changed v to [0.25, 0.75]. v0.33 builds new weights of the same kind. The prior does not move.
  • A w that you pass to an entropy pooling prior over a nested pooling prior is the prior of the innermost scenarios. In EntropyPoolingPrior and MeucciEntropyPoolingPrior the nested prior solves its views from your w, and the outer prior solves its own views from the nested posterior, as it does when you pass no w. v0.32 solved the outer views from your w, so the views of the nested prior did not reach the posterior. A nested prior that does not reweight its scenarios, such as EmpiricalPrior, keeps your w, and its result does not move.

If you extend the library

  • A centring, a debias rule, a HAC floor, a rule for the timing of the volatility, a rule for the volatility of the separate correlation path, a rule for an indefinite block or a rule of the level recursion of the Mahalanobis target of your own subtypes AbstractCentring, AbstractRegimeDebias, AbstractHacFloor, AbstractHacVolatilityTiming, AbstractCorrelationVolatility, AbstractIndefiniteBlockRule or AbstractLevelRecursion, which are public. A centring implements the verbs that the # Interfaces section of AbstractCentring names. One of them, centring_law, names the law of the deviations that the bias tables of a regime-adjusted estimator read: PreCentred() or EstimatedCentring(). A centring with a law of its own returns itself, and adds a method of regime_bias_table and of mahalanobis_level_bias, which are public, for that law. A debias rule implements debiases and reads_dependence, a HAC floor implements hac_floor!, a timing rule implements volatility_before_update, a rule for the volatility of the separate path implements correlation_variance, a rule for an indefinite block implements indefinite_block, and a rule of the level recursion implements mahalanobis_recursion_ratio.

  • A prior of your own states its source with a method of returns_source, which is now public. A prior with no method reads the raw returns.

  • LowOrderPrior has the fields x_src, ss_gaps and pc after fpr, so its positional constructor takes three more arguments. prior over a ReturnsResult, and the result that an online fold gives, record in x_src the source of the prior. A returns-matrix method records nothing. A Prior Result of your own records no source, and an optimiser reads its returns as raw.

  • CoveragePolicy has a field peel after alg, so its positional constructor takes three arguments. The keyword constructor does not change. A peel rule of your own subtypes AbstractPeel, which is public, and implements peel_assets.

  • CrossSectionalFactorPrior has twelve more fields, so its positional constructor takes 31 arguments, where v0.32 took 19. The new fields are unseen after families, pdm after ce, srep after mp, and ofit, l1mask, lx, mtx_sqrt, ex, choice, carry, cache and x_src after c. A method that dispatches on the position of a type parameter after families moves. The keyword constructor keeps every v0.32 keyword.

  • The thirteen estimators that take mtx_sqrt, NormalUncertaintySet, which takes dc, and ChiSqKUncertaintyAlgorithm, which takes ambient, each have one more field, so their positional constructors take one more argument. Variance and UncertaintySetVariance also have ratio_alg and corner after mtx_sqrt, so they take three more. The keyword constructors do not change.

  • CompactCovarianceUncertaintySet has a field R after Q, the factor of the rows that a view drops. A fitted set has no row in it, and the four-argument call (kappa, C, Q, val) keeps its meaning. A consumer of your own reads the penalty min_z ‖C w − Q z‖² + ‖R z‖².

  • A radius algorithm of your own subtypes AbstractUncertaintyKAlgorithm and receives the dimension of the set as a fifth argument df. An ellipsoid calls k_ucs and a norm ball calls k_norm_ball, which is now public, so an algorithm that a norm ball reads implements both.

  • UlcerIndex and RelativeUlcerIndex have a field w after settings, so their positional constructors take two arguments. The keyword constructors do not change.

  • A rule for the diagonal of the Normal covariance set subtypes AbstractDiagonalConstruction and implements diagonal_sigma_shape, which are public. A square-root algorithm subtypes AbstractMatrixSquareRootAlgorithm, which is public, and implements matrix_square_root.

  • A regression target of your own subtypes AbstractRegressionTarget, which is now public, and implements the verbs that its # Interfaces section names. CrossSectionalTargetRegression calls factory(tgt, w) at each observation, and a target with no such method raises an ArgumentError that names the method. v0.32 called the generic factory, which returned the target unchanged, so the fit ignored the cross-sectional weights with no message. StepwiseRegression and DimensionReductionRegression take a target of your own, where v0.32 read tgt.kwargs and raised a FieldError when you built the estimator. DimensionReductionRegression reads the weights of the target with regression_target_weights, which is public.

  • A matrix processing estimator of your own that a factor prior repairs under implements matrix_processing_posdef, which is public. It gives the positive definite matrix estimator of the repair, or nothing to skip it. v0.32 read the field pdm of the estimator by name. CrossSectionalFactorPrior, and FactorPrior and FactorBlackLittermanPrior with rsd = true, now raise an ArgumentError when you build them over a type with no method.

  • A cokurtosis estimator of your own in HighOrderFactorPriorEstimator implements cokurtosis_processor, which is public, to give its matrix processing estimator, and cokurtosis_expected_returns for rsd = true. v0.32 read the field mp of the estimator by name, so a type with an mp field was processed, and a type with no mp field raised a FieldError when it was fitted. HighOrderFactorPriorEstimator now raises an ArgumentError when you build it over a type with no cokurtosis_processor method, under every rsd. A method that returns nothing skips the processing and, under rsd = true, the repair.

  • ReturnsResult has the fields ne and E, the exogenous series, after B, so its positional constructor takes 12 arguments, where v0.32 took 10. PredictionReturnsResult has ne and E too, and PricesResult has E. The keyword constructors do not change.

  • More fields, so more positional arguments. These types of v0.32 have new fields, and their keyword constructors keep every v0.32 keyword:

    • The fourteen covariance estimators CorrelationCovariance, DistanceCovariance, GeodesicShrinkageCovariance, ImpliedVolatility, LowerTailDependenceCovariance, MutualInfoCovariance, RankOneCovariance, GerberCovariance, GerberIQCovariance, SmythBrobyCovariance, KendallCovariance, SpearmanCovariance, WindowedCovariance and WindowedVariance, and the windowed expected returns, coskewness and cokurtosis, have cache.
    • RegimeAdjustedExpWeightedVariance has hac_floor and debias. RegimeAdjustedExpWeightedCovariance has hac_floor, hac_vol_before, cor_vol and debias. In both, and in ExpWeightedVariance and ExpWeightedCovariance, centring replaces centred. PortfolioTarget has indefinite.
    • CrossSectionalLinearRegression has ex, and CrossSectionalTargetRegression has alg and ex. StepwiseRegression has choice, included and x_src, and DimensionReductionRegression has choice, proj and x_src.
    • DescriptorScores has nw after neutralise, and ex. TargetReturnForecast has warmup after cv, and intercept.
    • The Descriptors that fold have cache. PanelFieldRatio, PanelFieldLog, ChangeToScale and ChangeInIntensity have gt0. EWVolumeRatio has nonneg and gt0, and DaysToCover has nonneg. Each new guard defaults to no guard. EWMacroSensitivity has series after mcap.
    • The results CrossSectionalFactorModel (unseen, fx, fr, lambda, c, idx, ts, amr and hist), CrossSectionalRegression (h1, dc and lv), Regression (idx and ts), PredictionResult (idx), TargetReturnForecastResult (ocalib), FactorSummaryResult (nf and fam) and CovarianceForecastSummaryResult (step_weighting).
    • MissingDataFilter has alg after row_thr, so its positional constructor takes four arguments.
  • A new order of the fields, so a new order of the positional arguments. Four types of v0.32 list their fields in a new order that wastes no padding, and their keyword constructors do not change. HindsightSplit takes start before prefix. It has seven fields, as in v0.32, so a v0.32 positional call such as HindsightSplit(true, 21, nothing, nothing, nothing, false, false) still builds a split, with start = true and prefix = 21, and raises a TypeError only when the split runs. Write the call with keywords. JuMPOptimiser has xbgt after linf, FactorBlackLittermanPrior has rsd after ve, and TargetReturnForecast has whole_history and calibrate after unit.

From v0.33 to v0.34

Names that were removed

  • AllocationSetConstraint. The re-solve of a FollowTheLeader rule with a JuMP leader passes the allocation set of the head, the set in which every allocation of the head lies, as a second block of the entry of the leader, and the type is gone. A custom constraint of yours that wrapped a set for a JuMP head of your own passes the set to the entry instead: optimise(opt, rd; blocks = ((factory(set, w), X),)), with the rows X that the set reads. append_custom_constraint, the prefix :aset_ and the rule "state a kind on the set or on the held optimiser, not on both" go with it. A kind on both now gives two constraints.
  • reduce_loadings of a stack. Write reduce_exposures(fcb, Ms) for a stack of loading matrices, assets × factors × observations. reduce_loadings(fcb, M, t) takes one loading matrix alone, and a stack raises a MethodError. The numbers do not move.
  • expand_factor_mu. Write expand_factor_returns(fcb, mu, t) for a factor mean vector mu at observation t. Without t, the vector takes the ratios of the last observation, as before. Write expand_factor_returns(fcb, M) for a matrix M that holds one mean per observation, one per row. expand_factor_returns takes both forms, and the numbers do not move. A call of expand_factor_mu raises an UndefVarError.
  • factory_child. Write factory(x, args...; kwargs...). factory is a traversal, so it returns every value that has no method of its own with no change, as factory_child did: a data field, a number, nothing, a set of observation weights and a covariance estimator of StatsBase. It rebuilds an array of estimators, algorithms, results or covariance estimators element by element, in an array of the same shape, and it returns an array of data with no change. A call of factory_child raises an UndefVarError.
  • orthogonal_forecast_result and orthogonal_forecast_step. An orthogonal forecast fit of your own states the regression that the member reads, with orthogonal_forecast_regression(ofit::MyRule, cre), which returns cre or nothing. The prior calls return_forecast(rfe, rd, csfm, orthogonal_forecast_regression(ofit, cre)) in the batch fit, and return_forecast_step with the same last argument in the carry fold. A rule that changes the fit of the member in another way returns its own return forecast estimator from orthogonal_forecast_member. Write return_forecast(rfe, rd, csfm, cre) where v0.33 wrote orthogonal_forecast_result(OrthogonalPartCalibration(), rfe, rd, csfm, cre). The numbers do not move. A call of either removed name raises an UndefVarError.
  • The internal steps of the exponentially weighted beta Descriptors. EWBlockState, ew_beta_series, ew_beta_series!, ew_beta_reset!, ew_beta_output, ew_agg_series, ew_agg_vector, ew_beta_expand, ew_block_rows, ew_block_state, ew_block_copy, ew_beta_residual_variance, ew_active_returns, ew_macro_sensitivity_state, ew_macro_sensitivity_series! and ew_macro_carried are gone. Write ew_beta_state and ew_regression_series! for the regression of the returns on the market, write PortfolioOptimisers.CarriedReference(st) for the counts that an EWMacroSensitivityState carries, and read EWBetaState, EWMacroSensitivityState and EWDownsideBetaState for the carried states. See If you extend the library.
  • OrderedWeightsArrayConditionalValueatRiskRange and OrderedWeightsArrayTailGiniRange. Write OWA_CVaR_RG(; alpha, beta) where v0.33 wrote OrderedWeightsArray(; w = OrderedWeightsArrayConditionalValueatRiskRange(; alpha, beta)), and OWA_TG_RG(; alpha_i, alpha, a_sim, beta_i, beta, b_sim) for the tail Gini range. The two functions take the keywords and the defaults of v0.33, and they return an OrderedWeightsArrayRange, where v0.33 returned an OrderedWeightsArray. To build the range yourself, give the gain tail reversed: OrderedWeightsArrayRange(; w1 = OrderedWeightsArrayConditionalValueatRisk(; alpha), w2 = reverse ∘ OrderedWeightsArrayConditionalValueatRisk(; alpha = beta)), and the same with two OrderedWeightsArrayTailGini tails. owa_cvarrg and owa_tgrg still give the weights of each range. A call of either removed name raises an UndefVarError.
  • StandardisedHighOrderMoment. Write HighOrderMoment(; alg, ve) where v0.33 wrote HighOrderMoment(; alg = StandardisedHighOrderMoment(; ve, alg)). The default ve of the wrapper was SimpleVariance(; me = nothing), so HighOrderMoment(; alg = FourthMoment(), ve = SimpleVariance(; me = nothing)) gives the v0.33 value of HighOrderMoment(; alg = StandardisedHighOrderMoment(; alg = FourthMoment())). The default ve = nothing of HighOrderMoment gives the raw moment, as v0.33 did with no wrapper. The numbers do not move. A call of the removed name raises an UndefVarError.
  • Eleven singletons that stated a skipped step. Write nothing where v0.33 wrote the singleton: NoHacFloor() in hac_floor, RawStatistic() in debias and RawVolatility() in cor_vol of the regime-adjusted moments, NoPeel() in peel of CoveragePolicy, NoSlack() in slack of PassiveAggressiveMeanReversion, PlainGradient() in grad of MirrorDescent, ExponentiatedGradient and GradientProjection, NoPanelFill() in alg of a panel input, IdentityScaling() in scaling and IdentityMetric() in metric of OrthogonalUncertaintySet, IdentityMetric() in weighting of the forecast evaluation, NoSystematicRepair() in srep of CrossSectionalFactorPrior, and NoDecay() in decay of Proximity. Where the singleton was the default, the default is now nothing. The numbers do not move. A call of a removed name raises an UndefVarError.
  • AbstractLastObservationAlgorithm, and LastObservation as a holder. LastObservation is an abstract type with the two members LastRow and LastActiveRow. It is public, and it is not exported. Write LastRow() where v0.33 wrote LastObservation(), and LastActiveRow() where v0.33 wrote LastObservation(; alg = LastActiveRow()). AbstractLastObservationAlgorithm, the bound of the old field alg, is gone. A call of PortfolioOptimisers.LastObservation() raises a MethodError, and the bare name LastObservation raises an UndefVarError.
  • The sequential and the grid tail views of entropy pooling. Write SequentialTailView(; iters, tol) where v0.33 wrote SequentialConditionalValueatRiskView, SequentialEntropicValueatRiskView or SequentialRelativisticValueatRiskView with the same keywords. Write GridTailView(; pct, K, M, iters, tol, tilt_iters) where v0.33 wrote GridEntropicValueatRiskView or GridRelativisticValueatRiskView with the same keywords. The tail measure of the view selects the formulation, so one type serves each measure. The numbers do not move. A call of a removed name raises an UndefVarError.
  • The four error weight finalisers. Write ErrorWeightFinaliser() where v0.33 wrote RelativeErrorWeightFinaliser(), ErrorWeightFinaliser(; alg = L2Norm()) for SquaredRelativeErrorWeightFinaliser(), ErrorWeightFinaliser(; dev = AbsoluteWeightDeviation()) for AbsoluteErrorWeightFinaliser(), and ErrorWeightFinaliser(; alg = L2Norm(), dev = AbsoluteWeightDeviation()) for SquaredAbsoluteErrorWeightFinaliser(). The model of a DiscreteAllocation registers the error row as cerr, where v0.33 registered cabs_err, csqabs_err, crel_err or csqrel_err. The weights and the shares do not move. alg also takes LInfNorm() and LpNorm(; p) with p > 1, and LpNorm(; p = 1) raises a DomainError. A call of a removed name raises an UndefVarError.
  • OptimisticStep. Write MirrorDescent(; predictor = LastGradient()) where v0.33 wrote OptimisticStep(), and GradientProjection(; eta, predictor) where v0.33 wrote OptimisticStep(; alg = GradientProjection(; eta), predictor). The predictor is a field of the rule, and its default nothing gives no optimistic step. A transform of the gradient, such as GradientMomentum(), beside a predictor raises an ArgumentError, as the wrapper refused it. The paths do not move. A call of the removed name raises an UndefVarError.
  • OptimisationCrossValidation. NestedClustered and Stacking hold cv and scorer as two fields. Write NestedClustered(; cv, scorer, …) where v0.33 wrote NestedClustered(; cv = OptimisationCrossValidation(; cv, scorer), …), and the same for Stacking. The default of the wrapper was cv = KFold(), so write cv = KFold() where v0.33 wrote cv = OptimisationCrossValidation(). The weights do not move. Calls that now raise lists the pairs that the constructors refuse. A call of the removed name raises an UndefVarError.
  • ElasticNetPath. The elastic net is a regression target. Write ElasticNet(; theta, strength = MiddleOfPath(; ratio), iters, tol) where v0.33 wrote ElasticNetPath(; theta, ratio, iters, tol), and KernelTrendPattern(; tgt) where v0.33 wrote KernelTrendPattern(; path). The defaults are those of v0.33, so ElasticNet() fits as ElasticNetPath() did. KernelTrendPatternTracking also takes ratio. On 200 problems the coefficients do not move. KernelTrendPattern() does not move at theta < 1 on the cases measured, and at theta = 1 it moves by 1e-14 relative at most. As a target, ElasticNet also enters StepwiseRegression under crit = :aic, :aicc or :bic, and DimensionReductionRegression. A call of the removed name raises an UndefVarError, and the keyword path raises a MethodError.
  • The keyword and field ucs_flag of NearOptimalCentering, and the flag slot of no_bounds_risk_measure and no_bounds_no_risk_expr_risk_measure. The copies without bounds that the anchors and the unconstrained centring model read keep the uncertainty sets of the risk measures and of the return terms. expected_risk of an UncertaintySetVariance and expected_return of an ArithmeticReturn with a fitted set give the worst case over the set, so each anchor is a value of the expression that the model bounds. With ucs_flag = false, v0.33 solved the anchors of minimum risk and of maximum return on the nominal moments. It computed the bounds of the region with the sets, and the centring model of UnconstrainedNearOptimalCentering read the nominal moments. So the bounds of the region did not match the expressions of its model. The removal does not move the numbers of the default ucs_flag = true. A return term with a fitted set moves the anchors, as Results that move states for expected_return. To centre on the nominal moments, write Variance() in place of the UncertaintySetVariance, and give the ArithmeticReturn no ucs. The keyword ucs_flag raises a MethodError, and so does a second argument to no_bounds_risk_measure or no_bounds_no_risk_expr_risk_measure.

Renamed keywords and changed defaults

  • PanelFieldTarget takes fields, where v0.33 took name. The field takes one field of the asset panel, a sum or a product of fields, or a descriptor estimator such as EWVolumeRatio(), as the fields of PanelFieldScorer does, and a sum, a product or an estimator is not a name. Write PanelFieldTarget(; fields = "market_cap") where v0.33 wrote PanelFieldTarget(; name = "market_cap"), and read target.fields where v0.33 read target.name. The v0.33 keyword raises an UndefKeywordError. The positional form PanelFieldTarget("market_cap") does not change.

  • ProcessedJuMPOptimiserAttributes is ResolvedJuMPOptimiser, and it holds its constraints in a ResolvedConstraintBlock. The bundle holds pr, fees, ret, sca, imsk and cbr, the resolved constraint block of the fit. v0.33 held one field for each resolved constraint. The reads jor.wb, jor.lt, jor.st, jor.lcsr, jor.ctr, jor.gcardr, jor.sgcardr, jor.smtx, jor.sgmtx, jor.slt, jor.sst, jor.sglt, jor.sgst, jor.tn and jor.plr forward to the block, so res.wb of a JuMP Result does not change. The keyword constructor takes pr, fees, ret, sca, imsk and cbr. The verb processed_jump_optimiser_attributes is resolve_jump_optimiser, ProcessedAttributes is AbstractResolved, ProcessedRiskBudgetingAttributes is AbstractResolvedRiskBudgeting, ProcessedAssetRiskBudgetingAttributes is ResolvedAssetRiskBudgeting, and ProcessedFactorRiskBudgetingAttributes is ResolvedFactorRiskBudgeting. The v0.33 names raise an UndefVarError.

  • fit_and_predict over one split takes train_idx, test_idx and cols by position. Write fit_and_predict(opt, rd, train_idx, test_idx, cols) where v0.33 wrote fit_and_predict(opt, rd; train_idx, test_idx, cols). cols defaults to :. To read a stepped estimator or pipeline out, pass nothing as train_idx: fit_and_predict(opt, rd, nothing, test_idx). The form on a result ignores train_idx. Each form passes its keywords to predict, so a keyword that predict does not take raises a MethodError. On a result, v0.33 dropped such a keyword with no error. The forms over a scheme, fit_and_predict(opt, rd, cv; cols, ex, id), do not change.

  • Every scalariser field and keyword defaults to nothing, where v0.33 defaulted to SumScalariser(). This holds for the sca of JuMPOptimiser, HierarchicalRiskParity, RiskLoss, MeanReturnRiskRatio, ExpectedReturnRiskRatio and the Results that copy it, for scai and scao of HierarchicalEqualRiskContribution, for sca1 and sca2 of NonOptimisationRiskRatio, and for the sca keyword of expected_risk, expected_ratio, risk_contribution and their siblings. With a vector of risk measures, nothing gives the sum, so no number moves. A read of the field, such as opt.sca isa SumScalariser, now reads nothing. Every slot still takes SumScalariser().

  • The field pa of a JuMP Result is jor, and the field prb of a risk budgeting Result is rbr. Read res.jor.pr where v0.33 read res.pa.pr, res.jr.jor where v0.33 read res.jr.pa, and res.rbr.rr where v0.33 read res.prb.rr. The keyword of JuMPOptimisationResult is jor, and the keyword of RiskBudgetingResult and RelaxedRiskBudgetingResult is rbr. A read through the forward rule, such as res.pr, res.wb or res.rkb, does not change. res.pa and res.prb raise a FieldError.

  • Three range keys of the JuMP model follow <base>_range_risk_. Read model[:drcvar_range_risk_1] where v0.33 read model[:drcvar_risk_range_1], model[:evar_range_risk_1] where v0.33 read model[:evar_risk_range_1], and model[:genvar_range_risk_1] where v0.33 read model[:genvar_range_1]. The keys of the upper bound of each of the three ranges change with them. range_risk_key(r) gives the key of every range that decomposes. The numbers do not move.

  • The four fee rows of the model of a DiscreteAllocation are vector rows. In res.l_model and res.s_model, model[:cftn_ub], model[:cftn_lb], model[:cb_ub] and model[:cb_lb] are each one ConstraintRef of a vector-valued row, where v0.33 held a vector with one row for each asset. JuMP.value and JuMP.dual of the entry give the vector of v0.33 values, and model[:cftn_ub][i] raises a MethodError. The shares do not move.

  • supports_precomputed_returns takes the kind of the measure last. Write supports_precomputed_returns(r, rk) where v0.33 wrote supports_precomputed_returns(rk, r), with rk a NetReturnsInput, a WeightsInput or a WeightsReturnsFeesInput. rk defaults to risk_input_kind(r), so supports_precomputed_returns(r) does not change, and a measure of yours still declares its own one-argument method. The v0.33 order raises a MethodError. The answers do not change.

  • cross_sectional_warmup takes the name of each factor. Write cross_sectional_warmup(X, Ms, emsk, nf) where v0.33 wrote cross_sectional_warmup(X, Ms, emsk), with nf the name of each column of Ms, as ax.nf of cross_sectional_factor_axis gives it. The exposure history of the observed factors, Zo, is a fifth argument, and nf then names the columns of Zo after those of Ms. The v0.33 call raises a MethodError, and an nf of another length raises a DimensionMismatch. The count of cold observations does not change. When every observation is cold, the refusal names each factor whose exposure history holds no finite value, such as "momentum" or "industry=Energy".

  • EWBeta, EWMarketBeta, EWMacroSensitivity, EWDownsideBeta, EWResidualVolatility and EWResidualDownsideVolatility take no min_val. The floor that v0.33 added to each denominator is gone, because a beta is now NaN where its denominator does not vary, as Results that move states. Delete the keyword. EWResidualVolatility and EWResidualDownsideVolatility take beta_min_obs = 10 in its place, the number of valid observations that the beta of an asset needs before a residual is formed from it. The positional constructor of EWResidualVolatility takes beta_min_obs after beta_decay.

  • JamesStein and BayesStein clamp their shrinkage intensity by the new field intensity, whose default UnitIntervalIntensity() clamps it into $[0, 1]$. v0.33 used the raw intensity of the formula. On a sample whose raw intensity is outside $[0, 1]$, the default moves the expected returns. One strong common factor gave JamesStein a raw intensity of -25865, and means close to the grand mean gave 26.6. The intensity of BayesStein is in $(0, 1]$ under a positive semidefinite covariance, so its default moves only under an indefinite covariance. Write intensity = nothing to keep the raw intensity of v0.33. NonNegativeIntensity() clamps at zero alone. SteinShrinkage does not read the field.

  • The default subset_size of SubsetResampling is PowerSubsetSize(), which keeps round(N^0.8) assets in each subset. v0.33 kept the fraction 0.8 N. On 100 assets a subset now holds 40 assets, where v0.33 held 80, so the weights move. Write subset_size = 0.8 to keep the subsets of v0.33. PowerSubsetSize(; p) takes another power in $(0, 1]$.

  • covariance_forecast_compare and log_wealth_regret test the mean of the loss difference with the test estimator in the keyword mt, where v0.33 took lags. v0.33 divided the mean difference by a Newey-West variance at a fixed number of lags, and read a normal law. That test rejects too often. On a null MA(1) difference with a break in the volatility, at a nominal 5 %, the test at one lag rejected 9.4 % of the draws at 60 steps and 9.6 % at 240 steps. The default mt = WildBootstrapMeanTest() rejects 5.2 % and 4.9 %, and OverlapMeanTest() is the rule of zero lags. CovarianceForecastComparisonResult and LogWealthRegretResult hold t_stat, p_value, mean_ci_lower and mean_ci_upper, where v0.33 held variance, z, p and lags. The keyword lags raises a MethodError, and res.z raises a FieldError. A step that one side did not score is missing at its position, and two evaluations that share no scored step raise an IsEmptyError.

  • Skewness and Kurtosis read their comoment matrix, and lose the fields that only their functors read. Skewness keeps settings and sk, and loses w, mu, ve and pe. Kurtosis keeps settings, kt, N, alg and mtx_sqrt, and loses w, mu, alg1 and pe. alg2 of Kurtosis is alg, so write Kurtosis(; alg = QuadRiskExpr()) where v0.33 wrote Kurtosis(; alg2 = QuadRiskExpr()). Give a prior estimator to the slot, as in Kurtosis(; kt = HighOrderPriorEstimator()), where v0.33 wrote pe. The centre, the observation weights and the semi moment belong to the estimator of the matrix, such as Cokurtosis(; w, alg = SemiMoment()). A removed keyword raises a MethodError. Each value that the v0.33 functor read from the returns has a measure of its own:

    • Skewness(; w, mu) is ThirdCentralMoment(; w, mu, ve = SimpleVariance()).
    • Kurtosis(; w, mu, alg2 = QuadRiskExpr()) is HighOrderMoment(; w, mu, alg = FourthMoment()).
    • Kurtosis(; w, mu) is LowOrderMoment(; w, mu, alg = EvenMoment()).
    • alg1 = SemiMoment() is FourthMoment(; alg = SemiMoment()) or EvenMoment(; alg = SemiMoment()).

    On 250 observations of 5 assets, eight of the nine forms give the v0.33 value bit for bit. Kurtosis(; w) against LowOrderMoment(; w, alg = EvenMoment()) is 4.2e-16 apart. Results that move states the value of the two functors.

  • EWMean, EWMomentum and ExpWeightedExpectedReturns take debias = ZeroStartDebias(). The default divides the state of the recursion, which starts at zero, by the sum of its weights 1 - decay^n. ExpWeightedExpectedReturns divided in v0.33 too, so its default result does not move. EWMean and EWMomentum did not divide in v0.33, and Results that move states how their values move. debias = nothing keeps the undivided state, which shrinks the mean of an asset with a short history toward zero. The new field comes before cache, so a positional call of the inner constructor takes one more argument, and the type of each estimator takes one more parameter, before the type of cache. A positional call of v0.33 raises a MethodError.

  • GradientMomentum, RootMeanSquareGradient and AdaptiveMomentGradient take debias = nothing, and EGE, EGR and EGA take the keyword debias. The default reads each moving average undivided, as v0.33 did, so no default result moves bit for bit. debias = ZeroStartDebias() divides each average by 1 - gamma^k, where k counts the steps since the seed of the averages, as Adam does. EGA(; gamma1 = 0.9, gamma2 = 0.999, debias = ZeroStartDebias()) is the exponentiated gradient under Adam. The new field comes last, so a positional call of the inner constructor takes one more argument, and the type of each transform takes one more parameter, last. A transform prints one more field.

  • DriftedWeights has no field wd. Write DriftedWeights() where v0.33 wrote DriftedWeights(; wd = SelfFinancingDrift()), the default. SelfFinancingDrift was the one drift of the library, so DriftedWeights() gives every drift of v0.33. The keyword wd raises a MethodError. A previous-weights source of your own states its drift with a method held_weights_drift(::Nothing, ::MySource), which is public.

  • ImpliedVolatility has no field mp. A covariance estimator takes no matrix processing. Write PortfolioOptimisersCovariance(; ce = ImpliedVolatility(; ppy, …), mp) where v0.33 wrote ImpliedVolatility(; ppy, …, mp). The keyword mp raises a MethodError. The default no longer repairs the matrix, as Results that move states.

  • OrderedWeightsArrayRange has no field rev, and it stores a given w2 as given. v0.33 reversed a given w2 unless rev = true, and its default w2 was owa_tg. Write w2 = reverse(v), or w2 = reverse ∘ f for a builder, where v0.33 wrote w2 = v or w2 = f. Write w2 = v where v0.33 wrote w2 = v, rev = true. With no w2, v0.34 stores the reversal of w1, where v0.33 stored the reversal of owa_tg. Write w2 = reverse ∘ owa_tg to keep the v0.33 range of OrderedWeightsArrayRange(; w1). A v0.33 call with a w2 and no rev, or with a w1 alone, builds and gives another result with no error. OrderedWeightsArrayRange() does not move, and the keyword rev raises a MethodError.

  • OWAJuMP defaults sc and so to nothing, where v0.33 defaulted each to 1.0. nothing resolves to the scale of the objective. sc resolves to 1.0. so resolves to 1e-3 under MaximumEntropy, the default alg, and to 1.0 under the other objectives. A number that you state wins. So under another objective the resolved scales are those of v0.33. A read of the field, such as ow.so == 1.0, now reads nothing. Under MaximumEntropy the objective is new, as Results that move states. On 15 programmes, with T from 50 to 1000 and k from 4 to 6, the default OWAJuMP(; slv) falls back to ncrra_weights on none, and a stated so = 1.0 falls back on 11.

Calls that now raise

Callv0.33v0.34
Covariance, Coskewness, Cokurtosis, SecondMoment, EvenMoment, FourthMoment, EWVolatility or EWResidualVolatility with an alg that is a Gerber, Smyth-Broby or Gerber IQ algorithm or a shrinkage target, such as Covariance(; alg = IdentityTarget())Built the estimator. cov then overflowed the stack, and coskewness and cokurtosis raised a MethodError.Raises a TypeError when you build the estimator. The alg of these types is FullMoment() or SemiMoment(). Give a Gerber algorithm to GerberCovariance, SmythBrobyCovariance or GerberIQCovariance, and a shrinkage target to GeodesicShrinkageCovariance.
EWResidualVolatility or EWResidualDownsideVolatility with a ce whose every window holds an observation before the beta of each asset exists, such as ce = Covariance(), SimpleVariance(), PortfolioOptimisersCovariance(), WindowedVariance(), which has no window, or WindowedVariance(; window = collect(1:60))Built the estimator, and descriptor answered. v0.33 formed a residual from the first observation, so Covariance() and SimpleVariance() gave a finite value at 117 of the 120 cells of a panel of 40 observations of 3 assets with no gap. PortfolioOptimisersCovariance() raised ArgumentError: matrix contains Infs or NaNs.Raises an ArgumentError when you build the estimator. The residual of an asset is NaN until its beta exists, see beta_min_obs under Renamed keywords and changed defaults. The series of a plain estimator keeps no asset with a NaN in its window, so such a ce would give NaN at every cell. Pass the default ce, an ExpWeightedVariance, an ExpWeightedCovariance, a SimpleVariance or a Covariance with cvg = CoveragePolicy(), a PortfolioOptimisersCovariance over one of them with no step in its mp, such as mp = MatrixProcessing(; pdm = nothing), or a windowed estimator with an integer window, such as WindowedVariance(; window = 60). A composite with the default mp passes the constructor, and descriptor then raises ArgumentError: matrix contains Infs or NaNs on the NaN row of the warm-up, as the docstring of PortfolioOptimisersCovariance states. An index window is admitted when its first index is at least max(beta_min_obs, 2).
JuMPOptimiser or ProgrammeAllocationSet with an empty vector in lcse, smtx, sgmtx or ple, and FactorRiskContribution with an empty frc_ple, such as lcse = LinearConstraintEstimator[]Built the estimator. optimise of a MeanRisk on such a JuMPOptimiser then raised a MethodError, or a TypeError for ple.Raises an IsEmptyError that names the field when you build the estimator, as an empty tn or cte does. Pass nothing for no constraint.
A NearestQuantilePrediction called with a sign, scorer(ppred, -1), and quantile_by_measure(...; sign = -1)Multiplied the risk of each path by the sign.Raises a MethodError. The orientation of each measure now comes from bigger_is_better, so remove the sign. A call with sign = -1 for a measure of which a bigger value is better selects the same path without it.
NearestQuantilePrediction or quantile_by_measure with the reduction of a vector of measures in r_kwargs, such as r_kwargs = (sca = MaxScalariser(),); sort_by_measure(ppred, r), sort_by_measure(ppred, r; sca = …) and quantile_by_measure(ppred, r, q; …); and the positional constructor NearestQuantilePrediction(r, q, r_kwargs, q_kwargs)Passed r_kwargs.sca and the keyword sca to expected_risk, which reduced the vector with it. A call with no sca reduced it with SumScalariser().r_kwargs.sca raises a ConflictingArgumentError, and the other calls raise a MethodError. The reduction is the field sca of NearestQuantilePrediction, NearestQuantilePrediction(; r, sca = MaxScalariser()), and the first argument of the two verbs, sort_by_measure(MaxScalariser(), ppred, r) and quantile_by_measure(MaxScalariser(), ppred, r, q). For one measure the reduction is inert, so pass SumScalariser() or nothing.
GridSearchCrossValidation or RandomisedSearchCrossValidation with a reduction in kwargs, such as kwargs = (sca = MaxScalariser(),); and the positional constructors of the two searchesPassed kwargs.sca to expected_risk, where it was inert on the one measure that r took. The positional constructors took r and then scorer.kwargs.sca raises a ConflictingArgumentError that names r_sca. The reduction of a vector of measures is the new field r_sca, GridSearchCrossValidation(p; r = [ConditionalValueatRisk(), MeanReturn()], r_sca = MaxScalariser()). The positional constructors take r_sca after r, so a positional call of v0.33 raises a MethodError. The keyword constructors keep their meaning.
SearchCrossValidationResult(; opt, ranked, …) with an opt that is not ranked[1]Built the Result.Raises a DimensionMismatch. opt is the winner, ranked[1], as idx is rank_idx[1]. Pass ranked with opt first, or omit ranked, which defaults to [opt].
FiniteAllocationInput with an infinite price, such as prices = [10.0, Inf, 20.0]Built the input. GreedyAllocation then gave a NaN cash with an OptimisationSuccess, and DiscreteAllocation raised an ErrorException from JuMP.Raises a DomainError when you build the input. Write an absent price as NaN.
EntropyPoolingPrior or MeucciEntropyPoolingPrior, and an OpinionPoolingPrior of them, with a sets whose asset list has more or fewer names than X has columnsRaised a DimensionMismatch from a matrix product, which named no field.Raises a DimensionMismatch that names pe.sets.dict[pe.sets.xkey] and both lengths, as BlackLittermanPrior does. The names still map to the columns of X by their position in the list.
EntropyPoolingPrior or MeucciEntropyPoolingPrior with a view row that no reweighting of the scenarios meets, such as a mean target above the largest return of its asset, or a row that only a posterior with a zero on the support meets, such as a mean target equal to that largest returnFailed in the numerics with an error that named no view, and the type of the error changed with the size of the miss. The default OptimEntropyPooling raised an ArgumentError, such as matrix contains Infs or NaNs or weights cannot contain Inf or NaN values, or a DomainError from sqrt. JuMPEntropyPooling raised Entropy pooling optimisation failed. Two such views returned a posterior with no error: a mean target on the edge of its band put all the mass on one scenario, with kld = 6.92, and a correlation view outside its band under H1_EntropyPooling gave kld = 6.22.Raises a DomainError that names the view and the values that a reweighting of the scenarios reaches, on both routes. A row that is constant on the support passes when its target is that constant, as in v0.33. Two rows that each pass alone and that no posterior meets together raise as in v0.33, unless you give solvers to the new field diagnose: the fit then raises a DomainError that names the view fields, see If you extend the library.
prior or optimise on a ReturnsResult with names, where a UniverseSets of the estimator lists the assets in another order than rd.nx, or lists a name that rd.nx does not have, such as sets = UniverseSets(; dict = Dict("nx" => ["A", "B", "C"])) with rd.nx == ["A", "C", "B"]Fitted. A name resolved to its position in the list, so each view, bound and group bound the column at that position, which rd names differently. Only the sets of a JuMPOptimiser was checked.Raises an ArgumentError that names the first position where the lists differ, or a DimensionMismatch when the lengths differ. The check reads every UniverseSets of the prior and of the optimiser, and the factor key against rd.nf. A universe in the factor prior of a FactorPrior, a FactorBlackLittermanPrior or an AugmentedBlackLittermanPrior names the factors of rd. Build the list from rd.nx, as in Dict("nx" => rd.nx).
A moment, a regression, a Descriptor, a forecast, a distance or a diagnostic called with a bare integer matrix, such as cov(ExpWeightedCovariance(), X), mean(ExpWeightedExpectedReturns(), X) or var(RegimeAdjustedExpWeightedVariance(), X) with X::Matrix{Int}Converted the data to Float64 and gave the fit of the float copy.Raises, usually an InexactError or a MethodError. These kernels take the type of their data, and an integer holds no fraction and no NaN. Build a ReturnsResult or a PricesResult, which converts integer data once, or pass float.(X). Rational data are unchanged, and an integer stays where it is the natural type: a share count, a lot size, a cardinality, a count, an index, a Bool mask, the codes of a CategoricalPanelField.
clusterise of a hierarchical or a k-means clustering, and a fit of HierarchicalRiskParity, HierarchicalEqualRiskContribution, SchurComplementHierarchicalRiskParity or NestedClustered, on a distance with a NaN between two assets, such as two assets that share too few observations under a reader with CoveragePolicy(; peel = nothing)The hierarchical clustering raised ArgumentError: Distance matrix should be symmetric. from Clustering.hclust, and the k-means clustering raised ArgumentError: weights cannot contain Inf or NaN values from Clustering.kmeans.Raises a DomainError that names the first NaN cell and its cause, two assets that share too few observations.
A weight finaliser, or opt_weight_bounds, on integer weights with an absent bound, such as opt_weight_bounds(IterativeWeightFinaliser(), WeightBounds(; lb = nothing, ub = 1), [2, 1, 0])Read the absent bound as an infinity and gave the projection of the float copy.Raises an ArgumentError that names the element type. An absent bound is an infinity of the element type of the weights, and an integer type has none. Pass float weights.
FollowTheLeader whose held estimator has a fallback of another kind, such as FollowTheLeader(; opt = MeanRisk(; opt = JuMPOptimiser(; slv), fb = EqualWeighted())), or a precomputed result in its fallback chainBuilt the rule. A fallback leader solved without the allocation set of the head, so a cap of 0.2 on the set gave a weight of 0.9999999937 on one asset.Raises an ArgumentError that names the member. Each member of the chain must have the kind of the held estimator: a JuMP estimator under a JuMP estimator, and a BestConstantRebalancedPortfolio under a BestConstantRebalancedPortfolio.
FactorRiskContribution with a SemiDefinitePhylogeny or a SemiDefinitePhylogenyEstimator in the ple of its JuMPOptimiser, alone, in a vector or in a schedule, such as FactorRiskContribution(; opt = JuMPOptimiser(; slv, ple = SemiDefinitePhylogeny(; A, p = 0.05)))Built the estimator, and solved with no row of the phylogeny and no message. The weights were those of ple = nothing, so the linked pairs kept their weight.Raises an ArgumentError when you build the estimator. The head solves for the factor weights and writes no lift of the asset weights, so the phylogeny could add no row. Put a phylogeny of the factors in frc_ple. An IntegerPhylogeny in opt.ple still applies.
OnlinePortfolioSelection with a FollowTheLeader whose held estimator, or a member of its fallback chain, is a FactorRiskContribution, and a ProgrammeAllocationSet whose ple holds a SemiDefinitePhylogeny or a SemiDefinitePhylogenyEstimatorBuilt the head. The rows of the phylogeny sat on a lift of the asset weights that no term held down and that took no penalty, so they bound nothing.Raises an ArgumentError when you build the head, as FactorRiskContribution refuses a semidefinite phylogeny in opt.ple. Put the phylogeny on a MeanRisk leader, or use an IntegerPhylogeny on the set.
FollowTheLeader whose held JuMP optimiser has a net budget that excludes one, such as bgt = 0.5 or bgt = BudgetRange(; lb = 1.1, ub = 1.2), or a BudgetCosts or a BudgetMarketImpact in bgt, also as an entry or the default of a TimeDependent scheduleBuilt the rule. With bgt = 0.5 the leader solved at no step, and the head traded nothing, so on 40 rows of three assets it played its drifted start allocation, [0.3919, 0.3328, 0.2754]. With bgt = BudgetCosts(; bgt = 1.0, w = fill(1 / 3, 3), vp = 0.01, vn = 0.01) the leader stayed at the reference [1/3, 1/3, 1/3].Raises when you build the rule: a DomainError for a number or a range, and an ArgumentError for a cost estimator. The head owns the budget of one, so write bgt = nothing or bgt = 1 on the held optimiser. A function schedule raises at the first fold whose value excludes one.
JuMPOptimiser whose gross budget gbgt has an upper end below the least magnitude of the net budget, such as JuMPOptimiser(; slv, bgt = 1.0, gbgt = 0.5, wb = WeightBounds(; lb = -1, ub = 1)), and a ProgrammeAllocationSet whose gbgt has an upper end below oneBuilt the optimiser, and its solve gave an OptimisationFailure, because the gross exposure is at least abs(sum(w)).Raises an ArgumentError that names both budgets when you build it.
OnlinePortfolioSelection with a ProgrammeAllocationSet and a FollowTheLeader whose held estimator, or a member of its fallback chain, is a NearOptimalCentering under its default alg = UnconstrainedNearOptimalCentering()Built the head. The centring model of the leader dropped rows of the set, and the rule plays the leader with no projection at gamma = 0, so the head played an allocation outside its set. On 80 rows of eight assets and a set with the row a + b <= 0.05, the head played a + b = 0.2054.Raises an ArgumentError when you build the head, also for an expert of an ExpertMixture and for an entry of a schedule on set. Write alg = ConstrainedNearOptimalCentering(), which keeps every row of the set, or use a BoundedAllocationSet for bounds alone.
ConstantRebalancedPortfolio with a target w whose element type is not a number, such as w = Any[0.5, 0.5]Built the rule when the elements were numbers. A vector of another element type raised an error from sum.Raises a TypeError when you build the rule. The bound of w is a vector of numbers. Pass [0.5, 0.5].
covariance_forecast_summary or the keyword constructor of CovarianceForecastSummaryResult with a level that is not a real number, such as levels = ("a",)covariance_forecast_summary raised a MethodError from zero. The constructor built the Result.Raises a TypeError at the keyword levels. Pass a tuple or a vector of real numbers, such as (0.95, 0.99).
A PerformanceSummaryResult built by hand with an alpha outside $(0, 1)$, a ppy that is not positive, an rf that is not finite, a negative count, deviation, turnover or exposure, a risk that does not have the names of measures, or a field of an entry that does not have the shape of n_periodsBuilt the Result. The constructor checked no value.Raises a DomainError for a value outside its domain, an ArgumentError for the names of risk, and a DimensionMismatch for a shape. The shape of a field is one value for one entry, or one vector entry for each series. A summary that performance_summary builds does not change.
A linear constraint row whose coefficients are all zero under strict = true, such as linear_constraints(LinearConstraintEstimator(; val = "A - A <= 0.1"), sets; strict = true), also in a Black-Litterman view, a centrality constraint and a precomputed LinearConstraint in an ExposureConstraintEstimatorRaised an ArgumentError. A precomputed LinearConstraint in an ExposureConstraintEstimator kept a row that the loadings made all zero, and strict = true did not raise.Raises an IsZeroError, a PortfolioOptimisersError. Catch IsZeroError where you caught ArgumentError. strict = false warns and drops the row, as in v0.33, and the precomputed route drops it too. An unknown name still raises an ArgumentError.
owa_tg, owa_tgrg, OrderedWeightsArrayTailGini, OWA_TG or OWA_TG_RG with a_sim < 2 or b_sim < 2, such as owa_tg(10; a_sim = 1)owa_tg raised an ArgumentError from range. OrderedWeightsArrayTailGini(; a_sim = 1) built the measure, and a call of it failed.Raises a DomainError. The grid of a tail Gini needs two points, so a_sim = 2 and b_sim = 2 are the smallest values.
cov or cor of ImpliedVolatility with a negative entry or a gap in ivA gap raised an IsNonFiniteError. A negative entry passed, and on the premium path a negative last entry gave a negative volatility, whose sign the conversion to a covariance hid.Raises a DomainError for each, under both algorithms. A zero entry passes.
ImpliedVolatilityRegression on data that give three or four windows, with a zero iv on the last row of a window, or with a window of constant returnsThree windows gave a fit with no unique coefficients, and four windows a fit with no residual. A zero iv on the last row of an earlier window, and a window of constant returns, raised ArgumentError: matrix contains Infs or NaNs from the solve. A zero iv on the last row of the sample predicted a volatility of zero.Raises a DomainError. The fit needs more than four windows, and it takes the logarithm of each implied and realised volatility that it reads, so each must be positive. The message names the count of windows, or the value, the asset and the window. A zero iv on a row that ends no window is not read.
RegimeAdjustedExpWeightedVariance or RegimeAdjustedExpWeightedCovariance with a regime_decay outside $(0, 1)$, LogRegimeAdjusted with an x or a y that is not positive, FirstMomentRegimeAdjusted with an x that is not positive, and a regime_method of your own under debias = ExactDebias() or debias = LawDebias()Built the estimator. At regime_decay = 1 the regime state froze, a zero parameter gave a NaN or an infinite multiplier, and a method of your own failed in the fit.Raises when you build the estimator: a DomainError for a value, and an ArgumentError for a method of your own. The two bias corrections read the moments of the methods of the library alone, so a method of your own takes debias = nothing, the raw statistic.
A matrix in TurnoverEstimator.val, RiskBudgetEstimator.val, ThresholdEstimator.val, WeightBoundsEstimator.lb or ub, or FeesEstimator.l, s, fl or fs, such as WeightBoundsEstimator(; lb = [0.1 0.2; 0.3 0.4])Built the estimator. Its resolution then raised a TypeError, because the result holds a number or a vector.Raises a TypeError at the keyword. Each slot takes a number, a vector of numbers, a pair, a value of many estimators, or a VectorAbstractEstimatorValueAlgorithm.
PowerNormValueatRisk, PowerNormDrawdownatRisk or RelativePowerNormDrawdownatRisk with p = 1Built the measure. The power cone of order one is degenerate, so PRM returned NaN.Raises a DomainError. At p = 1 the measure equals the conditional measure of the same series, such as ConditionalValueatRisk, so use that measure.
The functor of GenericValueatRiskRange on a vector of returns, r(X * w), with a ValueatRisk(; alg = DistributionValueatRisk()) tailRaised a DimensionMismatch, or returned a wrong value when X had as many observations as assets.Raises an ArgumentError, because such a tail reads the weights. Call r(w, X, fees) or expected_risk(r, w, X), as Calls that now answer states.
PricesResult with a repeated timestampBuilt the result. port_opt_view then found each row by its timestamp, so a view returned the wrong rows.Raises an ArgumentError that names the count and the first repeat, as ReturnsResult does.
L1UncertaintySet or SignedL1UncertaintySet with an infinite entry in sdBuilt the set. A NaN entry raised a DomainError.Raises an IsNonFiniteError for a NaN or an infinite entry. A zero entry builds, as Calls that now answer states.
A FeatureDistance under StackObservations with a WeightedHamming, PeriodicEuclidean, Mahalanobis or SqMahalanobis metric, on a pair of assets that shares fewer rows than the windowRaised a DimensionMismatch from Distances.jl.Raises an ArgumentError that names the method of stack_rescale to add for the metric, or tells you to use AggregateDistances.
BlackLittermanViews with a repeated entry in excl, an entry outside 1:(length(Q) + length(excl)), or a vector views_conf of the length of the kept views under an exclBuilt the views. A views_conf of the kept length passed, and its first entry applied to every kept view, so the other confidences were lost with no error.Raises an ArgumentError for a repeat, a DomainError for an entry out of range, and a DimensionMismatch for views_conf. views_conf has one entry for each view that you wrote, length(Q) + length(excl).
Kurtosis(; alg1 = SemiMoment()), and every call that passes alg1 to KurtosisBuilt the measure. alg1 set the moment of the functor alone. The JuMP model read the cokurtosis of kt or of the prior, so under alg1 = SemiMoment() the model and the functor disagreed.Raises a MethodError. The functor and the model both read kt. Write Kurtosis(; kt = Cokurtosis(; alg = SemiMoment())) for the semi fourth moment.
owa_l_moment(T, k) with k > T, such as owa_l_moment(5, 6)Returned weights of NaN, because no subset of k observations exists.Raises a DomainError. The L-moment of order k weighs k order statistics at a time, so 1 <= k <= T must hold.
owa_gmd(T) with T < 2, and OrderedWeightsArray() on one observationowa_gmd(1) returned the range NaN:Inf:NaN. OrderedWeightsArray()([0.01]) returned NaN, and a JuMP model on one observation stopped at a NaN coefficient.Raises a DomainError. The Gini mean difference averages over the pairs of distinct observations, and one observation has no pair.
OrderedWeightsArray or OrderedWeightsArrayRange with a weight vector whose length is not the count of observations, such as OrderedWeightsArray(; w = owa_cvar(100)) on 39 observations, in a JuMP model or in a call of the measureThe default ApproxOrderedWeightsArray() read only the sum, the extremes and the norms of the vector, so it solved another problem with no error. ExactOrderedWeightsArray() and SortingNetworkOrderedWeightsArray() raised a DimensionMismatch that named no field, and a call of the measure raised one from dot.Raises a DimensionMismatch that names the field, w, w1 or w2, and the count of observations, under each formulation and in a call of the measure. A function in the field, such as the default, takes the count of observations, as in v0.33.
TurnoverRiskMeasure with a NaN or an infinite entry in wBuilt the measure.Raises a DomainError when you build the measure.
ThirdCentralMoment with a NaN or an infinite mu, a number or an entry of a vectorBuilt the measure.Raises an IsNonFiniteError when you build the measure, as MedianAbsoluteDeviation and Kurtosis do.
bounds_risk_measure(rs, ubs) with a vector of measures and a vector of bounds of another length, such as bounds_risk_measure([ConditionalValueatRisk()], [0.1, 0.2, 0.3])Broadcast the measures over the bounds. One measure and three bounds gave three copies of the measure, and other lengths raised the DimensionMismatch of the broadcast.Raises a DimensionMismatch that names both lengths. Each measure takes one bound.
FactorRiskContribution with a Frontier or a vector in settings.ub of a risk measureLogged a warning that the bound "would be silently ignored", and solved one portfolio with no bound.Raises an ArgumentError, because FactorRiskContribution solves its model once and sweeps no frontier. A number in ub still warns. Use MeanRisk or NearOptimalCentering for a sweep.
FactorRiskContribution, RiskBudgeting or RelaxedRiskBudgeting with a Frontier or a vector return floor, such as ret = ArithmeticReturn(; settings = JuMPReturnsSettings(; lb = Frontier(; N = 3))), and RiskBudgeting with a Frontier or a vector in settings.ub of a risk measureSolved one portfolio with no message. No solve read the bound, so the portfolio could fall below the floor.Raises an ArgumentError that names the bounds when the model is built. Give each bound one number, or use MeanRisk or NearOptimalCentering, which sweep a frontier.
Frontier(; N = 1)Built the frontier. A sweep then raised an ArgumentError from range, because a range of one point cannot hold two different end points.Raises a DomainError when you build the frontier. A sweep runs from the minimum-risk end to the maximum-return end, so it needs two points. To solve at one bound, give the bound as a number.
Skewness or Kurtosis on a bare returns matrix, such as expected_risk(Kurtosis(), w, X), or over a LowOrderPrior, such as prior(EmpiricalPrior(), X) or the prior that a hierarchical optimiser fits with its default EmpiricalPriorRead the returns, and gave a value.Raises an IsNothingError, because each measure reads its comoment matrix, sk or kt. The message names prior(HighOrderPriorEstimator(), X), which fits both matrices.
ScoreSelector(; score = Skewness(), rule) or ScoreSelector(; score = Kurtosis(), rule)Built the selector, and scored each asset on its returns.Raises an ArgumentError that names a measure of a return series: ThirdCentralMoment(), ThirdCentralMoment(; ve = SimpleVariance()), HighOrderMoment(; alg = FourthMoment()) or LowOrderMoment(; alg = EvenMoment()).
asset_scores(r, X) or asset_scores(r, rd) with a risk measure that cannot score the return series of one asset, such as EqualRisk(), Variance(), StandardDeviation(), Skewness() or Kurtosis()EqualRisk() gave 1 / T to each asset, because its functor read the column as portfolio weights. The other measures failed in their functor, for example with a MethodError.Raises the ArgumentError that ScoreSelector raises for the same measure, which names a measure of a return series.
AssetPanel with an empty vector in pfBuilt a panel that held its masks alone.Raises an IsEmptyError. Write pf = nothing for a panel that holds its masks alone.
NestedClustered or Stacking with a split result in cv, such as a KFoldResult, and with a scorer beside a cv that is not a CombinatorialCrossValidationOptimisationCrossValidation(; cv, scorer) took both.Raises a TypeError at the keyword cv for a split result, and an ArgumentError for the scorer, which selects one path of a combinatorial scheme. Pass the scheme in cv, and scorer = nothing beside a scheme that is not combinatorial.
RadialTailDecay on a prior whose chol is a singular square factor with no zero on its diagonal, such as [1 1 0; 1 1 0; 0 0 1]Passed the check of the diagonal, and whitened the sample with a singular factor.Raises a DomainError. The rule reads the diagonal of a triangular factor: chol when it is an UpperTriangular, and the R factor of its QR factorisation otherwise.
NumericPanelInput or TensorPanelInput with a fill policy whose val is a string, such as alg = ConstantPanelFill(; val = "a")Built the input. asset_panel then failed when the fill wrote the string, with a conversion error that named no field.Raises an ArgumentError that names the field when you build the input. A CategoricalPanelInput still takes a string val, the level to fill with.
A variance estimator, such as SimpleVariance(), ExpWeightedVariance(), RegimeAdjustedExpWeightedVariance() or WindowedVariance(), in a slot that calls cov or cor, such as EmpiricalPrior(; ce = SimpleVariance()), PortfolioOptimisersCovariance(; ce = SimpleVariance()), the ce of ShrunkExpectedReturns, ClustersEstimator or NetworkEstimator, or the sigma of VarianceBuilt the estimator. The first fit raised a MethodError, because a variance estimator has no cov. NetworkEstimator(; ce = SimpleVariance(), de = Distance(; alg = VariationInfoDistance())) with a tree type built and fitted, because that distance did not call cor.Raises an ArgumentError in the constructor that names the slot and asks for a covariance estimator, such as Covariance(). A slot that calls only var or std keeps a variance estimator: the ce of StandardDeviationExpectedReturns and VarianceExpectedReturns, the ve of GerberCovariance and of CrossSectionalFactorPrior, and the ve of WindowedVariance.
brinson_attribution(X, w, wb, asset_classes, col, date0, date1) with a bound whose type does not compare with the timestamps of X, such as a DateTime bound of zoned prices, or with a bound that is not a timestamp, such as the string "2020-01-02"Converted each bound with DateTime. A zoned X then raised no promotion exists for DateTime and ZonedDateTime for every bound, zoned ones too, and a string bound was parsed.Compares each bound in the type of the timestamps. A bound of another type raises an ArgumentError that names the bound and both types, and a string raises a MethodError. Give a zoned bound for zoned prices, and write Date("2020-01-02") for a string. A Date bound of DateTime prices still works.
brinson_attribution with a window that holds no observation of XRaised a MethodError from X[nothing].Raises an ArgumentError that names both bounds and the first and last timestamps of X.
port_opt_view(rd, i, j) of a ReturnsResult, and port_opt_view(pr, i, j) of a PricesResult, with timestamps i whose type does not compare with the timestamps of the data, such as DateTime timestamps of zoned data, also when i is a vector of an abstract element type, such as Dates.AbstractTime[zoned_t, DateTime(2020, 3, 5)]Raised no promotion exists for DateTime and ZonedDateTime, or a MethodError of getindex on a TimeArray.Raises an ArgumentError that names i and both types. A vector of an abstract element type is checked entry by entry, so a vector whose entries are all zoned still selects.
ExponentialDecay(; rate = Inf), also as the decay of a ProximityBuilt the decay. separation_decay gave NaN at the separation 0, because Inf * 0 is NaN, so phylogeny_features put a NaN on the entry of each asset itself.Raises a DomainError when you build the decay. Give a large finite rate, which scores each neighbour near 0.
ScoreSelector or RedundancySelector with a measure of the entropic, relativistic or power-norm family that has no solver, such as score = EntropicValueatRisk(), or with a GenericValueatRiskRange or a RiskRatio that holds such a measure, and expected_risk(r, w, X), asset_scores(r, X) or the functor r(x) of such a measureThe constructor built the selector, and the fit raised a MethodError of ERM, RRM or PRM, several frames down. The evaluations raised the same MethodError.The constructor raises an IsNothingError that names slv and shows a Solver, also when a child of the measure has no solver. The new FoldRiskScorer and ScoreWeightBounds refuse it in their constructors too. The evaluations raise an IsNothingError that names slv, also when PRM needs no model. State the solver on the measure, such as EntropicValueatRisk(; slv = Solver(; solver = Clarabel.Optimizer)). An optimiser still gives the measure its own solver.
A lens write, such as Accessors.@set pipe.steps = (InverseVolatility(), EmpiricalPrior()), a positional call, or a candidate of a search, that gives a Pipeline steps in an order that its keyword constructor refuses. The same for a value that the keyword constructor refuses in a SampleBufferState, a ReturnsBufferState, a PipelineBufferState, a PricesToReturnsState, a PriceGapFillState, a PriceGapFillResult, a MissingDataFilterState, an OnlinePortfolioSelectionState, a StepwiseRegression or a DimensionReductionRegression, in EntropyBudget(nothing), and in the count, the mean or the shape of a CovarianceState, a SimpleVarianceState or a SimpleExpectedReturnsStateBuilt the value. Only the keyword constructor checked it. A search over a step of a pipeline fitted a candidate that put the optimiser before the prior.Raises the error of the keyword constructor, because the inner constructor now holds each check. The keyword constructor of the three moment states alone checks that the values are finite, because that scan costs as much as the fold of one observation. A lens write of a symbol crit on a StepwiseRegression converts it to a Val, as the keyword constructor does.

Calls that now answer

Callv0.33v0.34
A plot function other than plot_network, such as plot_composition, after using PortfolioOptimisers, StatsPlots with no using GraphRecipesRaised a MethodError, because the plot extension loaded only with both packages.Draws. The plot extension loads with StatsPlots alone. plot_network is in a second extension, PortfolioOptimisersGraphRecipesExt, which loads after using GraphRecipes, StatsPlots. Code that loads both packages does not change.
CrossSectionalFactorPrior with ve = SimpleVariance(), ve = Covariance() or another estimator with no variance series of its own, with ve = ExpWeightedCovariance() or ve = WindowedCovariance(; ce = Covariance()), and the same prior inside an entropy pooling prior with wRaised a DimensionMismatch, because the variance series did not cut the masks and the weights of the fit to the rows of each refit. ExpWeightedCovariance() and WindowedCovariance(; ce = Covariance()) raised a MethodError of the count of the variance, which they did not state.Fits. Row t of the series reads the masks, the implied volatility and the observation weights of the rows 1 to t. A covariance estimator whose diagonal weights the squares as a variance estimator with a count does, such as Covariance(), ExpWeightedCovariance() or WindowedCovariance(; ce = Covariance()), states the count of that variance estimator, so ResidualInflation on that prior gives the radius of ve = SimpleVariance() for ve = Covariance(). A shrinkage estimator, a SemiMoment covariance and an alg step of your own in a MatrixProcessing state no count, and ResidualInflation then raises an IsNothingError that names the fix. A PortfolioOptimisersCovariance with a step in its mp, as PortfolioOptimisersCovariance() is, raises ArgumentError: matrix contains Infs or NaNs in place of the DimensionMismatch, as its docstring states. WindowedCovariance() wraps such a composite, and it raised that ArgumentError in v0.33 too.
WindowedVariance or WindowedCovariance with no weights of its own over an inner estimator with observation weights, such as WindowedVariance(; ve = SimpleVariance(; w), window = 20)Raised a DimensionMismatch.Cuts the weights of the inner estimator to the window.
variance_series over a panel of a WindowedVariance or a WindowedCovariance over a plain estimator, such as WindowedVariance(; window = 4), when a window covers no assetRaised an IsEmptyError at the first such window, so the whole series raised.Gives NaN in the row of such a window, as in the row of a window that keeps no observation, and fits each other row. A single call of var over a window that covers no asset still raises the IsEmptyError. So EWResidualVolatility(; ce = WindowedVariance(; window = 60)), whose first windows hold the warm-up of the residual, does not raise, and it is NaN in each row whose window holds the warm-up. It answered in v0.33 too, at 117 of the 120 cells of a panel of 40 observations of 3 assets with no gap, because v0.33 formed a residual from the first observation.
var, std and variance_series over a panel, or with pnl = nothing, of a PortfolioOptimisersCovariance over a mask-aware estimator, such as PortfolioOptimisersCovariance(; ce = ExpWeightedCovariance(), mp = MatrixProcessing(; pdm = nothing))Reduced each window to the assets that are finite and active at each of its rows, whatever the inner estimator. So an asset with one NaN or one inactive row in the window was NaN, and var raised an IsEmptyError when no asset was covered. On a panel of 30 assets and 300 observations whose first 9 rows are NaN, the series of the composite had 0 finite cells.The inner estimator reads the window, as the panel method of cov of the composite already let it do. var is the diagonal of the processed covariance over the panel, so mp runs on each fit. On that panel the series has the 8 700 finite cells of Covariance(; cvg = CoveragePolicy()), and the 7 560 of ExpWeightedCovariance(). Over a plain estimator the composite gives the v0.33 values. Over Covariance(; cvg = CoveragePolicy()) with no w, ExpWeightedCovariance() or RegimeAdjustedExpWeightedCovariance(), with no alg step in mp, the series folds each observation one time, with the matrix call and with the panel, and gives the values of a refit at each row. Over a Covariance with w, the series refits each row.
expected_return(ArithmeticReturn(; mu = 0.01), w, pr), a number in mu, and each ratio and measure that reads the term, such as ExpectedReturnRaised a DimensionMismatch.Gives 0.01 * sum(w), the value of the model expression of the term.
JuMPOptimiser, ProgrammeAllocationSet or FactorRiskContribution with a vector field that mixes the members of its element type, such as tn = [Turnover(…), TurnoverEstimator(…)]; and GridSearchCrossValidation or RandomisedSearchCrossValidation with a vector of grids whose types differTypeError or MethodError, unless the caller narrowed the literal with concrete_typed_arrayThe keyword constructor narrows the literal. A wrong element raises an ArgumentError that names the field.
A JuMP optimiser with sca = LogSumExpScalariser() and a risk measure whose entry of the risk vector is quadratic, such as MeanRisk(; r = [Variance(), ConditionalValueatRisk()], opt = JuMPOptimiser(; sca = LogSumExpScalariser(), …))The solve failed, and the Result held an OptimisationFailure.Solves. An epigraph variable takes the place of each quadratic entry in the exponential cone, so the scalarised risk does not change.
A constraint estimator whose val maps names to fractions and whose dval is an integer, such as ThresholdEstimator(; val = "A" => 0.05, dval = 0)Raised an InexactError when it resolved against a UniverseSets.Resolves. An integer dval takes the type that the values of the map promote it to. Any other dval keeps its type, as in v0.33.
sort_by_measure with a vector of risk measures that disagree on orientation, such as [MeanReturn(), MaximumDrawdown()]Raised an ArgumentError from bigger_is_better.Sorts. Each measure is oriented so that a higher score is better before the vector is reduced.
NearestQuantilePrediction, sort_by_measure or quantile_by_measure with a VectorToScalarMeasure or a function as the reduction of a vector, such as sca = MedianValue()Raised a TypeError, because expected_risk takes a Scalariser only.Reduces the oriented scores of the measures with it.
factor_attribution(w, pr, ret) with constant weights w and a net return series ret, and its rolling twin factor_attribution(w, pr, ret, window)Raised a MethodError, because the method on a return series took a weight history alone.Decomposes the series. The methods on asset returns form their net series and call this method, so factor_attribution(w, pr, X) gives what factor_attribution(w, pr, ret) gives on the series that X forms.
GridSearchCrossValidation or RandomisedSearchCrossValidation with a vector of risk measures in r, such as r = [ConditionalValueatRisk(), MeanReturn()]Raised a TypeError, because r took one measure.Scores the vector. Each test score and each train score orients each measure so that a higher score is better, and the field r_sca reduces the vector in each fold or path. Its default nothing gives the sum, as SumScalariser() does. A vector whose measures disagree on orientation is admitted. A search of one measure does not change.
expected_risk and expected_risk_from_returns with the scalariser as the first argument, such as expected_risk(MaxScalariser(), [ConditionalValueatRisk(), MaximumDrawdown()], w, X)Raised a MethodError, because the scalariser was the keyword sca alone.Gives what the keyword form expected_risk(r, w, X; sca = MaxScalariser()) gives, on weights, a weight path, a prior, a result and a prediction. The keyword form does not change. A single measure ignores the scalariser in both forms.
GreedyAllocation or DiscreteAllocation on prices with a NaN, such as prices = [10.0, NaN, 20.0] for an asset with no bar on the allocation dateGreedyAllocation gave NaN shares of that asset and a NaN cash, with an OptimisationSuccess. DiscreteAllocation raised an ErrorException from JuMP.Allocates. No allocator can buy an asset with no price, so it holds zero shares, and the new upw field of FiniteAllocationInput states what its target weight becomes. The default upw = nothing keeps the money of that weight in cash. ProportionalRedistribution(), EvenRedistribution(), AssetRedistribution(; idx) and SideRedistribution(; l, s) move it to priced assets of the same side.
FiniteAllocationInput(; ca = f) with a plain function fRaised a TypeError, because ca took an AbstractCollateralAlgorithm only.Takes a function with the three methods of AbstractCollateralAlgorithm.
SimpleExpectedReturns, SimpleVariance, Covariance, Coskewness or Cokurtosis with observation weights w and a CoveragePolicy, such as var(SimpleVariance(; w, cvg = CoveragePolicy()), X)Raised an ArgumentError that told you to run the batch verb, which you ran.Fits. Each asset, each pair and each cell of a co-moment reads its own valid observations with their weights, and equal weights give the fit with no weights. A pair whose shared observations have no positive weight is undetermined, so the peel removes an asset of it, or strict = true refuses it.
CrossSectionalFactorPrior with CurrencyExposure(; base) on a universe whose every asset is in the base currency, such as "currency" => CurrencyExposure(; base = "USD") on assets that are all in "USD"With no E, raised an IsNothingError that named an empty list of series. With an E that holds no currency of the universe, raised IsEmptyError: fx cannot be empty.Fits. The member gives no currency factor and reads no series, so mu and sigma equal the fit without the member.
A fit of the view of an OpinionPoolingPrior of entropy pooling opinions, such as prior(port_opt_view(op, [1, 3]), X[:, [1, 3]])Raised a DimensionMismatch from a matrix product, because each opinion kept its sets on every asset.Fits. The view cuts the sets of each opinion.
A fit of HierarchicalRiskParity, HierarchicalEqualRiskContribution, SchurComplementHierarchicalRiskParity or NestedClustered, or a JuMPOptimiser with ple or cte, whose distance reader has a CoveragePolicy that refuses an asset that the prior keeps, such as ClustersEstimator(; ce = PortfolioOptimisersCovariance(; ce = Covariance(; cvg = CoveragePolicy(; min_coverage = 0.6)))) with an asset that holds half of the observationsThe hierarchical heads raised ArgumentError: Distance matrix should be symmetric. from Clustering.hclust, and the phylogeny and centrality readers raised a DomainError with NaN.Fits. The fit drops the asset with a warning and gives it a zero weight, and the other weights equal the fit on the other assets. strict = true raises an IsNonFiniteError. A direct call of clusterise, phylogeny_matrix or centrality_vector raises a DistanceReaderRefusalError that names the columns.
A fit of HierarchicalRiskParity, HierarchicalEqualRiskContribution, SchurComplementHierarchicalRiskParity or NestedClustered, or a JuMPOptimiser with ple or cte, on an asset with zero variance, such as cash at a constant returnUnder the default reader, HierarchicalRiskParity and HierarchicalEqualRiskContribution raised ArgumentError: matrix contains Infs or NaNs. Under the reader ClustersEstimator(; ce = Covariance()), HierarchicalRiskParity raised ArgumentError: Distance matrix should be symmetric., and a k-means clustering raised ArgumentError: weights cannot contain Inf or NaN values.Fits. The fit drops the asset from the investable mask with a warning and gives it a zero weight, and strict = true refuses it with an IsNonFiniteError. The correlation of the asset is NaN at every entry, see the entry of cor in Results that move.
An online fit whose ProgrammeAllocationSet holds a ple or cte reader that cannot estimate the correlation of an asset that the prior of the set keeps, such as a reader whose CoveragePolicy asks for more observations than the priorThe reader raised an error from its graph, and the fit stopped.Fits. At each such step the asset takes a zero weight with a warning, and the strict flag of the head refuses it with an IsNonFiniteError. The re-solve of a FollowTheLeader rule does the same, because the set enters the entry of the leader as a block.
An online fit whose ProgrammeAllocationSet holds a ple or cte graph reader with a plain moment estimator, such as SemiDefinitePhylogenyEstimator(; pl = NetworkEstimator()), beside a prior of the set that fills the gap of a young asset, such as EmpiricalPrior(; fill_limit = 1)Raised an IsNonFiniteError from the graph reader at the first step whose rows held the gap, and the fit stopped.Fits. The projection resolves the set through the entry of a JuMP head, so the asset takes a zero weight at each such step with the warning of the graph reader, as in a batch fit. The strict flag of the head refuses it with an IsNonFiniteError. An asset that a FeatureDistance of a reader of the set cannot read drops in the same way.
A FollowTheLeader rule whose ProgrammeAllocationSet has a prior that prices fewer assets than the prior of the leader, such as a plain pe in the set beside a mask-aware prior in the leader, at a step with a young assetRaised an ArgumentError that named the assets that the prior of the set could not price.Solves. The entry of the leader intersects the investable masks of its own block and of the block of the set, so each such asset takes a zero weight with a warning that names it. The strict flag of the head refuses it with an IsNonFiniteError.
An online fit whose ProgrammeAllocationSet holds a LinearConstraintEstimator in lcse or gcarde, at a step at which the prior of the set leaves an asset out of its investable maskThe set resolved the constraint once for each fold over every asset, and the reduction of the step kept its width. The model then raised a DimensionMismatch from a matrix product.Solves. The set resolves lcse and gcarde at each step, after the reduction, as a JuMP head does. A row that names the departed asset drops, and strict does not refuse the name. A precomputed LinearConstraint of the width of the universe raises a DimensionMismatch that names the slot, as it does in a JuMP head.
cor(MutualInfoCovariance(), X) with the default bins = HacineGharbiRavier() on a matrix with a constant columnRaised an InexactError.Gives the constant column NaN at every entry.
asset_scores(r, X) of a risk measure on a matrix with a column that holds a gap, such as asset_scores(SCM(), X) with NaN in 20 rows of one columnRaised the IsNonFiniteError of the moment estimator of the measure, so one gap refused the scores of every asset.Scores each column with no gap, and gives NaN at a column with a gap, which every selection rule drops. On returns data, a column that the data do not cover over the window scores NaN too. A column with no gap and a non-finite score still raises a DomainError. ScoreSelector dropped such a column in v0.33 too, so a selection does not change.
A FollowTheLeader rule whose leader and whose ProgrammeAllocationSet both state l1, linf, l2c or linfc, such as JuMPOptimiser(; l1 = 0.01, …) in the leader and ProgrammeAllocationSet(; l1 = 0.01, …)Raised an ErrorException from JuMP when the leader's model took the set: An object of name :t_l1 is already registered in this model.Solves. The set's terms enter the leader's model under the prefix of the set, and its penalties add to the objective penalty of the leader. A cardinality, a threshold or an integer phylogeny in both now reads one binary for each asset, where v0.33 declared a second vector of binaries for the set.
plot_histogram of a return series that holds a NaN or an infinite return, such as the series of a walk-forward path with a fold that failed to solveRaised an ArgumentError: start and stop must be finite, got NaN and NaN.Draws the finite returns. The bins, the moments, every vertical line and the fitted Normal law read them alone. A series with no finite return draws the axes alone, with no bin and no line.
plot_weight_stability and plot_cv_dashboard of a walk-forward path with a fold that failed to solve, and plot_weight_stability of a population with such a pathRaised an ArgumentError: quantiles are undefined in presence of NaNs or missing values.Draws. A failed fold holds no weight, so it is absent from every box, and a path with no fold left draws the axes alone.
HierarchicalRiskParity and SchurComplementHierarchicalRiskParity with a WeightBoundsEstimator that resolves a side to a number or to nothing, such as WeightBoundsEstimator(; lb = 0.0, ub = 0.6) or WeightBoundsEstimator(; ub = Dict("B" => 0.2)), whose lb keeps its defaultRaised a MethodError: no method matching view(::Float64, ::Vector{Int64}), or view(::Nothing, …) for lb = nothing.Solves. Each side is expanded to one bound per asset, so the weights equal those of the same bounds stated as two vectors.
OnlinePortfolioSelection with a FollowTheLeader whose held estimator has a RiskTrackingError of a Variance under DependentVariableTracking in tr, and a ProgrammeAllocationSet whose ple holds a semidefinite phylogenyEvery re-solve failed, because the tracking variance took the second-order cone, which that tracking mode cannot solve. Each step warned that the programme of the leader did not solve, and traded nothing, so the rule held the drift of its start.Solves. The block of the set marks the weights before the tracking errors of the head, so the tracking variance takes the semidefinite formulation, and the leader equals the leader with the same phylogeny in the ple of the held estimator. On 6 assets and 120 rows with two linked pairs and p = 0.05, the largest w_i w_j of a linked pair is 0.028 in v0.33 and 4.7e-7 in v0.34.
Solver(; settings) with an MOI.AbstractOptimizerAttribute key, such as settings = MOI.Silent() => true, MOI.TimeLimitSec() => 7.5 or MOI.RawOptimizerAttribute("max_iter") => 3Raised an ArgumentError, because a key was a string or an MOI.AbstractModelAttribute.Sets the attribute on the model of the solve. A Symbol key, such as :verbose => false, still raises an ArgumentError.
ImpliedVolatilityRegression(; ws = 2)Raised a DomainError, because ws had to be greater than 2.Builds. A window of two rows has a corrected standard deviation with one degree of freedom. ws = 1 raises a DomainError, because a window of one row has no dispersion.
expected_risk and the call r(w, X, fees) of a GenericValueatRiskRange with a ValueatRisk(; alg = DistributionValueatRisk()) tailexpected_risk raised a DimensionMismatch, or returned a wrong value when X had as many observations as assets.Evaluates the loss tail on w and the gain tail on -w, and a tail of returns on the net returns. Under MinimumRisk, the objective of the JuMP model equals expected_risk of its weights.
matrix_square_root(RidgeCholeskySquareRoot(), M) on a Rational matrixRaised a MethodError: no method matching eps(::Type{Rational{Int64}}).Factorises. The ridge and its floor take the element type of the plain factor.
AggregateDistances or StackObservations of a FeatureDistance on an integer windowRaised an InexactError, because a mean or a rescale went into an Int matrix.Gives a float matrix. A Rational window stays exact, and a Float32 window with no weights stays Float32.
L1UncertaintySet or SignedL1UncertaintySet with a zero entry in sd or a NaN entry in muRaised a DomainError for the zero, and an IsNonFiniteError for the NaN.Builds. A zero scale fixes the entry at its estimate, and the worst case reads only the other assets. An infinite entry of mu still raises.
CharacteristicUncertaintySet with an l1 algorithm on a prior fitted on a point-in-time asset panel, whose mu holds a NaN outside its investable maskRaised DomainError with 0.2 from the tie check of the radius, because the NaN entries of pr.mu reached the ladder.Fits on the investable mask of the prior, and expands the set to the full universe, as the other uncertainty sets do. sd is zero outside the mask, and mu is NaN there. The view of the set at the mask is the fit on the mask.
BlackLittermanViews with an excl longer than Q, such as three views of which two resolve no name under strict = falseRaised DimensionMismatch: length(excl) = 2 must be <= length(Q) = 1.Drops the two views with a warning for each, and keeps the third.
A LoGo matrix processing under dims = 2 with a variation of information distanceRaised a DimensionMismatch, because the check read the observations as the assets.Fits. The distance gives the same matrix for both orientations.
phylogeny_matrix(::ClustersEstimator, X; dims = 2), and asset_phylogeny through itRaised a BoundsError, because the membership matrix took the count of observations.Gives the phylogeny matrix of the assets.
A network estimator on an integer distance matrix with a zero entryRaised a MethodError: no method matching nextfloat(::Int64).Fits. The repaired copy of the matrix takes a float element type.
A covariance or a correlation view of entropy pooling whose pair cancels, such as cov_views = LinearConstraintEstimator(; val = "(A, B) - (A, B) == 0.1") in EntropyPoolingPrior or MeucciEntropyPoolingPriorEntropyPoolingPrior raised Entropy pooling optimisation failed, also for == 0.0 and under rho_views.Drops the view with a warning, as a cancelled mean view does. prior(pe, X; strict = true) raises an IsZeroError.
A sequential CVaR view of EntropyPoolingPrior, ConditionalValueatRiskView(; alg = SequentialTailView(), views), where v0.33 wrote alg = SequentialConditionalValueatRiskView(), on a target that a posterior meets, where the worst scenario holds at least alpha of the prior, such as 10 equal weights of 0.1 at alpha = 0.05, also where the losses of the assets on the left side sum to a constant on the supportRaised Entropy pooling optimisation failed. The start of the sequential solve read the row of the prior, which no posterior meets, so the first solve was infeasible.Solves, and the posterior CVaR meets the target. On 10 rows of the test data, a view halfway between the best and the worst loss of an asset gives a posterior CVaR within 5e-8 relative of the target.
A CVaR view at the worst loss of its asset on the support, under >= or ==, and a CVaR, EVaR or RLVaR view whose left side is constant on the support, at that constant, in EntropyPoolingPriorRaised a DomainError: View … is too extreme.Solves, because a posterior that puts at least alpha on the worst scenarios meets the first view. Where the prior puts at least alpha on the worst scenarios, the posterior is the prior to the tolerance of the solver. A view with a constant left side that the prior meets drops, so the posterior is the prior. A target above the worst loss still raises the DomainError. MeucciEntropyPoolingPrior takes an == view at the worst loss too, where v0.33 raised the DomainError. It writes the view as one row, which puts at least alpha of the posterior on the worst scenarios, and it searches only the other CVaR views. With no other view, the posterior is the prior when the prior meets the row. Otherwise it is the prior scaled to alpha on the worst scenarios and to 1 - alpha on the rest.
JuMPEntropyPooling(; alg = LogEntropyPooling()) over a prior with a zero weight in wRaised an ErrorException from JuMP: $Affine expression contains an invalid term `Inf * x[33]`$.Solves. A scenario of zero prior weight takes zero posterior weight, and the kld equals the kld of OptimEntropyPooling within 2e-7 relative.
MeucciEntropyPoolingPrior with more than one view in ConditionalValueatRiskView, whose search meets a trial point at which the inner solve failsStopped the fit with Entropy pooling optimisation failed.Rejects the trial point, and the search moves on. A failed inner solve at the start of the search, or at its last point, still raises.
MeucciEntropyPoolingPrior with a CVaR view whose posterior value at risk is below zero, such as a view at half the prior CVaR at alpha = 0.5, or a view just below the worst loss of an asset with few losses above zeroOne view raised CVaR entropy pooling optimisation failed. More than one view returned a posterior that missed its target with no error, by 0.55 % in one measurement.Solves. The search of the value at risk starts at the lowest loss of the asset, not at zero. With one view, a search whose root is above zero runs as before. When every loss of the asset on the support is above zero, the search of one view starts at the lowest loss, and the start of the search of more than one view is the midpoint of the lowest loss and the target. With more than one view, the box of the search is [lo, B] in place of [0, B], where lo is the lowest loss and B the target, so every such posterior moves: by up to 4.2e-4 of the largest weight in two measured cases. The warning of MeucciEntropyPoolingPrior gives the miss under the default dm_opt and under a tighter one.
owa_l_moment(T, k) where a binomial coefficient of T overflows an Int, such as owa_l_moment(1000, 8)Raised OverflowError: binomial(1000, 8) overflows.Gives the weights. The binomial coefficients take the float type of the weights.
no_bounds_risk_measure, no_bounds_no_risk_expr_risk_measure, no_risk_expr_risk_measure, bounds_risk_measure and unit_scale_risk_measure on a measure that the JuMP model does not optimise, such as MeanReturn() or ThirdCentralMoment(), and unit_scale_risk_measure(Skewness())Raised a MethodError. The five functions had methods for a RiskMeasure and a HierarchicalRiskMeasure alone, and Skewness had three of the five.Returns the measure with no change. Skewness has all five methods.
MaximumRatio(; kmin = 0)Raised DomainError: kmin must be > 0.Builds, with no floor on the scale variable k. A negative kmin raises a DomainError.
RiskBudgeting with AssetRiskBudgeting(; alg = MixedIntegerRiskBudgeting()) and a net budget below one, such as bgt = 0.5Did not meet the budget. The model held the row sum(w) - k >= 0, which a net budget below one meets only at k <= 0.Solves on the budget. The row is gone.
port_opt_view of a RiskBudgeting with MixedIntegerRiskBudgeting() or with LogRiskBudgeting() and no orthant vectorRaised TypeError: in keyword argument alg, expected RiskBudgetingFormulation, got a value of type Nothing.Views the estimator, and keeps its formulation.
NearOptimalCentering with an infinite weight bound, such as WeightBounds(; lb = 0.0, ub = Inf), or with a negative lower bound whose centre holds a short weightThe barrier wrote -log(w_i) and -log(ub_i - w_i) for each asset. An infinite bound put Inf in a cone row, and the solve failed. A negative lower bound added the hidden row w_i > 0, so a centre with a short weight was not feasible.Solves. The barrier has one term for each finite bound, -log(w_i - lb_i) and -log(ub_i - w_i), and no term for an infinite bound or a fixed weight.
VarianceSkewKurtosis with a vector bound on one term and a Frontier on another, such as a vector ub on vr and a Frontier ub on ktRaised a FieldError, because the rebuild of the sweep read the vector as the Frontier.Sweeps the Frontier of its term, and holds the vector bound of the other term.
The end points of a Frontier sweep under MaximumRatio with rf > 0The end-point solve on the ratio model failed, and the sweep raised an ArgumentError that named the failed maximum-return solve.Solves. The end points come from a model with k = 1, see Results that move. A sweep under MaximumRatio still needs the solver wrapped in ParametricOptInterface.Optimizer, as in v0.33.
RegimeAdjustedExpWeightedCovariance on Float32 data with debias = ExactDebias() or debias = LawDebias(), and with regime_target = MahalanobisTarget(; recursion = GaussianLevelRecursion()) under any debiasUnder DiagonalTarget with FirstMomentRegimeAdjusted or LogRegimeAdjusted, raised ArgumentError: matrix contains Infs or NaNs. Under MahalanobisTarget, gave a covariance of NaN at every entry with no error.Fits, and keeps Float32. On twelve configurations, the largest relative gap to the Float64 fit is 1.9e-5. Each Float64 fit does not move.
RegimeAdjustedExpWeightedCovariance with a MahalanobisTarget on BigFloat data at 256 bits, or at any precision whose eps is below exp(-61)Raised a BoundsError from the lattice of the level bias.Fits, within 1.1e-11 of the Float64 fit. A BigFloat fit needs GenericLinearAlgebra, which gives the eigen of a symmetric BigFloat matrix.
cov(pc) and cor(pc) with no data on a PortfolioOptimisersCovariance that partial_fit! folded over an ExpWeightedCovariance, a RegimeAdjustedExpWeightedCovariance, a seed-windowed WindowedCovariance or a GeodesicShrinkageCovariance, and cor of a seed-windowed WindowedCovariance and std of a seed-windowed WindowedVariance with no dataRaised an error, such as a FieldError for the field n of the state.Gives the matrix of the batch route on the folded rows. Under MatrixProcessing(; dn = Denoise()), on 150 observations of 6 assets, the largest gap to the batch route is 6.7e-14.
ThirdCentralMoment(; ve = SimpleVariance())Raised a MethodError, because ve was not a keyword.Divides the third moment by the cube of the standard deviation. This is the standardised skewness that the v0.33 functor of Skewness gave. The default ve = nothing gives the raw third moment, as in v0.33.
NestedClustered or Stacking with an online walk-forward in cv, such as cv = OnlineIndexWalkForward(20, 10)Raised a TypeError, because OptimisationCrossValidation took no online walk-forward.Builds the estimator.
RadialTailDecay on a prior whose chol is a nonsingular square factor with a zero on its diagonal, such as the Cholesky factor with its rows permutedRaised a DomainError that said that the covariance matrix is singular.Whitens the sample with the R factor of the QR factorisation of chol, which states the same covariance matrix.
predict of a PipelineResult on returns data with no asset panel, where the training window had one, or the reverseRaised an ArgumentError that said that the two windows did not come from one ingestion.Predicts. A table with no gap and no field of the asset panel gives returns data with no panel, see Results that move, so the check reads the asset names alone.
CrossSectionalFactorPrior whose exposures read the returns alone, on returns data with no asset panelRaised an error that said that the step carries no panel.Fits, in the batch fit and in the carry fold. A read of a named field of the panel on such data raises a KeyError that names both causes: the data carry no panel, or a panel of the two universe masks alone.
CategoricalPanelInput with a fill policy of your own that has no field valRaised a FieldError, because the check read alg.val of every policy.Builds. The check reads val of the library policies that carry one, and of no other policy.
A panel input on Int data with ConstantPanelFill(; val = 0.5), where the first column has no blank and a later column has oneRaised InexactError: Int64(0.5).Fills the blank, and the field is Float64.
panel_feature_matrix of a categorical field of the asset panel with more levels than assetsRaised a BoundsError.Gives the feature matrix.
A JuMP model of GenericValueatRiskRange whose two tails are ValueatRisk(; alg = DistributionValueatRisk(; dist)) over the same covariance, on a law whose mean is far from zero, such as dist = Normal(2, 1)Was DUAL_INFEASIBLE. Each tail held its own cone, and the coefficient of the gain tail was negative, so a minimisation drove its cone to infinity. ValueatRiskRange with the same law solved.Solves. The two tails share one cone, with the sum of their coefficients, as ValueatRiskRange does, and the ub of each tail still bounds its own value. On 300 observations of 6 assets at alpha = beta = 0.05 under MinimumRisk, the minimum is 0.0123379, the minimum of ValueatRiskRange. The tails can read different mu: a gain tail with mu = zeros(6) beside the loss tail solves to 0.0116972. A tail whose coefficient is negative beside a tail of another kind, such as GenericValueatRiskRange(; loss = ConditionalValueatRisk(), gain), is not convex, and its model is still unbounded.
risk_contribution and risk_gradient of ExpectedReturn or ExpectedReturnRiskRatio, and every call on a measure that holds one: a vector such as [ExpectedReturn(), ConditionalValueatRisk()], a side of NonOptimisationRiskRatio, the rk of MeanReturnRiskRatio, and the r of RiskTrackingRiskMeasureRaised the ArgumentError of risk_input_kind, because the two measures read pr.mu and the route of the prior passed pr.X to them. expected_risk of either measure alone answered.Evaluates, without and with fees. Each contribution equals w .* g / d, with g a central difference of the value and d the degree of the measure, within 2.2e-10 relative on the cases of the review.
RiskTrackingRiskMeasure whose tracked measure is a MeanReturnRiskRatio, a NonOptimisationRiskRatio or an ExpectedReturnRiskRatio, such as RiskTrackingRiskMeasure(; r = MeanReturnRiskRatio(; rk = ConditionalValueatRisk()), tr = WeightsTracking(; w = wb))The constructor raised a MethodError from no_bounds_no_risk_expr_risk_measure.Builds. expected_risk, risk_contribution and risk_gradient evaluate it, also with fees. The value reads the series of the active weights, net of the fee of w.
port_opt_view(rd, t, j) of a ReturnsResult with one timestamp t, such as rd.ts[2]Raised ArgumentError: invalid index, because the view read the timestamp as a position.Gives the one observation at t, with a matrix of one row, as port_opt_view(rd, [t], j) does. A timestamp that rd.ts does not hold raises an ArgumentError that names it. One timestamp in an asset or a factor index raises an ArgumentError, as a vector of timestamps does there.
port_opt_view(pr, i, j) of a PricesResult with Date timestamps i of DateTime pricesRaised a MethodError of getindex on a TimeArray.Selects the observations at midnight of each date, as the view of a ReturnsResult does.
port_opt_view of a ReturnsResult or of a PricesResult with one integer or one name in an index, such as port_opt_view(rd, 2, :), port_opt_view(rd, :, "a"), port_opt_view(rd, 2), port_opt_view(rd, :, :, 1) or port_opt_view(pr, :, 2), and port_opt_view(pr, t) with one timestamp tA ReturnsResult raised a TypeError that named a field, such as nx, or ArgumentError: invalid index for a name. A PricesResult raised the ArgumentError that lists its call shapes.Gives a view of one observation, one asset or one factor, with the matrix shape of the data: one integer n selects as n:n does, and one name as [name] does. One timestamp of a PricesResult selects the one observation at it, as on a ReturnsResult, and a timestamp that the prices do not hold raises an ArgumentError that names it. A name in the observation index raises an ArgumentError, as a vector of names does there. One Bool in an index raises an ArgumentError, as Julia refuses it, and a vector of Bool is still a mask of the axis.
Accessors.set on a MultiPeriodPredictionResult or a PipelineResult, such as Accessors.@set res.pred = res.pred[1:3] or Accessors.@set res.names = ("a", "b")Raised a MethodError. The keyword constructor of MultiPeriodPredictionResult does not take mrd, which its inner constructor computes, and PipelineResult had no keyword constructor.Gives the new Result. mrd is computed again from the new pred, and a patch of mrd raises an ArgumentError that names the fields to set. PipelineResult(; names, results, ctx) is the new keyword constructor.
A Pipeline whose step is a precomputed optimisation result, such as Pipeline(; steps = (EmpiricalPrior(), res)) with res = optimise(EqualWeighted(), rd)Raised an ArgumentError that said that the pipeline cannot infer the slot of the result. A TimeDependent schedule of such results ran, because the check did not see the result of each fold.Builds. The result writes :opt and reads :returns, as an optimisation estimator does, and the fit predicts with its weights, as a fold of the schedule does. The inner constructor now checks the pipeline of each fold, so the result needs the slot.
Detone on a matrix whose leading eigenvalues tie, such as an identity matrix, which Denoise makes when it finds no signal, or a MatrixProcessing with both dn = Denoise() and dt = Detone() on such a sampleArgumentError: matrix contains Infs or NaNs, or a NaN matrix under pdm = nothing. Detone(; n = size(X, 2)) on a covariance raised a DomainError of sqrt on most samples, raised the ArgumentError on some, and gave a matrix of rounding noise on the others.Removes the largest number of leading modes, at most n, whose smallest eigenvalue stands above the next one, and gives the matrix back when none does. An asset that the removed modes hold in full keeps a unit row, so n = size(X, 2) gives an identity matrix, and the diagonal of a covariance returns.

Calls that return another type

Each call in this list returns a value of another type, and the values in it do not move. Each row states the reads that do not change and the reads that raise.

  • range_tails returns a RangeTails, not a named tuple. v0.33 returned (; loss, gain). tails.loss, tails.gain and (; loss, gain) = tails read the same two measures as in v0.33. A range of your own returns PortfolioOptimisers.RangeTails(loss, gain), a public type, from its method of range_tails. The constructor refuses a tail whose settings.rke is true with an ArgumentError, because the range registers its risk expression once. pairs(tails), keys(tails), tails[1], loss, gain = tails, merge(tails, x) and length(tails) raise a MethodError, and tails == (; loss, gain) is false.

  • panel_align_active returns the plain tuple (pnl, n), as findmax does. v0.33 returned the named tuple (; pnl, n). Write aligned, n = panel_align_active(pnl, fields) where v0.33 read res.pnl and res.n. res.pnl and res.n raise a FieldError. The aligned panel and the count do not change.

  • cross_sectional_factor_axis returns a CrossSectionalFactorAxisResult. v0.33 returned the named tuple (; nf, fam). ax.nf, ax.fam and (; nf, fam) = ax read the same lists as in v0.33. Two Results are not ==, because the type compares its vectors by identity, so compare ax.nf and ax.fam. A call of keys(ax) raises a MethodError. The constructor refuses a fam whose length is not the length of nf with a DimensionMismatch.

  • Eight verbs of the forecast evaluation and the diagnostics return a type, not a named tuple. descriptor_scores returns a DescriptorScoresResult, forecast_ic_summary a ForecastICSummaryResult of two ICSummaryResults, forecast_portfolio a ForecastPortfolioResult, forecast_quantile_spread a ForecastQuantileSpreadResult, forecast_holding_period and forecast_decay a ForecastWindowResult, forecast_calibration a ForecastCalibrationResult whose curve is a ForecastCalibrationCurveResult, and idio_calibration_summary an IdioCalibrationSummaryResult. Each field keeps its name, so a read as res.ann_ir or (; slope, curve) = res does not change. keys, pairs, merge and a splat of a result raise a MethodError, and values(res) returns the result itself: read fieldnames(typeof(res)) or getfield(res, k) instead. The library defines == on no struct, so compare two answers by their fields.

  • The results of the forecast evaluation and of the factor model diagnostics check their values. exposure_ic_summary over a bare matrix returns the ExposureICSummaryResult of its other two methods, with nothing in nf and fam. DataFrame(res) writes a ForecastWindowResult or a ForecastCalibrationCurveResult as a table. Each constructor of the eight verbs above checks its values: a p-value, a hit rate or a coverage share outside [0, 1] and a deviation below zero raise a DomainError, and NaN passes. ForecastSummaryResult, ExposureICSummaryResult and FactorSummaryResult check their values in the same way now, and each takes a keyword constructor.

  • covariance_forecast_step and covariance_forecast_portfolio return a type, not a named tuple. covariance_forecast_step returns a CovarianceForecastStepResult, where v0.33 returned (; n_valid, mahalanobis_ratio, diagonal_ratio, qlike, frobenius, standardised_return, portfolio_qlike). covariance_forecast_portfolio returns a CovarianceForecastPortfolioResult, where v0.33 returned (; standardised_return, portfolio_qlike). A caller that reads a field by name, as step.qlike or (; qlike) = step, does not change. A splat (; step...), keys, pairs and merge raise a MethodError. == and isequal of two Results compare their arrays by identity, so compare the fields. Each constructor checks its values: a negative n_valid, an n_valid above the count of assets, and portfolio fields of two lengths or two sizes raise. CovarianceForecastSummaryResult checks its values now too, and it takes a keyword constructor; v0.33 checked nothing.

  • forecast_evaluation_summary(fe) and covariance_forecast_summary(cfer) give scalar fields. v0.33 gave a vector of length one in each field of a summary of one evaluation. Read fs.spearman_mean_ic where v0.33 read fs.spearman_mean_ic[1]. A spread of the forecast summary and exceedance of the covariance summary become a vector over the tail fractions or the levels. Pass a vector, [fe], to keep the shape of v0.33.

  • A Pipeline keeps the container form of its steps. v0.33 converted the steps of Pipeline(; steps = [EmpiricalPrior(), InverseVolatility()]) to a Tuple, and its names too. v0.34 keeps a vector of steps as a vector, and its names, and the names and results of its PipelineResult, are vectors too. A Tuple of steps gives tuples, as in v0.33. The weights and every other value do not change. A read by index, by name, length, iteration and map do not change. A method of your own that dispatches on pipe.steps::Tuple or res.results::Tuple raises a MethodError for the vector form, so pass the steps as a Tuple to keep the form of v0.33.

    The positional Pipeline(names, steps, cache) takes a vector of names and a vector of steps too, where v0.33 raised a MethodError. PipelineStep(; reads = [:returns], ...) keeps the vector that you give, where v0.33 raised a TypeError. The keyword constructor of PipelineResult is new, and it takes a vector of names and a vector of results, as the positional PipelineResult(names, results, ctx) did in v0.33. A tuple of steps compiles the methods of a pipeline for each set of step types, and a vector compiles them once for each element type, so a vector can cost less time to the first result. An online step of a vector of two steps took 19.3 µs, against 15.0 µs for the tuple form, at 20 assets.

  • gradient_state_seed of GradientMomentum, RootMeanSquareGradient and AdaptiveMomentGradient returns a PortfolioOptimisers.GradientAverageState, and transform_gradient! returns the state with the transformed gradient. v0.33 returned the zero average, the zero squared average or the pair of both from gradient_state_seed, and ĝ alone from transform_gradient!(grad, gs, g). Write gs, ĝ = transform_gradient!(grad, gs, g) where v0.33 wrote ĝ = transform_gradient!(grad, gs, g), and read gs.v and gs.m where v0.33 read the vector or gs[1] and gs[2]. A call with the state of v0.33, such as transform_gradient!(GradientMomentum(), zeros(N), g), raises a MethodError, and so does gs[1]. The transformed gradient does not change.

  • traverse_concrete_subtypes returns a Vector{Type}. v0.33 returned a Vector{Any}. The entries do not change. Pass a Vector{Any} as ctarr to collect into a vector of your own type.

  • Returns, prices and panel fields of integer data hold a float copy. ReturnsResult, PricesResult, NumericPanelField and TensorPanelField convert an integer element type once, when you build them, so eltype(rd.X) of ReturnsResult(; nx, X = [1 2; 3 4]) is Float64, where v0.33 kept Int. The values do not change, and a fit on such an input gives the fit of the float data, as in v0.33. A Float32, a Rational or any other element type is kept, as in v0.33.

  • describe of an asset panel with no field gives Float64 share columns. v0.33 gave the columns missing and active_missing, and the missing column of a by report, the element type Any.

Lot units of a finite allocation

Both finite allocators buy each asset in whole lots of its own lot unit, for fractional shares and for board lots. The unit field takes a LotUnit, one number for every asset or one value for each asset, or a LotUnitEstimator, which names the lot units by asset or group and resolves against the new sets field of the allocator.

v0.33v0.34
GreedyAllocation(; unit = 10)GreedyAllocation(; unit = LotUnit(10)). A bare number raises a TypeError.
GreedyAllocation(; unit = 0.01, kwargs = (; digits = 2))GreedyAllocation(; unit = LotUnit(0.01)). The args and kwargs fields are gone. The first pass floors the lot count, so a fractional lot unit buys whole lots with no rounding keyword.
PortfolioOptimisers.roundmultGone, with the rounding that it did.
DiscreteAllocation(; slv), which bought whole shares onlyTakes unit, sets and strict. The default LotUnit(1) buys whole shares, as in v0.33, and the default fallback reads the same unit. The model counts lots in its integer variable and holds the shares in an expression, so a side with more than one optimal book can return another of them, with the same objective.

A count or a fraction states its reading

A field that takes the size of a part of a set holds a CountOf or a FractionOf. CountOf(n) is n members, an Integer of at least one. FractionOf(f) is a share of the set, with f in (0, 1]. v0.33 read the type of a plain number: an Integer was a count, and any other real number was a fraction. Julia promotes the elements of a vector literal, so a search grid could turn a count into a float. A plain number is still a shorthand, and the field then holds the wrapper.

v0.33v0.34
x.active == 0.2, x.sbar == 25, cv.subset_size == 3, and the same read of neighbours, window_size, train_size and test_sizeThe field holds FractionOf(0.2), CountOf(25) or CountOf(3). Read x.active.val for the number.
A plain 1.0 in one of these fieldsRaises a DomainError, because a grid promotes the count 1 to it. Write CountOf(1) for one member, or FractionOf(1) for the whole set.
QuantileRule(; best = 0.2)RankRule(; best = FractionOf(0.2)), or the shorthand RankRule(; best = 0.2). QuantileRule is gone. One rule can now take a count from one end and a fraction from the other.
RankRule(; best = 0, worst = 5)RankRule(; worst = 5). A count is at least one, so nothing states a tail that takes no asset.
HopCount(; n = HopCountQuantile(; q = 0.25)) and PathLength(; dmax = PathLengthQuantile(; q = 0.25))HopCount(; n = FractionOf(0.25)) and PathLength(; dmax = FractionOf(0.25)). The budgets do not move. HopCountQuantile and PathLengthQuantile are gone. q = 0 is refused, and CountOf(1) states that hop budget.
HopCount(; n = 2).n == 2HopCount(; n = 2).n is CountOf(2). Read .n.val for the number of hops. A plain float, such as HopCount(; n = 0.25), is a fraction, where v0.33 refused it. In PathLength(; dmax = 0.25) a plain number stays a radius.
ConditionalValueatRisk(; alpha = ScenarioCount(; n = 25)), and every other significance slotConditionalValueatRisk(; alpha = CountOf(25)). The level is 25 / T, as before. ScenarioCount is gone. A plain number in alpha is still the level itself.
JuMPOptimiser(; l2c = EffectiveAssetFloor(; fraction = 0.5)), and the same in linfc, lpc and ProgrammeAllocationSetJuMPOptimiser(; l2c = FractionOf(0.5)). The ceiling does not move. EffectiveAssetFloor is gone, and CountOf(m) states the floor as m effective assets. A plain number in l2c is still the ceiling itself.
WildBootstrapMeanTest(; min_periods = 2.5), and the same OverlapMeanTestRaises a TypeError. min_periods is a count of windows, so it is an Integer.
ActiveAssetsUncertaintyAlgorithm(; active = 1 // 5)Builds and calibrates. v0.33 raised a TypeError when you built the algorithm, because active took an Integer or an AbstractFloat only.

Arrays of rank three hold their observations last

Every array of rank three that the library takes or gives holds its observations on its last axis, so the matrix of one observation is one contiguous block. A v0.33 array of shape T × N × K is a v0.34 array of shape N × K × T, and permutedims(A, (2, 3, 1)) converts one. A matrix over observations, such as the returns X, the weights W, a mask, the factor returns f or a one-factor exposure, does not change.

Wherev0.33v0.34
Z of cross_sectional_regression, predict, cross_sectional_r2 and mean_cross_sectional_r2; the field Ms of CrossSectionalFactorModel; Ms of factor_family_basis and reduce_exposures, and the result of reduce_exposures; B of factor_attribution, forecast_factor_correlation, plot_forecast_factor_correlation, exposure_ic, the exposure_* diagnostics and the cs_regression_* diagnosticsobservations × assets × factorsassets × factors × observations
factor_exposure of OneHotExposure and CurrencyExposure, and B of cross_sectional_groupsobservations × assets × levelsassets × levels × observations
cs_gram, and a stack given to expand_factor_covariance or reduce_factor_covarianceobservations × factors × factorsfactors × factors × observations
dropped_factor_weights(fcb) with no observation indexobservations × constrained families × reduced factorsconstrained families × reduced factors × observations
descriptor_scores(...).Sobservations × assets × descriptorsassets × descriptors × observations
vals, omsk and pmsk of a time-varying TensorPanelField or TensorPanelInput, and panel_field_values of such a fieldobservations × assets × labelsassets × labels × observations
feature_matrix and panel_feature_matrix of a time-varying panel, and the Z of distance(::FeatureDistance, Z) and cor_and_dist(::FeatureDistance, Z)observations × assets × featuresassets × features × observations

A static TensorPanelField and a static feature matrix keep assets × labels and assets × features.

Results that move

  • The last bits of a few kernels on arrays of rank three. The matrix of one observation is now contiguous, so a product on it runs in BLAS. The stack of expand_factor_covariance, a realised factor_attribution, the panel collapse of a meta-optimiser and the mean of AggregateFeatures can differ from v0.33 in the last bits. On a panel of 60 assets, 24 features and 300 observations, the mean of AggregateFeatures moves by 4e-16 relative and the panel collapse by 4e-16. A realised factor_attribution of 20 assets moves by up to 4e-15, in its unattributed remainder. A distance near zero amplifies the change of the mean, so the angular distance of FeatureDistance(; alg = AggregateFeatures()) on that panel moves by 1e-13 relative to its largest entry. AggregateDistances at dims = 2 moves by 3e-15. The new layout keeps every value of a CrossSectionalFactorPrior fit bit for bit.

  • The default lambda = PrecisionBlend() of a CrossSectionalFactorPrior reads the effective count of the factor moments. The rule gives the factor mean the weight max(0, 1 - K / (T_e B)). v0.33 took T_e as the count of observations. v0.34 takes the smaller of the effective counts that the factor prior states for its mean and its covariance, and an estimator that weights or decays its rows states fewer. So the weight falls, and it can reach 0. On a panel of 60 assets, 4 industries and 300 observations, with a market, an industry and two style factors, the resolved lambda is 0.1700 in v0.33 and 0 in v0.34. With no return forecast, every expected return of that fit is then 0. To keep the v0.33 mu, state the lambda of the v0.33 fit as a number, which res.rr.lambda of that fit gives.

  • NearestQuantilePrediction, sort_by_measure and quantile_by_measure orient each measure before they reduce a vector. v0.33 reduced the raw risks and then applied one sign, so a vector of measures that disagree on orientation, which NearestQuantilePrediction admitted, gave a number with no orientation and a wrong path. v0.34 multiplies each measure by -1 when a smaller value is better, before the reduction. The result depends on the orientation of the measures:

    • Measures of which a smaller value is better, one or a vector. Under SumScalariser, the three functions select and sort as in v0.33. A vector under MaxScalariser now selects and sorts by the best measure of each path, where v0.33 used the worst risk. Write MinScalariser() to keep the v0.33 result, and MaxScalariser() for the v0.33 result of MinScalariser. LogSumExpScalariser also moves.
    • Measures of which a bigger value is better, one or a vector. sort_by_measure sorts as in v0.33 under every scalariser. Under the default call with no sign, NearestQuantilePrediction and quantile_by_measure now read q = 1 as the worst path. Write 1 - q to keep the v0.33 path, when q_kwargs keeps alpha equal to beta, as the default does.
  • GreedyAllocation with a lot unit below one. v0.33 rounded the first pass with Base.round, which rounds to a whole share under the default kwargs. So a target could round above itself and stop the first pass early. v0.34 floors the lot count of each target. The shares of such an allocation differ, and they are multiples of the lot unit. A lot unit that is a whole number gives the v0.33 shares. A lot unit above one that is not a whole number gives other shares too, because v0.33 rounded the first pass to a whole share: at a lot unit of 1.5, v0.33 bought 218 shares where v0.34 buys 217.5.

  • The cash of a finite allocation is the cash that the account holds after the trade. v0.33 reported the cash that the long side did not spend. That number left out the cash that no side received: the cash outside a budget below one, and the cash of a book whose long cash the floor at zero of ProceedsCollateral sets. On w = [0.3, 0.25, 0.15, 0.1], prices = [12.3, 45.6, 7.89, 101.1] and cash = 10000, the shares do not change, and cash is 2038.6, where v0.33 gave 38.6. Under ProceedsCollateral, sum(cost) + cash + fees is the input cash. Under CashCollateral, sum(abs, cost) + cash + fees is. A negative cash is money that the book borrows.

  • performance_summary of a prediction whose optimiser gives many portfolios gives one entry for each member. v0.33 gave the scalar figures of the first member and dropped the others. Each field is now a vector with one entry for each member, and each member reads its own series, benchmark, turnover and weights. Read ps.sharpe[1] to keep the v0.33 number. The same holds for weights in a VecVecNum, and for an OptimisationResult of a frontier, which v0.33 refused.

  • log_wealth_regret of a prediction whose optimiser gives many portfolios gives one Result for each member. v0.33 gave one LogWealthRegretResult for the first member and dropped the others. v0.34 gives a Vector of LogWealthRegretResult, one entry for each member. Each member meets its own benchmark series, and the path_length of an entry reads the targets of its own member of the comparator. Two sides with many members pair by index, and a different count of members raises a DimensionMismatch. A side with one series pairs with every member of the other side. Read regs[1] to keep the v0.33 number. A pair of single series gives one Result, as in v0.33.

  • A selection rule and a redundancy algorithm drop a non-finite score. v0.33 compared a NaN through isless and >. RankRule and QuantileRule (now RankRule with a FractionOf) could then return an empty mask, action = :drop kept the NaN, QuantileRule counted it in the size of the universe, a ThresholdRule with one bound admitted an infinite score on the open side, CorrelationComponents and ClusterGroups kept no member of a group whose first member had a NaN, and PairwiseCorrelation dropped both assets of a pair with one NaN. In v0.34 a NaN or an infinite score is outside every tail and every band, under each action, and the partner of a NaN asset survives their pair. A selector with a risk measure raises a DomainError on a non-finite score of a column with no gap, as in v0.33, so the change reaches a direct call of rule_keep or redundancy_keep, and the NaN that FoldRiskScorer and WeightMassScorer write at an asset that too few folds scored.

  • A corrected weighted fit with no positive divisor is NaN. A corrected fit on one observation of positive weight divides by zero, and the weighted mean of one value can differ from it by one unit in the last place. So v0.33 gave Inf where the fit with no weights gives NaN: var(SimpleVariance(; w = aweights([w])), x) was Inf in 493 of 2000 draws and NaN in the others. Frequency weights that sum to less than one gave a variance of zero or below, such as -0.0 for fweights([0.4]). v0.34 gives NaN in each case, in SimpleVariance, in the weighted cov of GeneralCovariance and Covariance, and in StdValue and VarValue. A fit with a positive divisor gives the v0.33 number bit for bit.

  • var(SimpleVariance(; w, cvg = CoveragePolicy()), x) on one series reads w. v0.33 ignored the weights of the vector arm with no message, and gave the variance with no weights. On 12 observations with analytic weights, v0.33 gave 0.0013162 and v0.34 gives 0.0011678, the weighted variance.

  • The default drop score of PairwiseCorrelation and CorrelationComponents skips a correlation that is not defined. Under a ce with no matrix repair, such as Covariance(), the correlation with a constant column is NaN, so in v0.33 the summary of every column was NaN. PairwiseCorrelation then dropped both assets of each correlated pair, and CorrelationComponents raised an IsEmptyError. v0.34 summarises the finite entries of each column, and a weighted measure loses the weight of each skipped entry. On a correlated pair A, B, an unrelated C and a constant D, both algorithms keep ["B", "C", "D"], where v0.33 kept ["C", "D"] and raised. The default ce = PortfolioOptimisersCovariance() refuses the NaN in its repair, as in v0.33.

  • The correlation of a constant column is NaN on the diagonal too. The correlation of an asset with zero variance is 0 / 0 at every asset, itself included. v0.33 gave such an asset NaN off the diagonal and one on it under Covariance, GeneralCovariance, ExpWeightedCovariance, RegimeAdjustedExpWeightedCovariance, ImpliedVolatility, SpearmanCovariance and KendallCovariance, and a NaN diagonal under a CoveragePolicy. Now every one of them gives the NaN diagonal, as DistanceCovariance did. So cor(Covariance(), X)[i, i] is NaN for a constant column i, and distance of a covariance matrix with a zero variance gives a NaN row. A weighted SimpleCovariance correlation with fewer than two observations of positive weight is NaN at every entry, as the unweighted fit on one observation is. An estimator that defines the dependence of a constant, such as GerberCovariance or a shrinkage in Covariance(; ce), keeps its values.

  • A constant other than zero gets the same NaN row. The mean of a constant can differ from it by one unit in the last place, so under Covariance, GeneralCovariance and the default PortfolioOptimisersCovariance, cash at a constant return of 0.0005 has a variance of about 1e-38, not zero. v0.33 gave its row a correlation of about 1e-18 with each asset and one on the diagonal, and HierarchicalRiskParity and HierarchicalEqualRiskContribution gave the cash the whole weight. Now the row is NaN at every entry for every constant, also under observation weights, where a column that is constant on the observations of positive weight counts. The fit drops the asset, as it drops cash at 0.0. The normalised mutual information of MutualInfoCovariance gives every constant the NaN row too, under each bin rule.

  • number_effective_assets, and the n_eff of performance_summary, read the concentration of a book and not its leverage. The function is sum(abs, w)^2 / dot(w, w), where v0.33 took 1 / dot(w, w). The two forms give one value on every book whose absolute weights sum to one, such as a long-only book with a budget of one. Elsewhere the value moves: [1.0, -1.0] gives 2, where v0.33 gave 0.5, and a book of zeros gives NaN, where v0.33 gave Inf. performance_summary also gives long_exposure, short_exposure, gross_exposure and net_exposure for each entry that holds weights, and DataFrame(ps) writes them after n_eff, so a measure cannot take one of those names.

  • currency_excess_index holds a cash index across a gap inside its span. A deposit accrues interest on every day, so a cash total-return index has a value at every observation from its first value to its last one. v0.33 divided by the gap, so the index was NaN on each holiday of the market of one cash index, and so was every currency factor of that observation. v0.34 holds the last value of the cash index there, so the index keeps the exchange-rate move of that day, and the observation that ends the gap carries the accrual of the whole gap. On fx = [2.0, 2.5, 3.0], a cash index [1.0, 1.0, 1.0] and a base cash index [1.0, NaN, 1.5], v0.33 gives [2.0, NaN, 2.0] and v0.34 gives [2.0, 2.5, 2.0]. A gap of fx, and a gap before the first value or after the last value of a cash index, stay gaps.

  • A PriceGapFill under CarriedPrice keeps an asset with no observed training price. v0.33 gave such an asset no entry in the PriceGapFillResult. So apply_preprocessing on a later window left every gap of the asset open, also after its first price in that window, where partial_fit_transform filled the gap. v0.34 keeps the asset in nx with a missing seed, so the fill reads the prices of the later window alone, as the online step does. nx under CarriedPrice now names every asset of the training window, and fit_preprocessing of a stepped PriceGapFill keeps the same assets. On a training window where B has no price, and a later window where B is [5.0, NaN, 6.0, 7.0], v0.33 gives [5.0, NaN, 6.0, 7.0] and v0.34 gives [5.0, 5.0, 6.0, 7.0]. A fill with a statistic, such as MedianValue(), still gives the asset no entry.

  • A product of fields of the asset panel takes the promoted type of its fields. A side of EWVolumeRatio that names a vector of fields reads their product. v0.33 multiplied in the type of the first field, so a Float32 first field cut a Float64 second field to Float32. v0.34 promotes the types, as the sum of fields does. With a Float32 field times a Float64 field near one, each entry of the product moves by up to 1e-7 relative, and an EWVolumeRatio over 30 observations moves by about 1.3e-8 relative. A product of fields of one type does not move.

  • A walk-forward with a BudgetCosts or a BudgetMarketImpact in bgt charges each fold the cost of its own trade. v0.33 did not pass the previous weights to bgt, so every fold charged the cost of the move from the caller's reference w, and not from the book that the fold trades from. v0.34 replaces the reference with the previous weights, as a Turnover does, and the folds run in order. On the returns 0.01 .* randn(StableRNG(7), 200, 5) .+ 0.0005, with BudgetCosts(; bgt = 1.0, w = fill(0.2, 5), vp = 0.05, vn = 0.05, up = 0.5, un = 0.5) and seven folds of IndexWalkForward(60, 20) under MaximumReturn, v0.33 ends at [0.243, 0, 0.7, 0, 0] and v0.34 ends at [0.498, 0, 0.454, 0, 0]. Write fixed = true on the estimator to keep the v0.33 result.

  • A BudgetCosts or a BudgetMarketImpact budget is a ceiling, and the floor of a BudgetRange in its bgt bounds the invested weights alone. v0.33 wrote sum(w) + cost == bgt on a split of the trade into a buy and a sale, and nothing kept one of the two at zero. So a programme that gained from cash bought and sold one asset together, and held the false charge as cash. v0.34 writes sum(w) + cost <= bgt, and sum(w) >= lb for a floor. The unused budget is cash. With every mean negative, MaximumReturn gave [0.15, 0.25, 0.25, 0.197, 0.15] and gives fill(0.15, 5). MinimumRisk under bgt = 1.0 gave sum(w) = 0.9514, and it now sells to cash. Bound the cash with bgt = BudgetRange(; lb = 0.95, ub = 1.0), or pin sum(w) + cost with xbgt = true on a BudgetCosts, under a mixed-integer solver.

  • A Frontier sweep of MeanRisk with a Custom Objective Term counts the term once. v0.33 added the term to the objective penalty each time the model got an objective, and the penalty kept every copy. A return or a risk frontier sets the objective of the minimum-risk end point, of one maximum-return end point for each swept term, and of the sweep. So the end points solved with the term counted once and twice, and each point of a one-term sweep with the term counted three times. Now each solve counts the term once, so the points and the span of the sweep move. A sweep with no cobj, and a solve with no Frontier, do not move.

  • A fallback leader of FollowTheLeader solves on the allocation set of the head. The set enters the entry of each member of the fallback chain of a JuMP leader. v0.33 gave the set to the held optimiser alone, so a fallback leader solved without it. The re-solve also sets the net budget of the held optimiser, and of each fallback, to the budget of one. So a fallback with bgt = nothing holds weights that sum to one. A solver-free fallback of a BestConstantRebalancedPortfolio takes the bounds of a BoundedAllocationSet, as the held estimator does.

  • A semidefinite phylogeny of a ProgrammeAllocationSet binds in the re-solve of FollowTheLeader. v0.33 gave a Variance of the leader the second-order cone, because the variance read the phylogeny of the block of the leader alone. The rows of the set then sat on a lift that no term held down and that took no penalty, so the weights did not move with the set's p. v0.34 marks the weights in phase 1 of each block that holds a semidefinite phylogeny, so every Variance on them takes the semidefinite formulation. A variance that the objective minimises then holds down the lift that the rows bind, as in a batch MeanRisk with the same phylogeny in its own ple. On 6 assets and 120 rows with two linked pairs and p = 0.05, the largest w_i w_j of a linked pair is 0.01997 in v0.33 and 1.6e-7 in v0.34, where the batch MeanRisk gives 1.9e-7. A leader with no variance does not move.

  • A Variance ceiling of a ProgrammeAllocationSet in the re-solve of FollowTheLeader takes the semidefinite formulation when the leader holds a semidefinite phylogeny in its own ple. The mark of the previous item reaches every variance on the weights, so the ceiling bounds the lift that the rows of that phylogeny bind. v0.33 gave the ceiling the second-order cone.

  • A TimeDependent schedule in a field of the leader of an online rule resolves at each fold. v0.33 resolved the schedules in the fields of the head alone. Each re-solve of the leader then reset a schedule in it to its fold-less value, the default or the static default of the field, so its entries never ran, and no message said so. v0.34 resolves each schedule of the rule tree at the fold, also in a leader among the experts of an ExpertMixture and under a FollowTheLeadingHistory. A schedule that reads ctx.w_prev, such as a PreviousWeightsFunction, gets the weights of the previous fold, and a walk-forward then runs its folds in order. On 10 rows of three assets and five folds of OnlineIndexWalkForward(5, 1) or IndexWalkForward(5, 1; expand_train = true), a MeanRisk leader with wb = TimeDependent(fill(WeightBounds(; lb = 0.0, ub = 0.4), 5)) had a largest weight of 1.0 at each fold in v0.33, and has 0.4 in v0.34.

  • The cobj of a ProgrammeAllocationSet enters the re-solve of a FollowTheLeader leader. v0.33 dropped it with no message, so a custom objective term on the set had no effect on the leader. v0.34 adds it once to the objective of the leader, as the same term on the held optimiser. On 40 rows of three assets, a term that costs 10 times the weight of the first asset gave [1, 0, 0] on the set in v0.33, and gives [0, 1, 0] in v0.34, the weights of the term on the held optimiser.

  • plot_weight_stability boxes the rows of prediction_weights. v0.33 stacked the weights of each fold on the universe of the caller and labelled the boxes with the names of the first fold. A fold whose universe differs from the first fold now boxes each weight under its own name, as the composition plots do, and a failed fold is absent from every box.

  • A search over a MultipleRandomised scheme with no seed draws its folds from rng itself. v0.33 drew one seed from rng and split the data for each candidate with that seed. v0.34 splits the data once and passes the folds to each candidate. So at the same rng, the search scores other folds than v0.33, and rng ends in another state. Every candidate still scores the same folds. A scheme with a seed gives the folds of v0.33.

  • plot_portfolio_cumulative_returns of a population draws one curve for each member. v0.33 drew an empty figure. Each curve takes the label of its member, the key of the path that portfolio_report uses, and the keywords of the call, as the curve of a path does.

  • A TimeDependent schedule inside an Online(pipe) step of a Pipeline resolves at each fold. v0.33 read such a step as a step with no schedule, so each fold of an online scheme ran the default of the schedule, and a schedule with too few entries ran with no message. v0.34 reads the step as the pipeline that it wraps, so the step gives the answer of Online(pipe) run alone, and a schedule whose count of entries is not the count of folds raises a DimensionMismatch. On 150 rows of four assets with TimeDependent([EqualWeighted(), InverseVolatility(), EqualWeighted()]; default = EqualWeighted()) and OnlineIndexWalkForward(60, 30), fold 2 gave the equal weights in v0.33, and gives the inverse volatility weights in v0.34.

  • EWMean, EWVolumeRatio and DaysToCover divide their state by the sum of its weights. The state of the recursion starts at zero, so after n valid observations of an asset it is 1 - decay^n times a weighted mean. v0.33 gave that state as it is. So every value of an asset with a short history, such as an asset listed late, was shrunk toward zero, and its days to cover was too large by the inverse. v0.34 divides by 1 - decay^n, as EWVolatility already did. This holds for the presets EWMomentum, EWShareTurnover and EWAmihudIlliquidity too. On a constant share turnover of 0.01 and the default half-life of 21, the first value of an asset listed late was 0.005 in v0.33, and is 0.01 in v0.34. Its first days to cover halves. The values converge to the v0.33 values as the count n grows. debias = nothing on EWMean or EWMomentum keeps the state undivided, as v0.33 did. On a panel that the restart of the next row does not move, it gives the v0.33 values bit for bit. For a volume ratio, multiply by 1 - decay^n, and divide a days to cover by it.

  • An inactive observation restarts EWMean, EWVolumeRatio and DaysToCover. v0.33 wrote NaN at an inactive cell and kept the state and the count of the asset. So an asset that delisted and listed again carried its history from before the delisting, and a finite value at an inactive cell advanced the state. v0.34 sets the state and the count to zero at an inactive cell, as EWVolatility and the beta Descriptors do, so the warm-up runs again after a relisting. With a skip, the recursion after the restart reads no return of an observation at or before the inactive one. This holds for the presets EWMomentum, EWShareTurnover and EWAmihudIlliquidity too. A panel whose assets stay active after their first listing, and whose inactive cells hold no finite value, keeps its numbers. No keyword gives the v0.33 values back.

  • The degrees of freedom of an idiosyncratic variance of a CrossSectionalFactorPrior read the active mask. The variance restarts an asset where it turns inactive, but v0.33 counted every finite residual of the asset. So an asset that listed again kept the count of its rows before the delisting, and a delisted asset, whose variance is NaN, had the full count. On a synthetic panel of 80 assets and 420 observations, with 18 to 28 delisted assets by the draw, each delisted asset had about 113 degrees of freedom under the market factor alone, and about 96 with an industry factor and a size factor too. Each one now has 0. The count of an exponentially weighted variance now reads the rows after the last inactive row of each asset. A variance estimator of your own reads the mask in its own method, see If you extend the library. A bound that ResidualInflation sets moves only on a panel with a delisting or a relisting.

  • The exponentially weighted beta Descriptors regress the observations of each asset alone. v0.33 advanced the market mean and the market variance at every observation, and the covariance of an asset only at its own valid observations, from a mean that started at zero. So an asset that is listed late, or that misses observations, divided a covariance of its own observations by a variance of all of them, and its beta was biased toward zero. v0.34 keeps one set of weighted moments per asset, of the market, of the reference series of an EWMacroSensitivity and of the asset, over the valid observations of the asset, so the beta is the slope of a weighted regression with an intercept on those observations. On the parity panel of 80 observations and 12 assets, the asset listed at observation 21 has an EWMarketBeta(; half_life = 8) of 1.24 at observation 29, where v0.33 gave 0.906. An asset listed on the whole panel moves too, because v0.33 started its means at zero, and that start keeps the weight decay^n after n observations. On the same panel, such an asset moves by up to 0.29 at the first value of EWMarketBeta(; half_life = 8), at observation 8, and by up to 0.0028 at observation 40. With the default EWMarketBeta(), it moves by 0.007 to 0.032 over observations 60 to 80. The same rules give five more changes:

    • An inactive observation resets the asset in EWBeta, EWMacroSensitivity and EWDownsideBeta, as it did in the residual volatility. A relisted asset starts a new history, and its beta is NaN until it has the observations of a new warm-up: max(2, min_obs) for a market beta, max(3, min_obs) for the partial beta of an EWMacroSensitivity, and min_obs for an EWDownsideBeta. v0.33 resumed the state that it left.
    • A window of agg_obs > 1 averages the series of an asset over the same observations, those where the asset is active and every series is finite. An inactive observation clears the open window of its asset.
    • A beta is NaN where it has no denominator. That is where the market does not vary over the observations of the asset, where the market falls short of the target of an EWDownsideBeta on none of them (v0.33 gave 0), and where the market and the reference series of an EWMacroSensitivity are almost perfectly correlated. The partial beta needs three observations, or two where the market is constant, which the intercept then absorbs.
    • The shrinkage of an EWBeta with a group weighs each beta against the sampling variance of the weighted least-squares slope, which needs three observations. v0.33 divided the residual variance by twice the half-life. A beta with no finite variance turns NaN where its group shrinks it, and a group whose prior variance is zero keeps the lower bound of the weight.
    • EWResidualVolatility forms a residual from the beta_min_obs-th observation of the beta, and its warm-up counts the residuals. With the defaults and no missing return, the first value is at observation 69, where v0.33 gave one at observation 60.
  • The JuMP model of MeanAbsoluteDeviation is exact for every target of the deviations. v0.33 registered the one-sided row mad_t >= tgt - x_t and reported 2 mean(mad), which is the mean absolute deviation only when the target is the mean of the net series. Under mu = 0.0 the v0.33 model held 0.003182, where the functor gives 0.003990. v0.34 adds mean(net_X) - tgt, so the model and the functor differ by 2.6e-10 relative at most under every target. A portfolio with MAD and a target other than the mean moves. So does a portfolio whose prior mean is not the sample mean, such as a James-Stein mean, under the default target.

  • The entropic and the relativistic measures, the power-norm measures and the even moment model read no observation of zero weight. The programmes of ERM, RRM and PRM, the JuMP models of EntropicValueatRisk, RelativisticValueatRisk, PowerNormValueatRisk and their drawdown and range forms, and the JuMP model of LowOrderMoment(; alg = EvenMoment()) held one cone row for each observation, also for an observation of weight zero. Such a row holds no probability, but the row of a large loss stopped the solver far from the optimum, and the solver reported success. v0.34 builds the rows on the observations of positive weight. With a crash of -0.3 on a zero-weight row of 150, the EVaR weights equal the weights without the row. At p = 3 the v0.33 even moment model held 3.8389e-5, where the functor gives 3.7756e-5, and its weights moved by 6.5e-4. With no zero weight, each model is the programme of v0.33.

  • PRM returns the largest loss with no solver where $\alpha \pi^{-1/p} \le 1$. The measure is then the largest loss. v0.33 solved the programme there, at the boundary of the cone, where a solver can stall and give NaN.

  • A ub on the gain tail of a GenericValueatRiskRange with a DistributionValueatRisk tail binds. The v0.33 model bounded the negated value of the tail, so the bound did not bind the portfolio. v0.34 bounds dot(mu, w) + z * g, the value that the functor gives on -w. Under MaximumReturn, the gain tail is 0.017057 with no bound, and with ub = 0.0085285 on the gain tail it is 0.0085285 at the optimum. A portfolio with such a bound moves.

  • WorstRealisation beside Range keeps its bound, and a second instance of a measure that reads no index warns. MaximumDrawdown, WorstRealisation, NoRisk, Range and BrownianDistanceVariance register one risk expression in a model. In v0.33 a second instance of one of these types lost its bound and its scale with no message. In [Range(), WorstRealisation(; settings = RiskMeasureSettings(; ub))], the WorstRealisation added no bound and no risk term, because both read one key. v0.34 builds the bound of WorstRealisation there, and its value at the optimum equals ub. A second instance of one type still has no effect, and it logs a warning that names its type and its settings.

  • owa_rg(1) is [0.0]. v0.33 wrote -1 and then 1 into the one entry, so it returned [1.0], and the ordered weights range of one observation was that observation. OWA_RG() of one observation now gives 0.0, as Range does. For T >= 2 the weights do not change.

  • Three fits of the regime-adjusted moments move. LogRegimeAdjusted with an x other than 1/2 scales the volatility by exp(s / 2), where v0.33 took exp(x s), which is correct only at x = 1/2. The raw statistic of DiagonalTarget for the first moment, debias = nothing, which v0.33 spelled RawStatistic(), divides by the mean of a $\chi(n)$ law, $\sqrt{2} \Gamma((n + 1) / 2) / \Gamma(n / 2)$. v0.33 divided by $\sqrt{n}$, so at n = 6 the raw statistic moves by the factor 1.08655 before the clip. Under the default ExactDebias(), the same fit moves by round-off alone, 7.4e-16 relative at most. A row with no valid asset counts as one lag of the HAC variance, where v0.33 skipped it, so the returns on the two sides of a holiday no longer read as adjacent. At hac_lags = 2, the variance of the first moment on a panel with a holiday moves by 0.14 % at the median and by 0.47 % at most.

  • AngularDist, and so the default FeatureDistance, keeps a Float32 or a BigFloat input. v0.33 promoted the type with Float64, so a Float32 feature matrix gave a Float64 distance matrix under every collapse. An Int or a Rational input still gives Float64.

  • matrix_square_root(RidgeCholeskySquareRoot(), M) keeps the type of a Float32 matrix that needs a ridge. v0.33 read the ridge as a Float64, so such a matrix got a Float64 factor, where its plain factor is Float32.

  • vcat of two asset panels whose equal static fields have different element types promotes the type. v0.33 took the element type of the first part, so a Float32 field and an equal Float64 field gave a Float32 field. The field stays lazy.

  • A DateWalkForward with a negative period_offset keeps its last anchor. v0.33 added the offset to the whole range of anchors. Under a calendar step the shifted range restarted its step from the shifted start, so it dropped an anchor in the last abs(period_offset) of the data, and the fold of that anchor. v0.34 shifts each date. On daily data from 2021-01-01 to 2021-02-25, with period = Month(1) and period_offset = Day(-10), the anchor 2021-02-19 now opens a second test fold under reduce_test = true. The test windows are [22:49, 50:56], where v0.33 gave [22:56]. A fixed step and a fixed offset, such as Day or Week, keep a StepRange.

  • OptimalNumberClusters(; alg = SecondOrderDifference()) selects one cluster on two assets. The ceiling of the count is floor(Int, sqrt(2)) = 1, and v0.33 selected k = 2 on the hierarchical and on the non-hierarchical branch. v0.34 returns the ceiling, as SilhouetteScore and a stated k do.

  • BayesianBlackLittermanPrior forms its posterior mean before mp processes the covariance. v0.33 formed the mean from the processed covariance. So a processing step that changes the covariance, such as MatrixProcessing(; dn = Denoise()), moved the mean, and the equation mu == rr.M * fpr.mu + rr.b + rf of its docstring failed by 0.0060. The default MatrixProcessing() leaves a positive definite covariance unchanged, so a default fit does not move.

  • OWAJuMP(; alg = MaximumEntropy()) maximises the entropy of the L-moment coefficients. v0.33 maximised the entropy of an auxiliary vector that every feasible point let take the value 1/T, so the objective did not depend on the weights, and the weights were where the solver stopped. So the two encodings, RelativeEntropy() and ExponentialConeEntropy(), gave weights 6.1 % apart. v0.34 has one maximiser, and the weights of the two encodings differ by 2.7e-6 at most. The OWA weights of MaximumEntropy move. The default so resolves to 1e-3 under MaximumEntropy. At so = 1, Clarabel stopped short on 11 of 15 programmes of the new objective, and each of them fell back to ncrra_weights.

  • The radius of a distributionally robust measure reads the count of the rows that the measure holds. This holds for DistributionallyRobustConditionalValueatRisk, DistributionallyRobustConditionalValueatRiskRange and DistributionallyRobustConditionalDrawdownatRisk. v0.33 read the count of the observations behind the moments. Under a cap on the scenarios, EmpiricalPrior(; max_scenarios), the rows are fewer, so the ball was too small. With max_scenarios = 250 over 1250 observations, the radius of ConcentrationRadius and of DualNormRadius grows by sqrt(5), and the radius of DimensionalRateRadius by 5^(1/N) on N assets. The new field n of CalibrationContext carries the count, see If you extend the library. With no cap and no observation weights, the radius does not move.

  • RateRadius and RateSignificance read the count of the rows that the measure prices, and the observation weights. v0.33 read the count of the observations behind the moments, and no observation weights. RateRadius now reads the count of its site, as the three rules of the row above do. RateSignificance reads the count that CountOf reads. With no cap on the scenarios and no observation weights, neither rule moves. Three cases move:

    • A distributionally robust measure with RateRadius under a cap. With max_scenarios = 250 over 1250 observations, RateRadius() gives the radius 1 / sqrt(250) = 0.0632456, where v0.33 gave 1 / sqrt(1250) = 0.0282843. So the ball grows by sqrt(5), and it equals the ball over the same 250 rows with no cap. RateRadius in a regularisation slot, l1 or linf, under the cap does not move.
    • A tail measure with RateSignificance under a cap. Its level grows by sqrt(5) in the same way, from c / sqrt(1250) to c / sqrt(250).
    • Observation weights. A robust measure or a regularisation slot with RateRadius, and a tail measure with RateSignificance, read the Kish count of the weights, where v0.33 read the count of the rows. On 250 rows with weights 0.99 .^ (249:-1:0), whose Kish count is 169.158, both rules give 1 / sqrt(169.158) = 0.0768872, where v0.33 gave 1 / sqrt(250).
  • A MedianAbsoluteDeviation with observation weights takes the weighted median of the absolute deviations. v0.33 gave the deviations to StatsBase.mad, which reads no weights, so the weights moved the centre alone. A measure with no weights does not move.

  • bigger_is_better of a NonOptimisationRiskRatio follows its numerator, and bigger_is_better(ThirdCentralMoment()) is true. v0.33 gave false for each. So a search or a selection rule that scored on a ratio with a return numerator, such as NonOptimisationRiskRatio(; r1 = MeanReturn(), r2 = ConditionalValueatRisk()), or on the third central moment, put the worst candidate first. A ratio with a risk numerator still gives false.

  • risk_contribution divides each term by its own degree of homogeneity. v0.33 read a ratio as a measure of degree one, and VarianceSkewKurtosis as one measure, so the contributions of a ratio of another degree and of VarianceSkewKurtosis did not sum to the risk. In v0.34 the contributions of a homogeneous measure sum to its risk. EqualRisk and a measure of degree zero give zero contributions.

  • risk_contribution gives the plain marginal contributions w .* g of a measure that is not homogeneous. g is the gradient of the risk. v0.33 read the degree from the type of the measure alone, and divided by it. A fixed target other than zero, or a fixed fee, makes a measure not homogeneous, so no degree applies. These cases move:

    • A measure of degree 2, 3 or 4 with a fixed target other than zero: a LowOrderMoment, a HighOrderMoment or a ThirdCentralMoment with a number target or a VecScalar target with an offset, and a TrackingRiskMeasure with SquaredL2Norm against a benchmark other than zero. v0.33 divided by the degree.
    • A measure of degree other than one that reads the net returns, under a one-off fixed fee, which is fl, fs or flq without AmortisedFees, or under a periodic fee that does not cancel from its risk: a turnover against weights other than zero, lq, or an amortised fixed fee.
    • A ratio whose side is one of these measures.

    The contributions of these measures do not sum to the risk. A RiskTrackingRiskMeasure against benchmark weights of zero is its inner measure, so it divides by the degree of that measure, where v0.33 divided by one. Its contributions then sum to its risk.

  • risk_contribution and risk_gradient of a measure whose value is a solve read its worst-case distribution. These are EntropicValueatRisk, RelativisticValueatRisk and PowerNormValueatRisk, their drawdown forms, their relative drawdown forms and their ranges, twelve measures in all, and every vector, ratio, tracking measure and GenericValueatRiskRange that holds one. v0.33 took a finite difference of one solve for each asset, and the gap of each solve was as large as the signal. So the contributions missed the risk: on the data of the review, sum(rc) / risk was 0.999957 for EVaR and 1.000159 for RLVaR. v0.34 solves once and differentiates the expected loss under the worst-case distribution. The contributions sum to the risk within 1e-6, and risk_gradient equals a central difference within 2.4e-5.

  • ApproxOrderedWeightsArray builds no p-norm cone for a weight vector with at most one entry strictly between its smallest and its largest value. owa_cvar and owa_wr are such vectors, and so are both tails of OWA_CVaR_RG. v0.33 built the cones of every order in p for each vector. Such an optimum sits at the apex of every cone, and the default Clarabel stopped at SLOW_PROGRESS: the minimum-risk range of two CVaR tails gave 0.017781, where the exact optimum is 0.017823. v0.34 solves an exact linear programme for such a vector, and its value equals the exact optimum within 2.9e-8. A vector with more inner entries, such as owa_gmd or owa_tg, keeps its cones and does not move.

  • EqualRisk keeps the element type of the weights. v0.33 returned inv(length(w)), a Float64, for Float32 weights.

  • The barrier of NearOptimalCentering reads both weight bounds. v0.33 wrote -log(w_i) for each asset, so a lower bound other than zero added the hidden row w_i > 0, and the centre was not the analytic centre of the bounds. v0.34 writes -log(w_i - lb_i). A portfolio with a lower bound other than zero moves. The default bounds lb = 0 and ub = 1 do not move.

  • LogRiskBudgeting with an orthant vector z drops the row sum(z .* w) - k >= 0. No source states the row. It does not bind at the default budget of one, so only a portfolio whose gross exposure passes one moves.

  • A sweep on two terms of VarianceSkewKurtosis gives one portfolio for each pair of levels. v0.33 swept the first Frontier and dropped the second with no message. A Frontier(; N = 3) on vr and on kt now gives nine portfolios, and the cap max_frontier counts the product.

  • Models (B) and (C) of RelaxedRiskBudgeting hold the factor n of their source, and p of Model (C) is its λ. RegularisedRelaxedRiskBudgeting writes ρ² >= n w'Σw, where v0.33 wrote ρ² >= w'Σw, and RegularisedPenalisedRelaxedRiskBudgeting writes ρ² >= n p z'Θz, where v0.33 wrote ρ² >= p z'Θz. n is the count of the entries of the risk budget, and Θ is the diagonal of the covariance of z. Write p / n to keep the Model (C) of v0.33. No field keeps the Model (B) of v0.33. With a target return 1.2 and 1.5 times the return of the risk parity portfolio, Model (B) moves by 0.044 and 0.031, and Model (C) at p = 5 by 0.045 and 0.112. BasicRelaxedRiskBudgeting does not move.

  • RiskBudgeting puts a floor on its scale variable k. v0.33 left k free. The new field kmin defaults to nothing, which gives the floor 1e-4 / b, with b the absolute upper end of the net budget, and zero for a budget of zero or an infinite budget. A negative kmin raises a DomainError. Where the floor does not bind, the solve moves within its precision: the pinned solves of the test suite moved by a median of 5e-5 to 1.6e-4, and by 1.8e-2 at most.

  • A Frontier sweep under MaximumRatio solves its two end points on a model with k = 1. v0.33 solved them on the ratio model, so at rf = 0 every point of the sweep was the tangency portfolio, and at rf > 0 the end-point solve failed. v0.34 builds a second model for the end points, and the sweep spans the range from the minimum-risk portfolio to the maximum-return portfolio. A level above the risk of the tangency portfolio still gives the tangency portfolio.

  • RandomisedSearchCrossValidation draws n_iter joint trials. v0.33 drew n_iter values of each key and searched the grid of their product, so three keys gave up to n_iter^3 candidates. v0.34 draws n_iter points of the joint grid. Over grids of vectors, it draws min(n_iter, |Λ|) distinct points, so on three keys of four values, n_iter of 3, 10, 64 and 200 gives 3, 10, 64 and 64 trials. With a distribution, each trial draws one value of each key, and a multivariate distribution gives one vector for each trial. The same rng gives the same trials. An n_iter at or above the size of a grid of vectors gives the grid search.

  • The functor of Skewness is the raw third moment of its coskewness matrix. expected_risk(Skewness(), w, pr) gives w' M3 (w ⊗ w) of pr.sk, the value that a bound on the measure holds. v0.33 gave the standardised skewness of the returns of the portfolio. On 250 observations of 5 assets with a skewed asset, over a high order prior, v0.33 gave 0.0227 and v0.34 gives 2.92e-9. Every reader of the functor moves, such as the span of a sweep on a skewness floor. Write ThirdCentralMoment(; ve = SimpleVariance()) for the v0.33 value. The functor of Kurtosis reads kt, which each JuMP model of the measure read in v0.33 too, so the models do not move. Over a high order prior, its readers move by rounding alone: expected_risk by 1.0e-13, HierarchicalRiskParity and HierarchicalEqualRiskContribution by 3.5e-14 at most, and risk_contribution by 6.4e-10.

  • A weighted moment reads its effective count. v0.33 read the count of the rows of X at each site that prices the sampling error of a weighted moment. v0.34 reads the Kish count (sum(w))^2 / sum(w .^ 2) of analytic or probability weights, sum(f) of frequency weights, and the count of the rows of a window. With no weights and with unit weights, 69 of 70 values do not move. The one that moves is a rolling window under a denoiser. These results move:

    • A denoiser over a weighted Covariance, GeneralCovariance or DistanceCovariance, over either exponentially weighted covariance, over a rolling or a seed WindowedCovariance, and the denoiser of a weighted Cokurtosis or Coskewness. A denoiser keeps the same factors at both counts when no eigenvalue lies between the two edges of the band of noise, so the matrix moves only when one eigenvalue does. On 90 observations, WindowedCovariance(; window = 40) under a denoiser moves by 1.79 relative, because the denoiser reads the 40 rows of the window.
    • A prior with a weighted me or ce. Its normal uncertainty sets, its calibration rules, the default tau of Black-Litterman and the denoisers of its assembled matrices read the Kish count. The normal sets of an entropy pooling or an opinion pooling prior read the Kish count of w in place of its perplexity, so they are wider.
    • A ShrunkExpectedReturns over a weighted me. JamesStein, BayesStein and BodnarOkhrinParolya price the error of the sample mean at the effective count of me. On the reference data of the test suite, three shrunk means over SimpleExpectedReturns with observation weights move by up to 6.8 %, 10.6 % and 62 %. An unweighted mean keeps T = size(X, 1), and its result does not move.
    • A prior over a StandardDeviationExpectedReturns or a VarianceExpectedReturns with a weighted ce. The mean states the count of the covariance of ce. So its normal mean set, its Black-Litterman tau and its calibration rules read a Kish count, such as 95.6, where v0.33 read 200 rows.
    • An EmpiricalPrior over a PriorExpectedReturns whose inner prior weights its mean or pools. The outer mean states the count of the inner prior. So the normal uncertainty sets, the calibration rules and the default Black-Litterman tau of the outer prior read that count, where v0.33 read the rows. Under an inner mean with the weights 0.98 .^ (200:-1:1) on 200 rows, the count is 95.58. The moments do not move.
  • The bare ImpliedVolatility() does not repair a matrix that is not positive definite. The v0.33 default held mp = MatrixProcessing(), which holds a Posdef repair. On 30 observations of 50 assets, the smallest eigenvalue was 1.7e-16 in v0.33 and is -2.3e-19 in v0.34, and the entries move by 8.9e-17 at most. On 200 observations of 10 assets the matrix does not move. PortfolioOptimisersCovariance(; ce = ImpliedVolatility(; …)) gives the v0.33 matrix, also as the ce of another estimator, such as ClustersEstimator(; ce = PortfolioOptimisersCovariance(; ce = ImpliedVolatility(; ppy = 252))).

  • A table of prices with no gap and no field of the asset panel gives no asset panel. prices_to_returns of such a table gives pnl = nothing, where v0.33 gave a panel whose masks were all true. A panel that holds its masks alone holds pf = nothing, where v0.33 held an empty vector. A table with a gap keeps a panel of its masks, and a table with a field of the asset panel keeps its panel. Code that reads rd.pnl of such data now reads nothing.

  • CountOf in a significance slot and EntropyBudget read the rows of the measure under a cap on the scenarios. Under EmpiricalPrior(; max_scenarios) with no observation weights, the level of CountOf(n) is n over the count of the rows that the measure holds, and EntropyBudget reads the same count. v0.33 read the effective sample size of the observations behind the moments. In the test of the fix, v0.33 gave the level 0.02 where the rows give 0.1, and an EntropyBudget paid -2.716 on a budget of -5. With no cap, the level does not move.

  • The separate path of RegimeAdjustedExpWeightedCovariance with HAC lags scores an asset only on a built block. With a cor_decay and hac_lags > 0, v0.33 wrote the block of the correlation only when every active asset had a diagonal. So a late listing kept the block of every other asset at the row before, and the next row scored those assets against it. v0.34 writes a zero row for an asset with no diagonal, and the other assets take their row. A covariance with one decay does not move.

  • The feature matrix of a categorical field of the asset panel with an observed mask holds one mask column. The column is "<name>::observed", where v0.33 gave one column for each level, such as "sector=T::observed". The mask of a tensor with one label is "<name>=<label>::observed".

  • OWA_RG, OWA_CVaR_RG and OWA_TG_RG return an OrderedWeightsArrayRange, and their optimum under ApproxOrderedWeightsArray moves toward the exact optimum. v0.33 returned an OrderedWeightsArray. The value of each functor and the minimum risk under ExactOrderedWeightsArray do not move. On 100 observations of 8 assets, the exact value of each measure at the approximate optimum was above the exact optimum by 0.31 %, 1.03 % and 0.44 % in v0.33. In v0.34 it is above it by 0.00 %, 0.00 % and 0.06 %.

  • The edof of a CrossSectionalFactorPrior on a rank-deficient period counts the rank of the design. Each period spends the rank of its design, where v0.33 spent its count of columns. A market column beside a one-hot industry block is such a design. On the panel of the test suite, with five columns of rank four, the edof of most assets is 96.316, where v0.33 gave 93.319.

  • A bound on BrownianDistanceVariance under MaximumRatio binds. v0.33 bounded the risk expression, which is of degree two in the weights. Under the scale variable of the ratio such a row does not hold the bound, so the tangency portfolio could break it. v0.34 bounds the square root of the expression, which is of degree one, as Variance does. The bound then holds under MaximumRatio, and a Frontier on the measure sweeps the square root.

  • A JuMP solve with a risk bound or a return bound can stop at another point within the tolerance of the solver. v0.34 divides each bound row by the size of its bound, and each anchor cone of NearOptimalCentering by the width of its region. A positive scale does not change the feasible set, so the optimum does not move, but the solver meets the rows on another path. At the default tolerances of Clarabel, the wealth of a point of a MeanRisk frontier at its return bound moves by 1.3e-5 against v0.33, and by 5.8e-7 at tolerances of 1e-12. Its performance summary and its regret move with it. A ceiling of NearOptimalCentering on a measure such as Kurtosis or EntropicValueatRisk, which the unscaled rows broke at the default tolerances, holds on the cases of the review. A centring model that v0.33 stopped at SLOW_PROGRESS can solve: on the last 253 rows of SP500.csv.gz, with r = UncertaintySetVariance(; ucs) of a box set and the default Clarabel settings, v0.33 returned an OptimisationFailure and v0.34 solves.

  • A logarithmic return on a weighted prior reads the observation weights of the prior. This holds for expected_return(LogarithmicReturn(), w, pr), for expected_risk of an ExpectedReturn or an ExpectedReturnRiskRatio over a LogarithmicReturn, and so for each ratio and summary over a log return, on a prior with weights, such as an entropy pooling prior. v0.33 took the plain mean of log1p.(X * w), where the JuMP model read the weights. On an entropy pooling prior with one view on a mean, expected_return(LogarithmicReturn(), w, pr) moves from 0.000556308 to 0.000982213, and at the optimum of the model it equals the model within 1.9e-12 relative. A prior with no weights, an ArithmeticReturn, and expected_risk of a population of weight vectors do not move.

  • The warning of a JuMP optimiser that no solver finishes states each failed stage and its termination status. v0.33 logged Failed to solve optimisation problem. and a pointer to result.retcode.res. v0.34 logs Model could not be solved satisfactorily (n solver trial(s))., then one line for each failed stage of each solver, with the termination status in words, such as INFEASIBLE: no solution satisfies every constraint, and then the same pointer. Each failed trial in res.retcode.res holds :termination_status. The solve that builds a JuMPResult warned one line for each failed stage in v0.33 too, and it adds the line of the status. Each failed trial in its trials holds :termination_status. A test or a log filter that matches the v0.33 text must match the new text.

  • A JuMPEntropyPooling posterior puts no mass on a scenario of zero prior weight. v0.33 wrote the relative entropy cone over every scenario. A zero prior weight forces a zero posterior weight only in exact arithmetic, so the solver gave such a scenario a small positive weight, and kld was Inf. On 60 scenarios with two of zero prior weight, the two posterior weights were 3.4e-10 and 8.3e-10 under a mean view, and 6.3e-10 and 3.4e-10 under a CVaR view inside its band. v0.34 fixes these weights at zero and writes the cone over the support alone, so kld is finite and equals the kld of OptimEntropyPooling to the tolerance of the solver. A prior that is positive on every scenario does not move. LogEntropyPooling now solves over such a prior, as Calls that now answer states.

  • An OptimEntropyPooling fit gives the same posterior on each call. The dual solve keeps the point of its last evaluation, and skips the update of the objective and the gradient when the next point is equal. v0.33 started that store as uninitialised memory. When a freed array of an earlier fit held the start point exactly, the first evaluation read a stale objective and gradient, so two equal prior calls in one process could give two posteriors. On four CVaR fits of MeucciEntropyPoolingPrior, each run 60 times after a loop that frees arrays, the v0.33 store gave 134 of 240 posteriors that differ from the fit that reads no stale store, by up to 1.5e-3, and 2 of 240 fits raised Entropy pooling optimisation failed. v0.34 fills the store at the start point, and the same loop gives no difference and no error. A fit that did not read a stale store does not move.

  • brinson_attribution with one bound attributes the window of that bound. v0.33 applied the window only when the call gave both date0 and date1, and a single bound attributed the whole of X with no message. v0.34 applies each bound on its own. A call with date0 alone runs from date0 to the last observation, and a call with date1 alone runs from the first observation to date1. Write brinson_attribution(X, w, wb, asset_classes, col) with no bound to keep the v0.33 number.

  • expected_return of an ArithmeticReturn with a fitted uncertainty set gives the worst-case return over the set. v0.33 gave the nominal dot(w, mu), where the model expression of the term, and each bound on it, is the worst case. So a return Frontier on such a term took its levels from the nominal return, and its last levels were above the largest worst case: on the last 253 rows of SP500.csv.gz, with an L1UncertaintySet of CountOf(5), v0.33 swept [0.013519, 0.030196] and its last point was infeasible. v0.34 sweeps [-0.001437, 0.022103], and every point solves. The value is the one that the functor of UncertaintySetVariance gives for a fitted set of the covariance. It reaches each ratio and each measure that reads the term, such as expected_ratio and ExpectedReturn, and the anchors of NearOptimalCentering. An optimiser fits an estimator in ucs once, before it builds the model, so the resolved terms in res.jor.ret hold the fitted set, and expected_return(res.jor.ret, res.w, pr) gives the worst case. An estimator in ucs outside an optimisation, and a term with no set, give the nominal return as in v0.33. To keep the v0.33 number, call expected_return on the same term with ucs = nothing.

  • Accessors.set, and a search, on a type whose constructor computes a field. LogRegimeAdjusted computes kappa from x and y, NormalEquationsFit computes coef from its sums, and CustomValueReturnForecastResult and TargetReturnForecastResult set hist to nothing. v0.33 passed every field, the computed one too, to the positional constructor that @concrete writes, and that constructor skips the inner constructor. So the computed field kept its old value, and no check ran. Accessors.@set la.x = 3.0 on la = LogRegimeAdjusted() kept kappa = -1.2704, where LogRegimeAdjusted(; x = 3.0).kappa is 1.6159, and x = -1.0 gave no error. GridSearchCrossValidation and RandomisedSearchCrossValidation write each candidate through Accessors.set, so a search over x or y fitted every candidate with the kappa of the start value. v0.34 calls the keyword constructor, which computes the field again and runs each check. A patch of the computed field raises an ArgumentError that names the fields to set.

If you extend the library

  • Seven public types now subtype a root type, where v0.33 subtyped Any. AttributionComponent, AttributionBreakdown, AssetAttributionBreakdown, AssetFactorContribution and Resume subtype AbstractResult. CarriedPrice and PortfolioOptimisers.SubPortfolioUniverse subtype AbstractAlgorithm. PortfolioOptimisers.RangeTails, which v0.33 did not have, subtypes AbstractEstimator. A method of your own on a root type now reaches them, and so do the library methods on the roots: the REPL shows each one field by field, and length, iterate and getindex treat it as a scalar. A method of your own that takes one of the seven and a root type in two positions can now be ambiguous.

  • A range of your own subtypes PortfolioOptimisers.RangeRiskMeasure, and the library builds it. Every Range variant of the library subtypes RangeRiskMeasure <: RiskMeasure, a public type, where v0.33 subtyped RiskMeasure. A range of your own that decomposes into two point measures declares PortfolioOptimisers.range_tails(r) and PortfolioOptimisers.range_risk_key(r), the key under which the model stores the expression of the sum. The method of set_risk_constraints! for a RangeRiskMeasure then builds both tails and registers their sum, so the range needs no builder of its own. v0.33 gave a range of your own no builder. range_tails of a measure that is not a range raises a MethodError, where v0.33 raised an ArgumentError. A range that fuses its tails still raises the ArgumentError.

  • A fill policy or a panel field input of your own takes the active mask in its own method. asset_panel calls panel_fill(alg, v, act, name), panel_placeholder(alg, v, act) and panel_resolve(inp, amsk), as in v0.33. v0.33 also reached a policy that defined only panel_fill(alg, v, name) or panel_placeholder(alg, v), and an input that defined only panel_resolve(inp), through fallbacks that dropped the mask. These fallbacks are gone. Write panel_fill(alg::MyFill, v, ::Option{<:AbstractVector{Bool}}, name), panel_placeholder(alg::MyFill, v, ::Option{<:AbstractVector{Bool}}) and panel_resolve(inp::MyInput, ::Option{<:AbstractMatrix{Bool}} = nothing) to ignore the mask, or read it. A policy or an input with the v0.33 methods alone raises a MethodError in asset_panel. The library policies take act = nothing for a column with no mask, so panel_fill(ForwardPanelFill(), v, nothing, name) gives what panel_fill(ForwardPanelFill(), v, name) gave.

  • A method of yours that reads an array of rank three reads the observations last. A method of cross_sectional_regression for an estimator of your own, of unseen_member_design for a rule of your own for an unseen member, of factor_exposure for an observed exposure of several factors, or of attribution_leverage_split for a rule of your own reads Z[:, :, t] where v0.33 read Z[t, :, :], and gives an array of rank three with the observations last. See Arrays of rank three hold their observations last.

  • A rule of your own that reads the mean out of a recursion from zero subtypes AbstractZeroStartDebias, which is public, and adds a method of zero_start_mean(rule, s, decay, n), which is public too. ExpWeightedExpectedReturns, EWMean and EWMomentum take it in their debias field, and so do the three gradient transforms GradientMomentum, RootMeanSquareGradient and AdaptiveMomentGradient.

  • A gradient transform of your own returns its state with the transformed gradient. transform_gradient!(grad, gs, g) returns (gs, ĝ), the state of the transform after the period and the transformed gradient, where v0.33 returned ĝ alone and the rule kept the state that it passed in. Return the state that you wrote in place, as return gs, ĝ. A transform with the v0.33 return raises a TypeError at its first step. A transform with no method of gradient_state_seed keeps the state nothing, where v0.33 raised a MethodError. The three momentum transforms of the library keep a PortfolioOptimisers.GradientAverageState, which is public, with the count of the steps since the seed, where v0.33 kept a vector or a pair of vectors. A method of learning_rate for a schedule of your own that reads st.gs, the state of the transform in the state of the rule, reads st.gs.v and st.gs.m now.

  • A variance estimator of your own as the ce of EWResidualVolatility or EWResidualDownsideVolatility adds a method of PortfolioOptimisers.reads_active_mask, which is public. The constructor refuses a ce that is not mask-aware, as Calls that now raise states. It cannot see a method of variance_series over an asset panel that your type defines, so it refuses your type with an ArgumentError, where v0.33 called that method. If the method reads the active mask of each asset, add PortfolioOptimisers.reads_active_mask(::MyVariance) = true. A windowed series and a PortfolioOptimisersCovariance read the same method, and give your type the whole window.

  • A selection rule or a redundancy algorithm of your own drops a non-finite score. A method of rule_keep for a subtype of AbstractSelectionRule returns false at every NaN and every infinite score, under every parameter of the rule. A method of redundancy_keep for a subtype of AbstractRedundancyAlgorithm returns false at every asset whose given score is not finite. A subtype of AbstractAssetScorer writes NaN at an asset that it cannot score, and the asset must not survive a selection.

  • The Gerber, Smyth-Broby and Gerber IQ algorithms and the shrinkage targets are not moment forms. GerberCovarianceAlgorithm, SmythBrobyCovarianceAlgorithm, GerberIQCovarianceAlgorithm and AbstractCovarianceShrinkageTarget subtype AbstractAlgorithm, where v0.33 had AbstractMomentAlgorithm. A method that you wrote on AbstractMomentAlgorithm no longer reaches their members. An algorithm of your own in one of these families keeps working with the estimator that owns the family.

  • DiscreteAllocation and GreedyAllocation have the fields unit, sets and strict before fb. DiscreteAllocation takes eight positional arguments, where v0.33 took five, and GreedyAllocation takes unit, sets, strict and fb, where v0.33 took unit, args, kwargs and fb. A method that names the type parameters of DiscreteAllocation by position moves, because fb is now the eighth. In the model of DiscreteAllocation, the integer variable is the lot count z, and x is the expression lu .* z. finite_sub_allocation, finite_sub_allocation! and set_allocation_fees! take the lot unit after the prices.

  • A collateral algorithm of your own needs a third method. ca(w, prices, cash, smoney, sfee, lmoney, lfee) returns the cash that the account holds after both sides trade, and both allocators report it as cash. A rule with only the two v0.33 methods raises a MethodError when an allocator reports its cash. ProceedsCollateral returns cash + smoney - sfee - lmoney - lfee, and CashCollateral returns cash - smoney - sfee - lmoney - lfee. A NaN price in prices marks an asset with no price on the allocation date, and its weight in w is zero.

  • FiniteAllocationInput has a field upw after ca, so its positional constructor takes nine arguments, where v0.33 took eight. The keyword constructor keeps every v0.33 keyword.

  • EntropyPoolingPrior and MeucciEntropyPoolingPrior have a field diagnose after opt, so each positional constructor takes 18 arguments, where v0.33 took 17. The keyword constructors keep every v0.33 keyword. The default diagnose = nothing fits as v0.33 did. A solver, or a vector of solvers, in diagnose runs a feasibility programme over the scenarios before the entropy pooling solve, and a set of views that no posterior meets together raises a DomainError that names the view fields. The programme can cost more than the fit: on 1008 scenarios, from 1.6 to 69 times the time of the fit.

  • GridSearchCrossValidation and RandomisedSearchCrossValidation have the fields s_sca and n_best after scorer. n_best is the count of the best candidates that the search keeps. s_sca reduces the values of a vector of search scorers in scorer to one value per candidate, and the default nothing gives the sum. They also have the field rank_prediction after train_score. With rank_prediction = true, the Result keeps the prediction that the search scored for each kept candidate, and the default false keeps none. Their positional constructors take three more arguments. The keyword constructors keep every v0.33 keyword, and n_best = 1 with one scorer gives the v0.33 search.

  • HighestMeanScore has a field scale, the weight of the scorer in a vector of search scorers. HighestMeanScore() gives scale = 1.0, and the scale is inert for one scorer, so a v0.33 search does not move. A method that dispatches on HighestMeanScore keeps working, and the type now has one type parameter. The constructor raises an IsNonFiniteError for a scale that is not finite.

  • SearchCrossValidationResult has the fields ranked, rank_idx, rank_scores, rank_predictions and path_ids after idx, so its positional constructor takes 11 arguments, where v0.33 took 6. The keyword constructor keeps every v0.33 keyword, and the new keywords default to [opt], [idx], nothing, nothing and nothing. Under EachValue() in r_sca or s_sca of the search, opt, idx, ranked, rank_idx, rank_scores and rank_predictions hold one entry for each value, in a vector or a K × L matrix, and test_scores and train_scores hold one entry per measure under r_sca = EachValue(). So the bounds of these fields widen, and a method that dispatches on their types also meets these containers. Under r_sca = PerCandidate(sca) with a vector of measures, test_scores and train_scores also hold one entry per measure, and the other fields keep one ranking. A search of one value keeps the v0.33 types.

  • A search scorer of your own can define candidate_scores, which is public, to give one value per candidate. The search then orders the candidates by it, and it can keep more than one. It refuses values of another length with a DimensionMismatch, and a NaN value with an IsNonFiniteError. A scorer that defines only the index form keeps working at n_best = 1, and a search at n_best > 1 raises an ArgumentError that names the method to add.

  • A function scorer gives what a search scorer gives. It gives a vector of one value per column of the score matrix, bigger is better, or the index of one winner, as in v0.33. The search reads the form from the return. A function that gives an index with n_best > 1 raises an ArgumentError when the search runs, not when you build it. A scorer that gives an index raises an ArgumentError in a vector of scorers under a reduction in s_sca, and under r_sca = PerCandidate(sca), because an index has no value to combine. Under s_sca = EachValue() it keeps its one winner, and its entry of rank_scores is nothing. A subtype with a scale field defines PortfolioOptimisers.scorer_scale, which is public, to give its weight in a vector. The fallback gives 1.

  • Fewer type parameters on a Result. A Result does not carry the type of an estimator in a type parameter, so a verb on it compiles one time for every configuration of the estimator. MultiPeriodPredictionResult has no type parameter for opt. MeanRiskResult, RiskBudgetingResult, FactorRiskContributionResult, NearOptimalCenteringResult, HierarchicalRiskParityResult and SchurComplementHierarchicalRiskParityResult have none for r. The fields keep their bounds and their values. A method that names the type parameters of these types by position moves. Resume has a second field, opt, the estimator that its Result carries, and its second type parameter is the type of that estimator. Dispatch on it in place of the fourth parameter of MultiPeriodPredictionResult.

  • No type parameter for a scalariser or a returns estimator. ResolvedJuMPOptimiser, the jor of every JuMP optimisation Result, has none for ret and sca. It is ProcessedJuMPOptimiserAttributes, the pa of v0.33, see Renamed keywords and changed defaults. HierarchicalRiskParityResult has none for sca, and HierarchicalEqualRiskContributionResult has none for ri, ro, scai and scao. The fields keep their bounds and their values. A method that names the type parameters of these types by position moves.

  • PredictionResult has no type parameter for res. Its three type parameters are the types of rd, hw and idx, and res keeps the bound NonFiniteAllocationOptimisationResult on the field. So the folds of every optimiser have one type, and MultiPeriodPredictionResult narrows its folds to that type: eltype(p.pred) is concrete, where v0.33 gave PredictionResult. Write PredictionResult{<:Any, <:HeldWeightsResult} in place of PredictionResult{<:Any, <:Any, <:HeldWeightsResult}, and PredictionResult{<:PredictionReturnsResult{…}} in place of PredictionResult{<:Any, <:PredictionReturnsResult{…}}. A concrete_typed_array(p.pred) by hand is no longer needed.

  • LowOrderPrior and HighOrderPrior have the field eoc, the effective number of observations of each moment. It comes after ens in LowOrderPrior and after skmp in HighOrderPrior, so the positional constructors take 15 and 10 arguments, where v0.33 took 14 and 9. The keyword constructors give eoc = (nothing, nothing) when you omit it, and an entry of nothing means the number of rows of X. The property pr.eoc of a HighOrderPrior gives the four counts, the two of its low order prior first. eoc is not a type parameter, because an entry is nothing or a count by its value. So the type parameters are the 14 of LowOrderPrior and the 9 of HighOrderPrior of v0.33, in the same order, and a stated and an unstated count give one prior type.

  • Stacking stores a vector opti as a Vector{OptE_Opt_TD}. v0.33 narrowed it to the union of the types of its elements, so each combination of inner optimisers gave a new type of Stacking. A method that dispatched on the element type of opti dispatches on each element. A mixed literal needs no concrete_typed_array.

  • An estimator of your own that holds a child on another axis than the assets. The check of a UniverseSets walks the fields of each estimator that asset_axis_fields names. For a @propagatable struct with a @vprop field, these are the @vprop fields. For any other struct, these are all the fields that can hold an estimator, an algorithm or a vector. A struct of the second kind that holds a child that it fits on other data, such as the factor returns, defines asset_axis_fields for its type, and leaves that child out. Otherwise a correct universe in that child is refused.

  • PerformanceSummaryResult has the fields names, paths, members, date0 and date1 before n_periods, rf after compound, and n_eff, long_exposure, short_exposure, gross_exposure, net_exposure, measures and risk after turnover. Its positional constructor takes 29 arguments, where v0.33 took 16. Build it with performance_summary, or with the new keyword constructor PerformanceSummaryResult(; n_periods, ppy, …), which takes each field by name. The keyword constructor gives nothing to the keys and the dates, and an empty NamedTuple to measures and risk, when you omit them. In a summary of many entries, an omitted key or date is nothing at each entry. Both constructors check the values, as Calls that now raise states.

  • ClusterNode has two type parameters, ClusterNode{T, H}, the types of id and height. v0.33 had five, one for each field, so the type of a node held the shape of its subtree, and each new dendrogram compiled the methods that read it again. A method that names the type parameters of ClusterNode by position moves. left and right are nothing or a ClusterNode{T, H}, and the constructor raises a DomainError for a child of another id type or height type, which v0.33 accepted. level is an Int.

  • CrossSectionalLinearRegression and CrossSectionalTargetRegression have a field leverage before ex, so their positional constructors take four and five arguments, where v0.33 took three and four. The keyword constructors keep every v0.33 keyword, and the default leverage = true runs the leverage check of v0.33.

  • BudgetCosts and BudgetMarketImpact have a field fixed after their last field, and BudgetCosts has a field xbgt after fixed. So both positional constructors take eight arguments, where v0.33 took six and seven. The keyword constructors keep every v0.33 keyword, and fixed = true keeps the reference w at every fold, as in v0.33.

  • JuMPOptimiser holds its feasible set in a ConstraintBlock, in the field cbe. The block holds the slots wb, sbgt, gbgt, lt, st, lcse, cte, gcarde, sgcarde, smtx, sgmtx, slt, sst, sglt, sgst, tn, sets, tr, ple, ccnt, cobj, ss, card, scard, l2c, lpc, linfc, l1, l2, lp, linf and xbgt. The positional constructor takes 11 arguments, JuMPOptimiser(pe, slv, cbe, bgt, fees, ret, sca, sc, so, strict, cache), where v0.33 took 42. The keyword constructor keeps every v0.33 keyword, and it also takes cbe. A read such as opt.wb, a search key such as "opt.wb", Accessors.set and a pipeline route into a slot give the values of v0.33. A method that names the type parameters of JuMPOptimiser by position moves, and so does code that reads a slot with getfield(opt, :wb): read opt.wb or opt.cbe.wb. A path that names a slot, such as in an error message or in group_frames, now passes through the block, as "opt.cbe.tr.tr".

  • ProgrammeAllocationSet holds its constraint kinds in a ConstraintBlock, in the field cbe, as JuMPOptimiser does. r, ret, sc and so stay fields of the set. The positional constructor takes 7 arguments, ProgrammeAllocationSet(pe, slv, cbe, r, ret, sc, so), where v0.33 took 38. The keyword constructor keeps every v0.33 keyword, and it also takes cbe. set.wb and Accessors.set give the values of v0.33. A method that names the type parameters by position moves, and so does a getfield(set, :wb) read: read set.wb. A path that names a slot passes through the block, as "set.cbe.ple". A TimeDependent in a slot raises an ArgumentError, where v0.33 raised a TypeError: schedule the whole set.

  • A Custom Constraint or a Custom Objective Term of your own receives a ResolvedJuMPOptimiser. Write attrs::ResolvedJuMPOptimiser where v0.33 wrote attrs::ProcessedJuMPOptimiserAttributes. attrs.pr, attrs.fees, attrs.ret, attrs.wb and the other resolved constraints of v0.33 read as before. The norm ceilings l2c, lpc and linfc and the penalties l1, l2, lp and linf are resolved in attrs.cbr, with each calibration rule replaced by its value, where v0.33 resolved them in assemble_jump_model! and held them on the optimiser alone. The four builders set_weight_norm_2_constraints!, set_weight_norm_inf_constraints!, set_l1_regularisation! and set_linf_regularisation! no longer check their number, because the stage 2 of the block, resolve_constraint_block, checks it.

  • attrs.cbr can be a vector. When the head solves with more than one block, attrs.cbr is a vector of ResolvedConstraintBlocks with the block of the head first, and attrs.wb and the other forwarded reads give the block of the head.

  • A head of your own builds its weights and stops there. assemble_jump_model! now adds the weight bounds and the budgets, in phase 1 of the block of the head, with the net budget opt.bgt. A head that called set_weight_constraints!(model, attrs.wb, opt) before assemble_jump_model! now raises an ArgumentError that names the key w_lb or w_ub, because the model registers the row twice: remove the call. A long-only head checks its bounds with assert_long_only_weight_bounds(wb), where v0.33 passed long = true to set_weight_constraints!. That positional argument is gone.

  • set_weight_constraints! and the budget builders take prefix. set_weight_constraints!, set_budget_constraints!, set_long_short_budget_constraints! and set_gross_budget_constraints! register their rows under the prefix of a block, and the default Symbol("") gives the names of v0.33. A BudgetCosts or a BudgetMarketImpact under a non-empty prefix raises an ArgumentError, because it registers shared entries. assemble_allocation_set! is gone. set_block_constraints! and set_block_post_risk_constraints! add a block, and set_allocation_risk_return_bounds! adds the ceilings and the floor of a ProgrammeAllocationSet.

  • A Custom Objective Term of a ProgrammeAllocationSet receives the ResolvedConstraintBlock of the set. In a projection, add_custom_objective_term! gets the block Result of the set as attrs, where v0.33 gave nothing. The set also gives its ccnt and its cobj the price-adjusted allocation of the step through factory, as it gives its turnover and its tracking errors. set_allocation_set_constraints! returns the bounds of the step and the block Result, (wb, cbr), where v0.33 returned nothing. On a BoundedAllocationSet, cbr is nothing.

  • A projection gives a set the price-adjusted allocation before it views the set at the investable mask. The projection programme calls factory(set, w) on every asset, and then views the set at the mask of the step, as a JuMP head does. v0.33 viewed the set first, and then called factory with w on the mask. A Custom Constraint or a Custom Objective Term of your own that defines port_opt_view and holds w through factory now meets the view after factory, so its port_opt_view cuts w to the mask too. set_allocation_set_constraints! takes a three-argument form, (model, set, cbr), which adds a block that the entry resolved. The four-argument and the five-argument forms resolve the step themselves and refuse an asset that the prior of the set cannot price, as in v0.33. allocation_set_cobj is gone, and set_block_objective_terms! adds the cobj of a block.

  • The rows of a set in a leader's model are registered under blk_2_. The bounds and the short and gross budgets of a ProgrammeAllocationSet or a BoundedAllocationSet were anonymous rows in the model of a FollowTheLeader leader. The set is now the second block of the model, so its rows are blk_2_w_lb, blk_2_w_ub, blk_2_sbgt and the others, and a reader of the model can find them. The budget of one is the row bgt of the leader, because the re-solve sets the net budget of the leader to one. The return floor of a set clears its rte, so the floor no longer enters ret_vec of the leader. No weight moves, because the leader read ret_vec before the set added its floor.

  • A head of your own passes blocks to assemble_jump_model!. A JuMP head that gets more than one block adds the rows of every block to its model, where it added the rows of its own block alone. Its _optimise takes the keyword blocks by name, gives it to resolve_jump_optimiser, and gives the same value to assemble_jump_model!(...; blocks = blocks). Block i after the first registers its rows under the prefix blk_i_, so the second block gives blk_2_w_ub. A head of your own that leaves out the keyword of assemble_jump_model! adds its own block alone, as before. The unconstrained NearOptimalCentering adds the bounds and the budgets of each later block, and no other row of it.

  • A Custom Objective Term gets the objective of the model, once for each model. assemble_jump_model! calls add_custom_objective_term! once, with its own obj, the declared objective of a MeanRisk. v0.33 called it in set_portfolio_objective_function!, once for each objective that the model got. So the end points of a Frontier sweep gave the term MinimumRisk and MaximumReturn as obj, and now give it the declared objective. A method that dispatches on obj to change the term at an end point no longer can. set_portfolio_objective_function! takes (model, obj), where v0.33 took (model, obj, optimiser, attrs). A head of your own that calls assemble_jump_model! gets its terms from it, and calls set_portfolio_objective_function!(model, obj).

  • More entries of a JuMP model have a name. A BudgetCosts registers its rows wp_ub, wn_ub and cost_bgt_trade, and a BudgetMarketImpact also registers wip_pcone and win_pcone, where v0.33 left them anonymous. The gain tail of a range of returns registers the negated series gain_net_X, and a drawdown measure registers the negated path neg_dd, under the prefix of the measure. A Custom Constraint of your own that registers one of these names in the same model raises an ErrorException of JuMP. The rows and the weights do not move.

  • A test of the mean of your own returns a MeanTestResult. mean_test returns a MeanTestResult, which is public, where v0.33 returned the named tuple (; t_stat, p_value, mean_ci_lower, mean_ci_upper). A method of mean_test for a subtype of AbstractMeanTestEstimator builds it with MeanTestResult(t_stat, p_value, mean_ci_lower, mean_ci_upper) or with the same four keywords. The constructor raises a DomainError for a p-value outside [0, 1] and for a lower bound above the upper bound, and a NaN passes. A caller that reads the fields by name, as res.p_value or (; t_stat, p_value) = res, does not change. A caller that calls values, keys or merge on the answer reads the four fields instead.

  • factory returns every value that has no method of its own. factory(a, args...; kwargs...) = a takes ::Any, where v0.33 took an estimator, an algorithm, a result or nothing, and raised a MethodError for any other value. A struct of yours with an @fprop field that holds data, or a covariance estimator of StatsBase, needs no method. The methods of factory that only returned their input on StatsBase.CovarianceEstimator, AbstractBaseRiskMeasure, MomentMeasureAlgorithm, ValueatRiskFormulation, DimensionReductionTarget, phylogeny estimators and results, a number with a weights vector, and an AbstractRegressionTarget with an InterceptColumn are gone, and the leaf gives the same answer. The array method takes an AbstractArray of any shape, where v0.33 took an AbstractVector.

  • A return forecast estimator of your own takes a last regression argument. The prior calls return_forecast(rfe, rd, csfm, cre) with cre as orthogonal_forecast_regression gives it, nothing under every rule but OrthogonalPartCalibration. A member that reads no regression writes return_forecast(rfe::MyMember, rd, csfm, ::Nothing = nothing), and a member that folds writes return_forecast_step(rfe::MyMember, P, csfm, fs, ::Nothing = nothing). A member with only the three-argument method of v0.33 raises a MethodError in the prior.

  • A cross-sectional solve algorithm of your own takes six arguments in one method. The regression calls cross_sectional_solve(alg, A, y, t, F, ws), with the factorisation F that it took and the workspace ws of its task. v0.33 called a method of four arguments, cross_sectional_solve(alg, A, y, t). Write cross_sectional_solve(::MySolve, A, y, t, F = nothing, ws::NamedTuple = (;)), and ignore the two slots when the member reads neither. A member with only the four-argument method raises a MethodError in the regression.

  • resolve_deferred_quantities takes a prior result. A call with a second argument that is not an AbstractPriorResult raises a MethodError, where v0.33 returned the first argument. No caller in the library made such a call.

  • A cross-sectional solve algorithm of your own returns a CrossSectionalSolveResult. cross_sectional_solve and cross_sectional_target_solve return a CrossSectionalSolveResult, which is public, where v0.33 returned the vector of the factor returns. The field f holds that vector. The field edof is new: the residual count of the fit, which the regression writes into edof of CrossSectionalRegression. A method for a subtype of AbstractCrossSectionalSolveAlgorithm builds it with CrossSectionalSolveResult(f, edof) or with the same two keywords. The constructor raises a DomainError for a residual count that is not finite, and a count below zero passes. A method that returns a vector, as in v0.33, or a named tuple raises a MethodError in the regression. A caller that used the vector reads res.f. A caller that compares two answers with == compares their fields instead.

  • A descriptor of your own that folds returns a DescriptorStepResult. descriptor_step returns a DescriptorStepResult, which is public, where v0.33 returned the named tuple (; de, D). A method for a subtype of AbstractDescriptorEstimator builds it with DescriptorStepResult(de, D) or with the same two keywords, from the estimator with its new state and the matrix of the descriptor. The carry fold of the prior reads it through descriptor_carried, which takes nothing or a DescriptorStepResult, so a method that returns the named tuple raises a MethodError in the fold. A caller that reads the fields by name does not change.

  • An unseen member rule of your own returns an UnseenMemberDesignResult. unseen_member_design returns an UnseenMemberDesignResult, which is public, where v0.33 returned the named tuple (; Z, P). A method for a subtype of AbstractUnseenMemberRule builds it with UnseenMemberDesignResult(Z, P), or with the keywords Z and P, whose default is (). P is a vector or a tuple of the pairs t => P_t. The constructor raises a DomainError for a pair t => P_t whose t is not an observation of Z, and a DimensionMismatch for a P_t that is not square on the factor axis of Z. Build the type in a method of yours: the readers of the library read the two fields by name, so they do not refuse the named tuple, but they get no check of it. A caller that reads the fields by name does not change.

  • A rule of your own for an unknown entry returns a LeverageSplitResult and an AttributionErrorsResult. attribution_leverage_split returns a LeverageSplitResult or nothing, and attribution_leverage_errors returns an AttributionErrorsResult. Both types are public. v0.33 returned the named tuples (; assets, factors) and (; sys, factor, family). A method for a subtype of AbstractUnknownEntryRule builds them with LeverageSplitResult(assets, factors) and AttributionErrorsResult(sys, factor, family), or with the same keywords. The defaults of AttributionErrorsResult are nothing, the answer of an attribution with no standard errors. The constructor of LeverageSplitResult raises an ArgumentError for marks that name no asset, because a rule that marks nothing answers nothing. The constructor of AttributionErrorsResult raises an ArgumentError when sys and factor are not both stated or both nothing, and when family is stated without factor. A method that returns a named tuple raises a MethodError in attribution_leverage_nan or in the realised attribution. The argument ses and the answers of pass are an AttributionErrorsResult too. A caller that reads the fields by name, as s.assets or (; sys, factor) = ses, does not change. keys of an answer raises a MethodError, and a destructure by position, as assets, factors = s, raises a BoundsError. Two answers are not ==, because the types compare their vectors by identity, so compare their fields.

  • An orthogonal forecast fit of your own returns a ForecastSplitResult. orthogonal_forecast_rescale returns a ForecastSplitResult, which is public, where v0.33 returned the named tuple (; g, ap). A method for a subtype of AbstractOrthogonalForecastFit builds it with ForecastSplitResult(g, ap) or with the same two keywords. The constructor raises an ArgumentError when one part is nothing and the other is not. A method that returns the named tuple raises a MethodError in the prior. A caller that reads the fields by name does not change.

  • The buffer of centring_lag_records holds a CentringLagRecord. Each record of the HAC term of an EstimatedCentring is a CentringLagRecord, which is private, with the fields obs_count, valid and P. v0.33 held the named tuple (; obs_count, valid, P), with the same values. A method of centring_lag_factor of your own that reads a record by field name does not change. A method of centring_lag_records of your own that makes a buffer of the named tuple raises a MethodError when the fold pushes a record into it. Make the buffer with the element type typeof(PortfolioOptimisers.CentringLagRecord(Int[], falses(0), P)). A caller that calls keys or merge on a record raises a MethodError.

  • An online portfolio selection rule of your own takes the last slot of online_update! and of rule_state_seed. Write online_update!(alg::MyRule, st, w, x, rows, set, ::Option{<:AbstractVector} = nothing) where v0.33 wrote the six-argument form, and rule_state_seed(alg::MyRule, w, ::Option{<:AbstractAllocationSet} = nothing) where v0.33 wrote the two-argument form. The last slots are the point at which an ExpertMixture asks its experts for a gradient, and the set of allowed weights that the head gives the seed. v0.33 had a generic method of each long form that dropped the slot, and v0.34 has none. A rule with only the six-argument form raises a MethodError as an expert of an ExpertMixture. A rule with only the two-argument form gets the default state nothing from the head. A first-order rule that gets nothing as the point of its gradient takes its own iterate.

  • A geometry of your own reaches the projection programme on a ProgrammeAllocationSet. project(proj::AbstractProjectionGeometry, set::ProgrammeAllocationSet, q, w) solves the programme for every geometry, with the objective that set_projection_objective! writes for it. v0.33 had a method for each geometry of the library alone, so a geometry of your own raised a MethodError in project. It now raises the MethodError in set_projection_objective!, a private function, unless it has a method project(proj::MyGeometry, set::ProgrammeAllocationSet, q, w), which is more specific than the method of the library.

  • A dynamic observation weight of your own returns one concrete weight type. A moment risk measure now rebuilds itself with the weights that your get_observation_weights method returns. When the method infers a Union, as eweights(1:n, lambda) does, each call of the measure allocates 80 more bytes than before. Return one concrete type, as eweights(n, lambda) does, and the call allocates no more than before. The value does not change. The docstring of DynamicAbstractWeights shows the form.

  • A JuMP optimisation Result of your own declares its own property forwarding. v0.33 defined getproperty and propertynames on RJR_NRJR, so a subtype of RiskJuMPOptimisationResult or NonRiskJuMPOptimisationResult read res.w and the fields of jor through its field jr with no declaration. These methods are gone, because they gave no setproperties method, and Accessors.set refused every patch of a MeanRiskResult or a NearOptimalCenteringResult. Write @forward_properties MyResult begin forward(jr) end after the struct, as each Result of the library does. A subtype without the block raises an error at its first read of res.w, because w is not one of its fields. The block gives MeanRiskResult and NearOptimalCenteringResult the names that the methods on RJR_NRJR gave, in the same order, and a patch of a field now gives a new Result. The names of jor are those of its v0.34 type, so a name of v0.33 that left jor is not a name of the Result either.

  • The carried states of the exponentially weighted beta Descriptors. EWBetaState holds the EWMoments of each asset, the moments of the squared weights for the shrinkage, the open EWReturnWindow, the held betas and the count of the observations, and it is the state of an EWBeta too, where v0.33 used EWBlockState. EWMacroSensitivityState holds an EWBetaState, the constant-market flag of each asset and the two counts of the reference windows. EWDownsideBetaState holds the second moment of the market shortfall per asset in vd, a vector, and has no field t. A state of v0.33 does not fold into v0.34: fit the Descriptor again.

  • CalibrationContext has a field n after cs, the count that the site prices, so its positional constructor takes five arguments, where v0.33 took four. The keyword constructor keeps every v0.33 keyword, and the default n = nothing reads the effective sample size of the prior, as v0.33 did. A radius rule of your own reads ctx.n where it is not nothing, as the radius rules of the library do.

  • A systematic repair of your own takes the count T. The prior calls systematic_processing!(srep, mp, sigma, X, T; kwargs...), with T the effective count of the observations, where v0.33 called the form of four arguments. Write systematic_processing!(::MyRepair, mp, sigma, X, T::Real = size(X, 1); kwargs...) for a subtype of AbstractSystematicRepair. A method with the v0.33 arguments alone raises a MethodError in the prior.

  • A variance estimator of your own takes the active mask in variance_count. A CrossSectionalFactorPrior calls variance_count(ve, X, amsk), a private function, with the active mask that its variance read, where v0.33 called variance_count(ve, X). A method of your own with the two v0.33 arguments alone is not called there. The fallback then states no count, so the block records no degrees of freedom, and ResidualInflation raises an IsNothingError that asks for dof. Write PortfolioOptimisers.variance_count(ve::MyVariance, X::PortfolioOptimisers.MatNum, amsk::Union{Nothing, AbstractMatrix{<:Bool}} = nothing). A looser bound on X or on amsk is ambiguous with the fallback, and the call raises a MethodError. When your variance restarts an asset where the mask turns false, count the rows after the last inactive row of the asset, as the exponentially weighted estimators of the library do.

  • A regression target of your own subtypes one of two families. A target that subtypes AbstractRegressionTarget directly subtypes AbstractUnpenalisedRegressionTarget or AbstractPenalisedRegressionTarget now, both public. An unpenalised target takes every criterion of StepwiseRegression. A penalised target takes :aic, :aicc and :bic, as ElasticNet does. A target in neither family raises a MethodError in StepwiseRegression under the default PValue(), :r2 and :adjr2.

  • RiskBudgeting has a field kmin before fb, so its positional constructor takes six arguments, RiskBudgeting(opt, r, rba, wi, kmin, fb), where v0.33 took five. The keyword constructor keeps every v0.33 keyword.