Bootstrap Uncertainty Sets: private API

PortfolioOptimisers.bootstrap_generatorFunction
bootstrap_generator(ue::ARCHUncertaintySet, X::MatNum; kwargs...)

Refits the mean and the covariance on every block bootstrap resample of X, in one pass over one index stream.

Both statistics are read from the same resample, so a caller that needs both axes gets them from ue.n_sim index vectors rather than from two independent runs of ue.n_sim each.

Algorithm

  1. Read the observation count T from X, and allocate mus and sigmas.
  2. Resolve the generator with resolve_rng, giving rng. A set ue.seed gives a private reseeded copy, so the stream restarts at the same place on every call and ue.rng is never advanced. An unset ue.seed gives ue.rng itself, so the stream continues where the previous call left it.
  3. For each of the ue.n_sim simulations, draw one index vector with bootstrap_indices and take those rows of X, giving the resample Xi.
  4. Fit ue.me on Xi, giving one column of mus.
  5. Fit ue.ce on Xi, giving one slice of sigmas. Steps 4 and 5 read the same Xi, which is what pairs the two statistics.
  6. Return mus and sigmas. ue.pe fits the point estimate the deviations are taken from, and takes no part here.

Arguments

  • ue: ARCH uncertainty set estimator.
  • X: Data matrix to be resampled, one row per observation.
  • kwargs...: Additional keyword arguments passed to ue.me and ue.ce.

Returns

  • mus::Matrix{<:Number}: Matrix of bootstrapped expected return vectors (size(X, 2) × ue.n_sim).
  • sigmas::Array{<:Number, 3}): Array of bootstrapped covariance matrices (size(X, 2) × size(X, 2) × ue.n_sim).

Related

source
PortfolioOptimisers.mu_bootstrap_generatorFunction
mu_bootstrap_generator(ue::ARCHUncertaintySet, X::MatNum; kwargs...)

Refits the mean on every block bootstrap resample of X, and fits no covariance.

The index stream is the one bootstrap_generator walks, drawn one vector per simulation. A set ue.seed restarts it at the same place, so this function sees the same resamples as its two siblings; an unset ue.seed does not, and the three then walk different parts of one shared stream.

Algorithm

  1. Read the observation count T from X, and allocate mus.
  2. Resolve the generator with resolve_rng, giving rng. A set ue.seed gives a private reseeded copy, so the stream restarts at the same place on every call and ue.rng is never advanced. An unset ue.seed gives ue.rng itself, so the stream continues where the previous call left it.
  3. For each of the ue.n_sim simulations, draw one index vector with bootstrap_indices and take those rows of X, giving the resample Xi.
  4. Fit ue.me on Xi, giving one column of mus.
  5. Return mus. ue.ce is not read, and ue.pe fits the point estimate the deviations are taken from and takes no part here.

Arguments

  • ue: ARCH uncertainty set estimator.
  • X: Data matrix to be resampled, one row per observation.
  • kwargs...: Additional keyword arguments passed to ue.me and ue.ce.

Returns

  • mus::Matrix{<:Number}: Matrix of bootstrapped expected return vectors (size(X, 2) × ue.n_sim).

Related

source
PortfolioOptimisers.sigma_bootstrap_generatorFunction
sigma_bootstrap_generator(ue::ARCHUncertaintySet, X::MatNum; kwargs...)

Refits the covariance on every block bootstrap resample of X, and fits no mean.

The index stream is the one bootstrap_generator walks, drawn one vector per simulation. A set ue.seed restarts it at the same place, so this function sees the same resamples as its two siblings; an unset ue.seed does not, and the three then walk different parts of one shared stream.

Algorithm

  1. Read the observation count T from X, and allocate sigmas.
  2. Resolve the generator with resolve_rng, giving rng. A set ue.seed gives a private reseeded copy, so the stream restarts at the same place on every call and ue.rng is never advanced. An unset ue.seed gives ue.rng itself, so the stream continues where the previous call left it.
  3. For each of the ue.n_sim simulations, draw one index vector with bootstrap_indices and take those rows of X, giving the resample Xi.
  4. Fit ue.ce on Xi, giving one slice of sigmas. This is the first of the two places the ellipsoidal route reads ue.ce.
  5. Return sigmas. ue.me is not read, and ue.pe fits the point estimate the deviations are taken from and takes no part here.

Arguments

  • ue: ARCH uncertainty set estimator.
  • X: Data matrix to be resampled, one row per observation.
  • kwargs...: Additional keyword arguments passed to ue.me and ue.ce.

Returns

  • sigmas::Array{<:Number, 3}: Array of bootstrapped covariance matrices (size(X, 2) × size(X, 2) × ue.n_sim).

Related

source