Windowed covariance: private API
Functions
PortfolioOptimisers.variance_series — Method
variance_series(
ce::WindowedCovariance,
X::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}};
dims,
kwargs...
) -> Matrix
Compute the point-in-time variance series of a windowed covariance estimator.
Row t is the fit of the estimator on the observations 1 to t. The estimator keeps the last observations of its window among them, so the window rolls with t, and the last row equals the batch fit. Before the window is full, row t keeps every observation from 1 to t. variance_series(est, w::Option{<:ObsWeights}, window::Option{<:Int_VecInt}, X::MatNum, pnl::Option{<:AssetPanel}) states the rule.
A prior calls this method with the active_mask and estimation_mask keywords, and each fit cuts them to its own rows.
Arguments
ce: Windowed covariance estimator.X: Data matrixobservations × assetsif thedimskeyword does not exist ordims = 1,assets × observationswhendims = 2.dims: Dimension along which the computation runs.kwargs...: Keywords passed to the inner estimator. The two universe masks are cut to the rows of each fit.
Validation
dims in (1, 2).
Returns
val::Matrix{<:Number}: Variance series, shaped as(T, N)ifdims == 1or(N, T)ifdims == 2.
Related
PortfolioOptimisers.variance_series — Method
variance_series(
ce::WindowedCovariance,
X::AbstractMatrix{<:Union{Number, AbstractJuMPScalar}},
pnl::Union{Nothing, AssetPanel};
dims,
kwargs...
) -> Matrix
Compute the point-in-time variance series of a windowed covariance estimator from an Asset Panel.
Row t is the fit of the estimator on the observations 1 to t of the returns and of the panel, as in variance_series(ce::WindowedCovariance, X::MatNum; dims::Int = 1, kwargs...). Each fit gives the inner estimator the panel over its own rows, so a mask-aware inner estimator reads the active mask of the window, and a plain one reduces to the Coverage Universe of the window.
Arguments
ce: Windowed covariance estimator.X: Data matrixobservations × assetsif thedimskeyword does not exist ordims = 1,assets × observationswhendims = 2.pnl: OptionalAssetPanel. The Coverage Universe of the fit comes from its active mask. If it isnothing, the rule reads only the finiteness of the returns.dims: Dimension along which the computation runs.kwargs...: Keywords passed to the inner estimator.
Validation
dims in (1, 2).
Returns
val::Matrix{<:Number}: Variance series, shaped as(T, N)ifdims == 1or(N, T)ifdims == 2.
Related