spectral_connectivity.statistics.power_bias#

power_bias(n_observations: int) → float[source]#

Bias of the log power spectrum.

A multitaper power estimate satisfies S_hat / S ~ chi2_nu / nu with nu = 2 * n_observations degrees of freedom. Writing chi2_nu as 2 * Gamma(nu / 2) gives E[log(S_hat / S)] = psi(nu / 2) - log(nu / 2), i.e. the digamma/log are evaluated at the chi-squared shape parameter nu / 2 = n_observations (not at nu).

Parameters:

n_observations (int) – n_observations is n_tapers * n_trials

Returns:

bias

Return type:

float

Examples

>>> print(f"Bias with 100 obs: {power_bias(100):.6f}")
Bias with 100 obs: -0.005008
>>> print(f"Bias with 1000 obs: {power_bias(1000):.6f}")
Bias with 1000 obs: -0.000500