Cross-Sectional Regression (b)

Functions

StatsAPI.predict — Method
StatsAPI.predict(csr::CrossSectionalRegression, Z::Arr3Num) -> MatNum

Return the systematic part of a fitted cross-sectional regression, observations × assets.

For the X that the fit saw, the residuals of the result are X - predict(csr, Z) already. The method gives the systematic part on an exposure tensor that the fit did not see.

Algorithm

  1. Call cross_sectional_systematic with csr.f, csr.b and Z.

Arguments

  • csr: A cross-sectional regression result.
  • Z::Arr3Num: Exposure tensor assets × factors × observations. The asset axis may differ from the one the fit saw. The observation axis and the factor axis must match csr.f.

Validation

Returns

  • Xh::MatNum: Systematic returns, observations × assets.

Examples

julia> Z = reshape([1.0, 0.0, 0.5, 0.0, 1.0, 0.5], 3, 2, 1);julia> csr = cross_sectional_regression(CrossSectionalLinearRegression(), Z, [1.0 2.0 1.5],                                        ones(1, 3));julia> predict(csr, Z)1×3 Matrix{Float64}: 1.0  2.0  1.5

Related

source