Cross-Sectional Regression (b)
Functions
StatsAPI.predict — Method
StatsAPI.predict(csr::CrossSectionalRegression, Z::Arr3Num) -> MatNumReturn 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
- Call
cross_sectional_systematicwithcsr.f,csr.bandZ.
Arguments
csr: A cross-sectional regression result.Z::Arr3Num: Exposure tensorassets × factors × observations. The asset axis may differ from the one the fit saw. The observation axis and the factor axis must matchcsr.f.
Validation
- The rules of
cross_sectional_systematic.
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.5Related