bayesplain.core.normal_t.difference_draws

bayesplain.core.normal_t.difference_draws(n1, mean1, sd1, n2, mean2, sd2, size=100000, rng=None)[source]

Draw the difference of two means without assuming equal variances.

The Behrens-Fisher case. Each group’s mean posterior is an exact Student-t that can be sampled directly; the difference of two of them has no closed form, so the draws are subtracted pairwise.

Parameters:
n1 : int

Group sizes.

n2 : int

Group sizes.

mean1 : float

Group means.

mean2 : float

Group means.

sd1 : float

Group standard deviations.

sd2 : float

Group standard deviations.

size : int, default 100_000

Number of draws.

rng : numpy.random.Generator, optional

Random generator.

Returns:

Draws of mean2 - mean1.

Return type:

ndarray