cogwheel.utils.n_effective¶
- cogwheel.utils.n_effective(weights)¶
Calculate the effective sample size from a set of weights.
This function computes the effective sample size using the formula (sum(weights))^2 / sum(weights^2).
- Parameters:
- weightsnumpy.ndarray
An array of sample weights.
- Returns:
- float
The effective sample size.