Skip to content

API reference / Switchback

tsdive.switchback.Analysis dataclass

Analysis(
    counts: ndarray,
    estimate: float = math.nan,
    lo: float = math.nan,
    hi: float = math.nan,
    p_value: float = math.nan,
    reason: str = "",
)

One randomization analysis of a target, or the reason it has none.

counts holds the kept samples per block, also on a refusal. The bounds are -inf or +inf on a side the interval does not close on. On a refusal reason is one of REASONS and the numbers are NaN.

Attributes:

Name Type Description
counts ndarray
estimate float
lo float
hi float
p_value float
reason str
n_kept int

counts instance-attribute

counts: ndarray

estimate class-attribute instance-attribute

estimate: float = math.nan

lo class-attribute instance-attribute

lo: float = math.nan

hi class-attribute instance-attribute

hi: float = math.nan

p_value class-attribute instance-attribute

p_value: float = math.nan

reason class-attribute instance-attribute

reason: str = ''

n_kept property

n_kept: int