FactorSVResult._column#

FactorSVResult._column(series)[source]#

Resolve a series label or index to a column.

Parameters:

series (str | int) – A label from series_names or a column index.

Return type:

int

Returns:

The column index.

Raises:

SpecificationError – If the label is unknown or the index is out of range.

Example

>>> import numpy as np
>>> y = np.random.default_rng(0).standard_normal((120, 3))
>>> res = FactorSV(y, n_factors=1, series_names=("a", "b", "c")).fit(
...     n_draws=40, n_burn=10, seed=0
... )
>>> res._column("c"), res._column(0)
(2, 0)
>>> res._column(3)
Traceback (most recent call last):
cultivars.exceptions.SpecificationError: series index 3 is out of range for 3.