Factor Model Summary

Types

PortfolioOptimisers.FactorSummaryResult — Type
struct FactorSummaryResult{__T_ann_return, __T_ann_volatility, __T_sharpe, __T_autocorr, __T_mean_abs_t, __T_t_rate, __T_mean_vif, __T_stability, __T_coverage, __T_ppy, __T_nf, __T_fam} <: AbstractResult

The headline statistics of every factor of a cross-sectional factor model.

factor_model_summary returns a FactorSummaryResult. It holds the nine columns that plot_factor_model_summary draws, one entry per raw factor, the annualisation factor of the first three, and the names and the family labels of the raw factors. A caller can tabulate a summary, compare it across fits, test it, or read it with no plotting package installed. port_opt_view selects the factors of a summary by position, by name, or by family with a LabelGroup.

The five columns that can be absent

mean_abs_t, t_rate and mean_vif read the regression design, and stability and coverage read the exposure history. A block with no exposure history has none of them, and all five are nothing. A consumer handles that case by dispatch on nothing.

The raw factor axis

The summary computes the three Gram columns on the reduced factor axis of the family re-basis, and writes them back onto the raw axis by name. A raw factor that the re-basis dropped has NaN in those three columns and a value in the others.

Fields

  • ann_return: Annualised mean of the factor return series, one entry per raw factor.
  • ann_volatility: Annualised volatility of the factor return series, one entry per raw factor.
  • sharpe: Ratio of the annualised mean to the annualised volatility, one entry per raw factor.
  • autocorr: Lag-one autocorrelation of the factor return series, one entry per raw factor.
  • mean_abs_t: Mean absolute cross-sectional t-statistic, one entry per raw factor, or nothing when the block has no exposure history.
  • t_rate: Fraction of the observations at which the absolute t-statistic passes the threshold, one entry per raw factor, or nothing when the block has no exposure history.
  • mean_vif: Mean variance inflation factor, one entry per raw factor, or nothing when the block has no exposure history.
  • stability: Median exposure stability coefficient, one entry per raw factor, or nothing when the block has no exposure history.
  • coverage: Average fraction of the universe at which the factor exposure is finite, one entry per raw factor, or nothing when the block has no exposure history.
  • ppy: Periods per year, the annualisation factor. 252 for daily, 52 for weekly, 12 for monthly returns, and 1 states each figure per period. It defaults to 1, which reports the statistics per period.
  • nf: Name of each factor on the factor axis of the answer, or nothing when the block names no factor. The axis is the one that the verb answers on, raw or reduced.
  • fam: Family label of each factor on the factor axis of the answer, or nothing when the block labels no family. A view selects the factors of one family with a LabelGroup.

Constructors

FactorSummaryResult(ann_return::VecNum, ann_volatility::VecNum, sharpe::VecNum,                    autocorr::VecNum, mean_abs_t::Option{<:VecNum},                    t_rate::Option{<:VecNum}, mean_vif::Option{<:VecNum},                    stability::Option{<:VecNum}, coverage::Option{<:VecNum},                    ppy::Number, nf::Option{<:VecStr}, fam::Option{<:VecStr})FactorSummaryResult(; ann_return::VecNum, ann_volatility::VecNum, sharpe::VecNum,                    autocorr::VecNum, mean_abs_t::Option{<:VecNum} = nothing,                    t_rate::Option{<:VecNum} = nothing,                    mean_vif::Option{<:VecNum} = nothing,                    stability::Option{<:VecNum} = nothing,                    coverage::Option{<:VecNum} = nothing, ppy::Number = 1,                    nf::Option{<:VecStr} = nothing, fam::Option{<:VecStr} = nothing)

The type is a Result, so factor_model_summary builds it and a caller reads it. The positional constructor checks the values. The keyword constructor takes each field by name and calls it. Its defaults are nothing for the five columns that can be absent and for the two labels, and 1 for ppy.

Validation

  • Each column that is not nothing, and each label that is not nothing, holds one entry per factor, as many as ann_return. Otherwise, the constructor raises a DimensionMismatch.
  • ppy > 0. Otherwise, the constructor raises a DomainError.
  • No entry of ann_volatility or of mean_abs_t is negative. A NaN passes. Otherwise, the constructor raises a DomainError.
  • Each entry of t_rate and of coverage is NaN or in $[0, 1]$. Otherwise, the constructor raises a DomainError.

Related

source

Functions

PortfolioOptimisers.factor_model_summary — Function
factor_model_summary(csfm::CrossSectionalFactorModel; ppy::Number = 1,
                     threshold::Number = 2, step::Integer = 21,
                     weighting = BenchmarkWeightMetric(),
                     coverage_weighting = RegressionWeightMetric()) -> FactorSummaryResult

Summarise every factor of a cross-sectional factor model as a FactorSummaryResult.

For each column, the summary calls one function of the regression group or of the exposure group, and it aggregates the series that function returns over the observations. The only statistics it computes itself are the factor return statistics and two aggregates: the median of the stability, and the patch that reads a constant exposure as perfectly stable.

The answer is on the raw factor axis. The regression group answers on the reduced axis of the family re-basis, and the summary joins the two by name.

Algorithm

  1. Read the factor return history with factor_summary_returns, and refuse a block that has none. It is on the raw axis when the block carries fr, and on the reduced axis otherwise.
  2. Take the annualised mean, the annualised volatility and the Sharpe ratio of each series with factor_summary_return_stats. An absent return takes no part.
  3. Take the lag-one autocorrelation of each series with factor_summary_autocorrelation.
  4. Write the four statistics onto the raw axis with factor_summary_mapped, at the positions step 1 gives. A factor a family re-basis dropped has a series in fr, which the constraint of its family fixes. A block with a re-basis and no fr has no series for it, and gives NaN.
  5. Take the mean absolute t-statistic, the exceedance rate and the mean variance inflation factor with factor_summary_gram, on the raw factor axis. A block with no exposure history gives nothing for all three. An observed factor was not estimated, so it takes NaN in the three.
  6. Take the median stability and the coverage with factor_summary_exposure. A block with no exposure history gives nothing for both.
  7. Collect the nine columns, ppy, and the names and the family labels of the raw axis into a FactorSummaryResult.

Arguments

  • csfm: A cross-sectional factor model block. A caller who holds a Prior Result writes pr.rr.
  • ppy: Periods per year. 252 annualises a daily fit, and the default of 1 reports the statistics per period.
  • threshold: Absolute t-statistic that the exceedance rate counts against.
  • step: Number of observations between the two cross-sections that the stability reads.
  • weighting: The AbstractOrthogonalityMetric whose weight history the stability reads.
  • coverage_weighting: The AbstractOrthogonalityMetric whose positive weights are the universe of the coverage. Its default of RegressionWeightMetric is the estimation universe of the fit, and every asset when the block carries no regression weights. exposure_coverage reads the same default.

Validation

  • ppy > 0, else the function raises a DomainError.
  • csfm.csr is not nothing, else the function raises an IsNothingError.
  • csfm.nf is not nothing when csfm.fcb is present, else the function raises an IsNothingError.

Returns

  • fs::FactorSummaryResult: The computed summary.

Related

source
PortfolioOptimisers.port_opt_view — Method
port_opt_view(fs::FactorSummaryResult, i, args...)

Return a view of a FactorSummaryResult that keeps only the factors that i selects.

Algorithm

  1. Cut every column, nf and fam to the selected factors with factor_table_fields. An absent column stays nothing, and ppy stays as it is.
  2. Build a new FactorSummaryResult from the views.

Arguments

  • fs: A factor model summary.
  • i: The factor index: positions, a range, a Colon, a vector of names, or a LabelGroup.
  • args...: Additional positional arguments (ignored).

Validation

Returns

  • fs::FactorSummaryResult: The summary of the selected factors.

Related

source