Low-dimension ensemble prior: private API
PortfolioOptimisers.fit_min_rows — Function
fit_min_rows(est)Returns the fewest observations that an estimator tree can fit on.
An estimator whose fit is undefined below some number of rows states that number with a method of its own. LowDimensionEnsemblePrior states three, because two regression pairs are the fewest whose regressor covariance exists. Every other estimator returns the largest floor in its fields, so a floor that a prior states three levels down reaches the rule that holds the head.
Mathematical definition
\[\begin{align} n(e) &= \begin{cases} n_e & \text{if } e \text{ states a floor}\,,\\ \max\left(1,\, \max_{f \in \mathcal{F}(e)} n(f)\right) & \text{otherwise}\,. \end{cases} \end{align}\]
Where:
- $n(e)$: Fewest rows that estimator $e$ can fit on.
- $n_e$: Floor that the type of $e$ states.
- $\mathcal{F}(e)$: Estimators that the fields of $e$ hold, one for each estimator-valued field and one for each entry of a field that holds a vector of estimators. A value that is not an estimator has $n = 1$.
Arguments
est: The estimator tree, or any value.
Returns
n::Integer: The fewest rows.
Related