Skip to content

synaptome.estimates

synaptome.estimates

Estimates: how large, with no hypothesis. A registry of estimators (what each needs of a question's design, its engine function and analytic interval) and the runner behind q.estimate(...) (DESIGN.md section 7).

Estimator dataclass

One estimator.

Attributes:

Name Type Description
name str
family str

"group" (one value per group), "pair" (one value per pair of groups, a - b) or "omnibus" (one value for all the groups together).

designs tuple[str, ...]

For pair estimators: "paired" and / or "independent". Group estimators: ("any",).

scales tuple[str, ...] | dict

Scales of the analysed values it accepts; a dict {design: scales} when they differ per design (read them with scales_for).

binary bool | None

True: needs a binary outcome; False: refuses one; None: either.

functions dict

{design: callable}: group f(x), paired f(x, y) (matched arrays), independent f(a, b); omnibus f(*samples), one sample per group (paired: matched arrays).

intervals dict

{design: callable} analytic intervals, called like the function plus level= (and n_eff= when n_eff_interval); a design missing here has no analytic interval.

bounded bool

Values live in a bounded range (proportions, probabilities, correlations, ratios): the basic bootstrap interval, which reflects draws around the estimate, is refused.

flip str | None

How the value changes when the pair is read the other way round (vs()): "negate", "complement" (1 - x) or "reciprocal" (1 / x).

n_eff_interval bool

The analytic interval accounts for serial correlation through an effective sample size, so it stays valid with an ordered unit (unit="time").

min_groups int

Omnibus estimators: the fewest groups they need (Kendall's W: 3).

description str

scales_for(design)

The scales accepted for design ("paired", "independent" or "any").

has_interval(design)

Whether an analytic interval exists for design ("paired", "independent" or "any").

get(name)

The registry entry for name; an unknown name lists the estimators.

compute_estimate(question, name, ci='analytic', confidence=0.95, n_boot=2000, seed=0, interval='bca', replicates=None, assume_independent=False, return_draws=False)

Computes estimator name on question. See Question.estimate for the parameters.

Parameters:

Name Type Description Default
return_draws bool

Also return, per row of the table, the bootstrap draws and the BCa acceleration (ci="bootstrap" only), for the bootstrap test.

False

Returns:

Type Description
(table, method[, draws]): tuple

One row per group or per pair (a - b), and per along coordinate; method records the estimator and every setting used; draws is a list of (draws, acceleration), one per row.

Raises:

Type Description
ValueError

When the estimator doesn't suit the question (design, scale, binary outcome, ordered unit) or the settings are invalid, naming what to use instead.