Skip to content
5

Factor Prior

PortfolioOptimisers.FactorPrior Type
julia
struct FactorPrior{T1, T2, T3, T4, T5} <: AbstractLowOrderPriorEstimator_F
    pe::T1
    mp::T2
    re::T3
    ve::T4
    rsd::T5
end

Factor-based prior estimator for asset returns.

FactorPrior is a low order prior estimator that computes the mean and covariance of asset returns using a factor model. It combines a factor prior estimator, matrix post-processing, regression, and variance estimation to produce posterior moments. Optionally, it can add residual variance to the posterior covariance for robust estimation.

Fields

  • pe: Factor prior estimator.

  • mp: Matrix post-processing estimator.

  • re: Regression estimator.

  • ve: Variance estimator for residuals.

  • rsd: Boolean flag to add residual variance to posterior covariance.

Constructor

julia
FactorPrior(; pe::AbstractLowOrderPriorEstimator_A_AF = EmpiricalPrior(),
            mp::AbstractMatrixProcessingEstimator = DefaultMatrixProcessing(),
            re::AbstractRegressionEstimator = StepwiseRegression(),
            ve::AbstractVarianceEstimator = SimpleVariance(), rsd::Bool = true)

Keyword arguments correspond to the fields above.

Examples

julia
julia> FactorPrior()
FactorPrior
   pe ┼ EmpiricalPrior
      │        ce ┼ PortfolioOptimisersCovariance
      │           │   ce ┼ Covariance
      │           │      │    me ┼ SimpleExpectedReturns
      │           │      │       │   w ┴ nothing
      │           │      │    ce ┼ GeneralCovariance
      │           │      │       │   ce ┼ StatsBase.SimpleCovariance: StatsBase.SimpleCovariance(true)
      │           │      │       │    w ┴ nothing
      │           │      │   alg ┴ Full()
      │           │   mp ┼ DefaultMatrixProcessing
      │           │      │       pdm ┼ Posdef
      │           │      │           │   alg ┴ UnionAll: NearestCorrelationMatrix.Newton
      │           │      │   denoise ┼ nothing
      │           │      │    detone ┼ nothing
      │           │      │       alg ┴ nothing
      │        me ┼ SimpleExpectedReturns
      │           │   w ┴ nothing
      │   horizon ┴ nothing
   mp ┼ DefaultMatrixProcessing
      │       pdm ┼ Posdef
      │           │   alg ┴ UnionAll: NearestCorrelationMatrix.Newton
      │   denoise ┼ nothing
      │    detone ┼ nothing
      │       alg ┴ nothing
   re ┼ StepwiseRegression
      │     crit ┼ PValue
      │          │   threshold ┴ Float64: 0.05
      │      alg ┼ Forward()
      │   target ┼ LinearModel
      │          │   kwargs ┴ @NamedTuple{}: NamedTuple()
   ve ┼ SimpleVariance
      │          me ┼ SimpleExpectedReturns
      │             │   w ┴ nothing
      │           w ┼ nothing
      │   corrected ┴ Bool: true
  rsd ┴ Bool: true

Related

source
PortfolioOptimisers.prior Method
julia
prior(pe::FactorPrior, X::AbstractMatrix, F::AbstractMatrix; dims::Int = 1, kwargs...)

Compute factor-based prior moments for asset returns using a factor model.

prior estimates the mean and covariance of asset returns using the specified factor prior estimator, regression, and matrix post-processing. The factor returns matrix F is used to compute factor moments, which are then mapped to asset space via regression. Optionally, residual variance is added to the posterior covariance for robust estimation. The result is returned as a LowOrderPrior object.

Arguments

  • pe: Factor prior estimator.

  • X: Asset returns matrix (observations × assets).

  • F: Factor returns matrix (observations × factors).

  • dims: Dimension along which to compute moments.

  • kwargs...: Additional keyword arguments passed to matrix processing and estimators.

Returns

  • pr::LowOrderPrior: Result object containing posterior asset returns, mean vector, covariance matrix, Cholesky factor, regression result, and factor moments.

Validation

  • dims in (1, 2).

Related

source