Cross-Sectional Prior Fold (b)

Each update of a CrossSectionalFactorPrior after its first partial_fit! computes the exposures, the regression and the idiosyncratic variance of the new observations alone, from the last panel rows that its descriptors read. Then prior(pe) builds the result with the code of the batch fit.

PortfolioOptimisers.prior — Method
prior(
    pe::CrossSectionalFactorPrior,
    st::CrossSectionalCarryState;
    strict,
    cache_reg,
    kwargs...
) -> LowOrderPrior

Reads a Cross-Sectional Factor Prior out of its carry fold, with no data.

The call with no data builds the Prior Result with cross_sectional_assemble, the code of the batch fit, from the histories that the state carries and the factor prior that it folded. The idiosyncratic correlation reads the ce that the state folded, or refits there from the carried rows when ce does not fold. The Return Forecast refits there too, unless the state carries its rows, as folds_forecast_rows answers. Then the call reads its Result off those rows with return_forecast_result. The standardised idiosyncratic returns are the rows that the state carries, so the call does not standardise the history again.

Algorithm

  1. Refuse a state that has not made its first fit.
  2. Append the observed factors of the fitted observations to the fitted factors with cross_sectional_carry_append.
  3. Read the factor prior with cross_sectional_factor_prior over the factor returns of the factors that are not empty and the observed returns, and process and expand its moments with cross_sectional_factor_moments. An Observed Factor is never empty.
  4. Count the residuals of each asset with variance_count on the folded ve.
  5. Take the returns data of the Return Forecast with cross_sectional_carry_forecast_returns.
  6. Build the result with cross_sectional_assemble, with the Return Forecast history and the standardised idiosyncratic returns that the state carries. The block records the position of each fitted row among the kept observations, and no timestamp, because the buffer keeps none.
  7. Record the Shared Series cut of the buffer with shared_series_record, which writes the marks of the dropped observations and maps each position to its observation among the folded observations.

Arguments

  • pe: Cross-Sectional Factor Prior estimator.
  • st: The state of its carry fold.
  • strict: Whether to throw an error if sets does not contain the desired value in sets.dict[key]. It is forwarded to the factor prior.
  • cache_reg: If true, a prior stores on its result the cache that its refit under new scenario weights reads: a CrossSectionalFactorPrior the active mask and the Return Forecast history on its block, and an OpinionPoolingPrior the rows of pe1, its pooled weights and the cache of pe2 in pc. The refit of an entropy pooling prior around it then runs no regression and no opinion. Every other prior forwards it to the prior that it wraps. Default is false. It is forwarded to cross_sectional_assemble.
  • kwargs...: Additional keyword arguments passed to the matrix processing and the lift.

Validation

  • st holds a fit: lag + 2 observations follow the Descriptor warm-up. An ArgumentError is thrown otherwise.
  • The rules of cross_sectional_assemble.

Returns

  • pr::LowOrderPrior: The prior that the folded observations state.

Related

source