Skip to content
18

Capability catalogue

Everything PortfolioOptimisers.jl can do, grouped by the job it does rather than by the file it lives in. Each entry links to its docstring.

This page is generated (see docs/generate_capability_catalogue.jl): the grouping is curated in docs/capability_catalogue.jl, and every description is the first sentence of the corresponding docstring, so the two can never disagree. A test asserts that every estimator and algorithm in the package appears here, so the page cannot fall behind the code.

For the same types arranged by subtyping rather than by capability, see the type hierarchy.

Core abstractions

Every component is an Estimator (a configuration encoding a method and its hyperparameters), an Algorithm (a behaviour selector consumed through an Estimator), or a Result (computed output). Estimators and Algorithms are what you choose; Results are what you get back.

Because every struct is immutable, runtime values are propagated down a composed estimator tree by rebuilding it.

  • No-op factory function for constructing objects with a uniform interface. factory

Preprocessing

Matrix processing

Regression models

Factor prior models and implied volatility use regression in their estimation, which return a Regression object.

Regression targets

Regression types

  • Estimator for stepwise regression-based moment estimation. StepwiseRegression
    • Algorithms
    • Selection criteria
      • Stepwise regression criterion based on p-value thresholding. PValue

      • Akaike Information Criterion (AIC) for stepwise regression. AIC

      • Corrected Akaike Information Criterion (AICC) for stepwise regression. AICC

      • Bayesian Information Criterion (BIC) for stepwise regression. BIC

      • Coefficient of determination (R²) for stepwise regression. RSquared

      • Adjusted coefficient of determination (Adjusted R²) for stepwise regression. AdjustedRSquared

  • Estimator for dimension reduction regression-based moment estimation. DimensionReductionRegression
    • Principal Component Analysis (PCA) dimension reduction target. PCA

    • Probabilistic Principal Component Analysis (PPCA) dimension reduction target. PPCA

Moment estimation

Expected returns

Overloads Statistics.mean.

Variance and standard deviation

Overloads Statistics.var and Statistics.std.

  • A flexible variance estimator for PortfolioOptimisers.jl supporting optional expected returns estimators, observation weights, and bias correction. SimpleVariance

  • Variance estimator that restricts computation to a rolling or indexed observation window. WindowedVariance

Covariance and correlation

Overloads Statistics.cov and Statistics.cor.

  • A simple wrapper around a StatsBase.CovarianceEstimator, optional StatsBase.AbstractWeights, and an optional index. GeneralCovariance

  • Estimates the covariance matrix of asset returns from a centring estimator, a covariance estimator, and a moment algorithm. Covariance
    • FullMoment is used to indicate that all deviations are included in the moment estimation process. FullMoment

    • SemiMoment is used for semi-moment estimators, where only observations below a target are considered. SemiMoment

  • Configures and applies Gerber covariance estimators. GerberCovariance
    • Implements the original Gerber covariance algorithm. Gerber0

    • Implements the first variant of the Gerber covariance algorithm. Gerber1

    • Implements the second variant of the Gerber covariance algorithm. Gerber2

  • Configures and applies Smyth-Broby covariance estimators. SmythBrobyCovariance
    • Implements the original Smyth-Broby covariance algorithm. SmythBroby0

    • Implements the first variant of the Smyth-Broby covariance algorithm. SmythBroby1

    • Implements the second variant of the Smyth-Broby covariance algorithm. SmythBroby2

    • Implements the original Smyth-Broby covariance algorithm scaled by vote counts. SmythBrobyGerber0

    • Implements the first variant of the Smyth-Broby covariance algorithm scaled by vote counts. SmythBrobyGerber1

    • Implements the second variant of the Smyth-Broby covariance algorithm scaled by vote counts. SmythBrobyGerber2

    • Implements the original Smyth-Broby covariance algorithm using vote counts only. SmythBrobyCount0

    • Implements the first variant of the Smyth-Broby covariance algorithm using vote counts only. SmythBrobyCount1

    • Implements the second variant of the Smyth-Broby covariance algorithm using vote counts only. SmythBrobyCount2

  • Gerber Information Quality GerberIQCovariance with custom variance, demeaning, temporal decay and numerator + denominator estimators
  • Configures and applies distance-based covariance estimators. DistanceCovariance

  • Lower tail dependence covariance estimator. LowerTailDependenceCovariance

  • Rank covariances
  • Covariance estimator based on mutual information. MutualInfoCovariance
    • Abstract supertype for all histogram binning algorithms based on a bin width selection rule. BinWidthBins
    • Histogram binning algorithm using the Hacine-Gharbi–Ravier rule. HacineGharbiRavier

    • Predefined number of bins

  • Convenience constructor. DenoiseCovariance

  • Convenience constructor. DetoneCovariance

  • Convenience constructor. ProcessedCovariance

  • Covariance estimator based on implied volatility scaling. ImpliedVolatility
  • Composite covariance estimator with post-processing. PortfolioOptimisersCovariance

  • A covariance estimator that returns the correlation matrix as both the covariance and correlation. CorrelationCovariance

  • Covariance estimator that restricts computation to a rolling or indexed observation window. WindowedCovariance

  • Regime-adjusted covariance and variance
    • Online exponentially weighted covariance estimator with regime-state adjustment. RegimeAdjustedExpWeightedCovariance

    • Online exponentially weighted variance estimator with regime-state adjustment. RegimeAdjustedExpWeightedVariance

    • Regime adjustment methods
      • Regime adjustment method that scales variance by the ratio of the mean absolute deviation of standardised returns to the first-moment normalisation constant x. FirstMomentRegimeAdjusted

      • Regime adjustment method that scales variance exponentially with the smoothed log-deviation of standardised squared returns from its expected value under stationarity. LogRegimeAdjusted

      • Regime adjustment method that scales variance by the square root of the mean of the standardised squared returns. RootMeanSquaredAdjusted

    • Shrinkage targets
      • Regime-adjustment target that uses a diagonal baseline covariance structure. DiagonalTarget

      • Regime-adjustment target that uses a Mahalanobis-distance-based baseline covariance structure. MahalanobisTarget

      • Regime-adjustment target that uses a portfolio-weighted baseline covariance structure. PortfolioTarget

    • Demeaning
      • Centres the returns series using the (weighted) mean before computing the Median Absolute Deviation. MeanCentering

      • Centres the returns series using the (weighted) median before computing the Median Absolute Deviation. MedianCentering

    • Correlation smoothing
      • Greedy pairwise correlation pruning: drop assets until no surviving pair exceeds t. PairwiseCorrelation

      • Group assets by connected component of the over-threshold correlation graph, and keep the best-scoring member of each. CorrelationComponents

Coskewness

Implements coskewness.

  • Container type for coskewness estimators. Coskewness
    • FullMoment is used to indicate that all deviations are included in the moment estimation process. FullMoment

    • SemiMoment is used for semi-moment estimators, where only observations below a target are considered. SemiMoment

  • Coskewness estimator that restricts computation to a rolling or indexed observation window. WindowedCoskewness

Cokurtosis

Implements cokurtosis.

  • Container type for cokurtosis estimators. Cokurtosis
    • FullMoment is used to indicate that all deviations are included in the moment estimation process. FullMoment

    • SemiMoment is used for semi-moment estimators, where only observations below a target are considered. SemiMoment

  • Cokurtosis estimator that restricts computation to a rolling or indexed observation window. WindowedCokurtosis

Windowed moments

Every windowed estimator wraps a base moment estimator and recomputes it over a trailing window, so a moment can vary across the folds of a cross-validation scheme. The window is set by a fixed length or by a WindowSizeEstimator.

Distance matrices

Implements distance and cor_and_dist.

  • If power is not nothing, computes the generalised distance estimator. Distance

  • Distance-of-distances estimator for portfolio optimization. DistanceDistance

The distance estimators are used together with various distance matrix algorithms.

Phylogeny

PortfolioOptimisers.jl can make use of asset relationships to perform optimisations, define constraints, and compute relatedness characteristics of portfolios.

Clustering

Phylogeny constraints and clustering optimisations make use of clustering algorithms via ClustersEstimator, Clusters, and clusterise. Most clustering algorithms come from Clustering.jl.

Hierarchical

  • Algorithm type for hierarchical clustering. HClustAlgorithm

  • Direct Bubble Hierarchical Trees DBHT and Local Global sparsification of the covariance matrix LoGo, logo!, and logo
    • Root selection
      • A DBHT root selection method that enforces a unique root in the hierarchy. UniqueRoot

      • A DBHT root selection method that creates a root from the adjacency tree of all root candidates. EqualRoot

Non-hierarchical

Non-hierarchical clustering algorithms are incompatible with hierarchical clustering optimisations, but they can be used for phylogeny constraints and NestedClustered optimisations.

  • K-means clustering algorithm configuration for non-hierarchical clustering. KMeansAlgorithm

Networks

Adjacency matrices

Adjacency matrices encode asset relationships either with clustering or graph theory via phylogeny_matrix and PhylogenyResult.

Centrality and phylogeny measures

Cluster trees

Hierarchical clustering produces a tree of ClusterNodes, walked by to_tree, pre_order, and is_leaf.

Optimisation constraints

Non clustering optimisers support a wide range of constraints, while naive and clustering optimisers only support weight bounds. Furthermore, entropy pooling prior supports a variety of views constraints. It is therefore important to provide users with the ability to generate constraints manually and/or programmatically. We therefore provide a wide, robust, and extensible range of types such as AbstractEstimatorValueAlgorithm and UniformValues, and functions that make this easy, fast, and safe.

Constraints can be defined via their estimators or directly by their result types. Some using estimators need to map key-value pairs to the asset universe, this is done by defining the assets and asset groups in AssetSets. Internally, PortfolioOptimisers.jl uses all the information and calls group_to_val!, and replace_group_by_assets to produce the appropriate arrays.

Prior statistics

Many optimisations and constraints use prior statistics computed via prior.

Uncertainty sets

In order to make optimisations more robust to noise and measurement error, it is possible to define uncertainty sets on the expected returns and covariance. These can be used in optimisations which use either of these two quantities. These are implemented via ucs, mu_ucs, and sigma_ucs.

PortfolioOptimisers.jl implements two types of uncertainty sets.

It also implements various estimators for the uncertainty sets, the following two can generate box and ellipsoidal sets.

The following estimator can only generate box sets.

  • Estimator for box uncertainty sets using delta bounds on mean and covariance statistics in portfolio optimisation. DeltaUncertaintySet

Quintile portfolios are expressed as an uncertainty set on the characteristic vector rather than as an optimiser of their own (ADR 0032).

Turnover

The turnover is defined as the element-wise absolute difference between the vector of current weights and a vector of benchmark weights. It can be used as a constraint, method for fee calculation, and risk measure. These are all implemented using turnover_constraints, TurnoverEstimator, and Turnover.

Fees

Fees are a non-negligible aspect of active investing. As such PortfolioOptimiser.jl has the ability to account for them in all optimisations but the naive ones. They can also be used to adjust expected returns calculations via calc_fees and calc_asset_fees.

  • Generate portfolio transaction fee constraints from a FeesEstimator and asset set. fees_constraints

  • Compute the fixed portfolio fees for assets that have been allocated. calc_fixed_fees and calc_asset_fixed_fees

  • Estimator for portfolio transaction fees constraints. FeesEstimator and Fees
    • Proportional long

    • Proportional short

    • Fixed long

    • Fixed short

    • Turnover

Portfolio returns and drawdowns

Various risk measures and analyses require the computation of simple and cumulative portfolio returns and drawdowns both in aggregate and per-asset. These are computed by calc_net_returns, calc_net_asset_returns, cumulative_returns, drawdowns.

Tracking

It is often useful to create portfolios that track the performance of an index, indicator, or another portfolio.

The error can be computed using different algorithms using norm_error.

  • Norm tracking algorithms
    • Norm-one (NOC) error formulation. L1Norm

    • Second-order cone (SOC) norm-based error formulation. L2Norm

    • Second-order cone (SOC) squared norm-based error formulation. SquaredL2Norm

    • L-p norm error estimator. LpNorm

    • L-infinity norm (maximum absolute deviation) error estimator. LInfNorm

It is also possible to track the error in with risk measures RiskTrackingError using WeightsTracking, which allows for two approaches.

Risk measures

PortfolioOptimisers.jl provides a wide range of risk measures. These are broadly categorised into two types based on the type of optimisations that support them.

Risk measures for traditional optimisation

These are all subtypes of RiskMeasure, and are supported by all optimisation estimators.

  • Represents the portfolio variance using a covariance matrix. Variance
    • Traditional optimisations also support:
      • Risk contribution

      • Formulations
        • Direct quadratic risk expression optimisation formulation for variance-like risk measures. QuadRiskExpr

        • Squared second-order cone risk expression optimisation formulation for applicable risk measures. SquaredSOCRiskExpr

  • Represents the portfolio standard deviation using a covariance matrix. StandardDeviation

  • Uncertainty set variance UncertaintySetVariance (same as variance when used in non-traditional optimisation)

  • Represents a low-order moment risk measure. LowOrderMoment
    • Represents the first lower moment risk measure algorithm. FirstLowerMoment

    • Represents the mean absolute deviation risk measure algorithm. MeanAbsoluteDeviation

    • Represents a second moment (variance or standard deviation) risk measure algorithm. SecondMoment
      • Second squared moments
        • FullMoment is used to indicate that all deviations are included in the moment estimation process. FullMoment

        • SemiMoment is used for semi-moment estimators, where only observations below a target are considered. SemiMoment

        • Traditional optimisation formulations
          • Direct quadratic risk expression optimisation formulation for variance-like risk measures. QuadRiskExpr

          • Squared second-order cone risk expression optimisation formulation for applicable risk measures. SquaredSOCRiskExpr

          • Rotated second-order cone risk expression optimisation formulation for applicable risk measures. RSOCRiskExpr

      • Second-order cone risk expression optimisation formulation for applicable risk measures. SOCRiskExpr
        • FullMoment is used to indicate that all deviations are included in the moment estimation process. FullMoment

        • SemiMoment is used for semi-moment estimators, where only observations below a target are considered. SemiMoment

  • Represents the square root kurtosis risk measure. Kurtosis
    • Actual kurtosis

      • FullMoment and semi-kurtosis are supported in traditional optimisers via the kt field. Risk calculation uses
        • FullMoment is used to indicate that all deviations are included in the moment estimation process. FullMoment

        • SemiMoment is used for semi-moment estimators, where only observations below a target are considered. SemiMoment

      • Traditional optimisation formulations
        • Direct quadratic risk expression optimisation formulation for variance-like risk measures. QuadRiskExpr

        • Squared second-order cone risk expression optimisation formulation for applicable risk measures. SquaredSOCRiskExpr

        • Rotated second-order cone risk expression optimisation formulation for applicable risk measures. RSOCRiskExpr

    • Second-order cone risk expression optimisation formulation for applicable risk measures. SOCRiskExpr
      • FullMoment is used to indicate that all deviations are included in the moment estimation process. FullMoment

      • SemiMoment is used for semi-moment estimators, where only observations below a target are considered. SemiMoment

  • Represents the Negative Skewness risk measure. NegativeSkewness
    • Squared negative skewness
      • FullMoment and semi-skewness are supported in traditional optimisers via the sk and V fields. Risk calculation uses
        • FullMoment is used to indicate that all deviations are included in the moment estimation process. FullMoment

        • SemiMoment is used for semi-moment estimators, where only observations below a target are considered. SemiMoment

      • Traditional optimisation formulations
        • Direct quadratic risk expression optimisation formulation for variance-like risk measures. QuadRiskExpr

        • Squared second-order cone risk expression optimisation formulation for applicable risk measures. SquaredSOCRiskExpr

      • Second-order cone risk expression optimisation formulation for applicable risk measures. SOCRiskExpr

  • Represents the Value-at-Risk (VaR) risk measure. ValueatRisk
    • Traditional optimisation formulations
  • Represents the Value-at-Risk Range risk measure. ValueatRiskRange
    • Traditional optimisation formulations
  • Represents the Drawdown-at-Risk (DaR) risk measure. DrawdownatRisk

  • Represents the Conditional Value-at-Risk (CVaR) risk measure, also known as Expected Shortfall (ES). ConditionalValueatRisk

  • Distributionally Robust Conditional Value at Risk DistributionallyRobustConditionalValueatRisk (same as conditional value at risk when used in non-traditional optimisation)

  • Represents the Conditional Value-at-Risk Range (CVaR Range) risk measure. ConditionalValueatRiskRange

  • Distributionally Robust Conditional Value at Risk Range DistributionallyRobustConditionalValueatRiskRange (same as conditional value at risk range when used in non-traditional optimisation)

  • Represents the Conditional Drawdown-at-Risk (CDaR) risk measure, also known as Expected Maximum Drawdown. ConditionalDrawdownatRisk

  • Distributionally Robust Conditional Drawdown at Risk DistributionallyRobustConditionalDrawdownatRisk(same as conditional drawdown at risk when used in non-traditional optimisation)

  • Represents the Entropic Value-at-Risk (EVaR) risk measure. EntropicValueatRisk

  • Represents the Entropic Value-at-Risk Range (EVaR Range) risk measure. EntropicValueatRiskRange

  • Represents the Entropic Drawdown-at-Risk (EDaR) risk measure. EntropicDrawdownatRisk

  • Represents the Relativistic Value-at-Risk (RVaR) risk measure. RelativisticValueatRisk

  • Represents the Relativistic Value-at-Risk Range (RVaR Range) risk measure. RelativisticValueatRiskRange

  • Represents the Relativistic Drawdown-at-Risk (RLDaR) risk measure. RelativisticDrawdownatRisk

  • Ordered Weights Array
  • Represents the Average Drawdown risk measure. AverageDrawdown

  • Represents the Ulcer Index risk measure. UlcerIndex

  • Represents the Maximum Drawdown risk measure. MaximumDrawdown

  • Represents the Brownian Distance Variance (BDVar) risk measure. BrownianDistanceVariance
    • Traditional optimisation formulations
      • Distance matrix constraint formulations
      • Risk formulation
        • Direct quadratic risk expression optimisation formulation for variance-like risk measures. QuadRiskExpr

        • Rotated second-order cone risk expression optimisation formulation for applicable risk measures. RSOCRiskExpr

  • Represents the Worst Realisation risk measure. WorstRealisation

  • Represents the Range risk measure. Range

  • Represents the Turnover risk measure. TurnoverRiskMeasure

  • Represents the Tracking Error risk measure. TrackingRiskMeasure
    • Norm-one (NOC) error formulation. L1Norm

    • Second-order cone (SOC) norm-based error formulation. L2Norm

    • Second-order cone (SOC) squared norm-based error formulation. SquaredL2Norm

    • L-p norm error estimator. LpNorm

    • L-infinity norm (maximum absolute deviation) error estimator. LInfNorm

  • Risk Tracking Risk Measure
  • Represents the Power Norm Value-at-Risk (PNVaR) risk measure. PowerNormValueatRisk

  • Represents the Power Norm Value-at-Risk Range (PNVaRRange) risk measure. PowerNormValueatRiskRange

  • Represents the Power Norm Drawdown-at-Risk (PNDDaR) risk measure. PowerNormDrawdownatRisk

  • Represents a generic Value-at-Risk range risk measure that combines any pair of XatRisk-type measures applied to the loss and gain sides of the return distribution. GenericValueatRiskRange

  • Represents the Risk Tracking risk measure. RiskTrackingRiskMeasure

  • Risk measure that contributes no risk. NoRisk

  • Risk measure settings

    Every risk measure carries a settings object saying how it enters the problem: as the objective, as a constraint with an upper bound, and with what scale.

Risk measures for hierarchical optimisation

These are all subtypes of HierarchicalRiskMeasure, and are only supported by hierarchical optimisation estimators.

  • Represents a high-order moment risk measure. HighOrderMoment
    • Represents the unstandardised semi-skewness risk measure algorithm. ThirdLowerMoment

    • Represents a standardised high-order moment risk measure algorithm. StandardisedHighOrderMoment and ThirdLowerMoment

    • Represents the unstandardised fourth moment (kurtosis or semi-kurtosis) risk measure algorithm. FourthMoment
      • FullMoment is used to indicate that all deviations are included in the moment estimation process. FullMoment

      • SemiMoment is used for semi-moment estimators, where only observations below a target are considered. SemiMoment

    • Represents a standardised high-order moment risk measure algorithm. StandardisedHighOrderMoment and FourthMoment
      • FullMoment is used to indicate that all deviations are included in the moment estimation process. FullMoment

      • SemiMoment is used for semi-moment estimators, where only observations below a target are considered. SemiMoment

  • Represents the Relative Drawdown-at-Risk risk measure for hierarchical optimisation. RelativeDrawdownatRisk

  • Represents the Relative Conditional Drawdown-at-Risk risk measure for hierarchical optimisation. RelativeConditionalDrawdownatRisk

  • Represents the Relative Entropic Drawdown-at-Risk (Relative EDaR) risk measure for hierarchical optimisation. RelativeEntropicDrawdownatRisk

  • Represents the Relative Relativistic Drawdown-at-Risk (Relative RLDaR) risk measure for hierarchical optimisation. RelativeRelativisticDrawdownatRisk

  • Represents the Relative Average Drawdown risk measure for hierarchical optimisation. RelativeAverageDrawdown

  • Represents the Relative Ulcer Index risk measure for hierarchical optimisation. RelativeUlcerIndex

  • Represents the Relative Maximum Drawdown risk measure for hierarchical optimisation. RelativeMaximumDrawdown

  • Represents the Relative Power Norm Drawdown-at-Risk (Relative PNDDaR) risk measure for hierarchical optimisation. RelativePowerNormDrawdownatRisk

  • Represents a risk ratio risk measure for hierarchical portfolio optimisation. RiskRatio

  • Represents the Equal Risk Measure for hierarchical portfolio optimisation. EqualRisk

  • Represents the Median Absolute Deviation (MAD) risk measure for hierarchical portfolio optimisation. MedianAbsoluteDeviation

  • Composite risk measure combining variance, skewness, and kurtosis into a single expression. VarianceSkewKurtosis

  • Represents an even-order moment risk measure algorithm. EvenMoment

  • Callable estimator that generates OWA linear moment convex risk measure (CRM) weights for a given number of observations. LinearMoment

Non-optimisation risk measures

These risk measures are unsuitable for optimisation because they can return negative values. However, they can be used for performance metrics.

Performance metrics

Portfolio optimisation

Optimisations are implemented via optimise. Optimisations consume an estimator and return a result.

Naive

These return a NaiveOptimisationResult.

Naive optimisation features

Traditional

These optimisations are implemented as JuMP problems and make use of JuMPOptimiser, which encodes all supported constraints.

Objective function optimisations

These optimisations support a variety of objective functions.

Risk budgeting optimisations

These optimisations attempt to achieve weight values according to a risk budget vector. This vector can be provided on a per asset or per factor basis.

Traditional optimisation features

Clustering optimisation

Clustering optimisations make use of asset relationships to either minimise the risk exposure by breaking the asset universe into subsets which are hierarchically or individually optimised.

Hierarchical clustering optimisation

These optimisations minimise risk by hierarchically splitting the asset universe into subsets, computing the risk of each subset, and combining them according to their hierarchy.

Hierarchical clustering optimisation features

Schur complementary optimisation

Schur complementary hierarchical risk parity provides a bridge between mean variance optimisation and hierarchical risk parity by using an interpolation parameter. It converges to hierarchical risk parity, and approximates mean variance by adjusting this parameter. It uses the Schur complement to adjust the weights of a portfolio according to how much more useful information is gained by assigning more weight to a group of assets.

Schur complementary optimisation features

Nested clusters optimisation

Nested clustered optimisation breaks the asset universe of size N into C smaller subsets and treats every subset as an individual portfolio. The weights assigned to each asset are placed in an N × C matrix. In each column, non-zero values correspond to assets assigned to that subset, this means that assets only contribute to the column (and therefore synthetic asset) corresponding to their assigned subset. In other words, each row of the matrix contains a single non-zero value and each row contains as many non-zero values as there are assets in that subset.

From here there are two options: 2. Compute the returns matrix of the synthetic assets directly by multiplying the original T × N matrix by the N × C matrix of asset weights to produce a T × C matrix of predicted returns, where T is the number of observations.

  1. For each subset perform a cross validation prediction, yielding a vector of returns for that subset. These vectors are then horizontally concatenated into a Y × C matrix of cross-validation predicted returns, where Y ≤ T because the cross validation may not use the full history.

This matrix of predicted returns is then used by the outer optimisation estimator to generate an optimisation of the synthetic assets. This produces a C × 1 vector, essentially optimising a portfolio of asset clusters. The final weights are the product of the original N × C matrix of asset weights per cluster by the C × 1 vector of optimal synthetic asset weights to produce the final N × 1 vector of asset weights.

Nested clusters optimisation features

Ensemble optimisation

This works similarly to the Nested Clustered estimator, only instead of breaking the asset universe into subsets, a list of inner estimators is provided. The procedure is then exactly the same as the nested clusters optimisation, only instead of an N × C matrix of asset weights where each column corresponds to a subset of assets, each column corresponds to a completely independent and isolated inner estimator, which also means there is no enforced sparsity pattern on this matrix.

Ensemble optimisation features

Subset resampling optimisation

This optimiser takes ideas from MultipleRandomised cross validation to randomly sample the asset universe and optimise each sample individually using a given optimiser. The final asset weights are the average weight per asset across all samples, if an asset does not appear in a sample, it is taken to be zero.

Subset resampling optimisation features

Finite allocation optimisation

Unlike all other estimators, finite allocation does not yield an "optimal" value, but rather the optimal attainable solution based on a finite amount of capital. They use the result of other estimations, the latest prices, and a cash amount.

Cross validation

Pipeline

A Pipeline reifies an end-to-end workflow as data: an ordered list of steps run left-to-right over a PipelineContext, so preprocessing, priors, and the optimiser travel together as one estimator and can be cross-validated or tuned as a unit.

Plotting

Visualising the results is quite a useful way of summarising the portfolio characteristics or evolution. To this extent we provide a few plotting functions with more to come.

  • Simple or compound cumulative returns.
  • Portfolio composition.
  • Risk contribution.
  • Plot a hierarchical clustering dendrogram with coloured cluster regions. plot_dendrogram

  • Plot a reordered correlation/covariance heatmap with flanking dendrograms and coloured cluster boxes. plot_clusters

  • Plot portfolio drawdown over time. plot_drawdowns

  • Line plot of the rolling maximum drawdown over a sliding window. plot_rolling_drawdowns

  • Plot a histogram of portfolio returns with vertical risk-measure lines and an optional fitted Normal distribution. plot_histogram

  • Scatter plot of risk/return measures across a collection of portfolio weight vectors. plot_measures

  • Line plot of a risk or return measure evaluated over a rolling window of portfolio returns. plot_rolling_measure

  • Sort a collection of portfolio results by risk (x), connect them with a line to trace the efficient frontier, and optionally annotate the minimum-risk and maximum-score portfolios. plot_efficient_frontier

  • Box plot of per-asset weight distributions across cross-validation folds or population members. plot_weight_stability

  • Line plot of portfolio turnover (L1 weight change) over time. plot_turnover

  • Overlay portfolio cumulative returns against one or more benchmark return series from rd.B. plot_benchmark

  • Moments and priors
  • Factor models
    • Bar chart of per-factor expected returns (the f_mu vector from a factor model prior). plot_factor_mu

    • Correlation/covariance heatmap of the factor covariance matrix (pr.f_sigma). plot_factor_sigma

    • Heatmap of the factor loadings matrix B (assets × factors) from a prior with a regression model. plot_factor_loadings

  • Phylogeny
    • Plot the asset network (MST, PMFG, TMFG, or adjacency) as a graph using GraphRecipes.graphplot. plot_network

    • Bar chart of asset centrality scores, sorted in descending order. plot_centrality

  • Cross validation
    • Bar chart of cross-validation scores (one bar per fold or population member). plot_cv_scores

    • Four-panel composite plot for a walk-forward cross-validation result: plot_cv_dashboard

  • Dashboards
    • Four-panel composite plot for a single optimisation result: plot_portfolio_dashboard

    • Bar chart of annualised portfolio performance metrics: annualised return, annualised volatility, Sharpe ratio, Sortino ratio, Calmar ratio, maximum drawdown %, and CVaR %. plot_performance_summary