0

Can someone help me understand this function? I am wondering what methodology or stats framework it is based off.

`def _impact_estimate( self, n_test: int, n: int, flevel: float, sig_level: float, power_level: float) -> float: """Estimate the required incremental impact, without the sigma term.

Args:
  n_test: Number of test period time points.
  n: Number of pretest period time points.
  flevel: Inverse quantile of the F(1, n - 1) distribution.
  sig_level: Significance level (one-sided).
  power_level: Required statistical power.

Returns:
  The value of the impact formula without the residual s.d. (sigma) term.
"""
phi = stats.f(dfn=1, dfd=n - 1).ppf(flevel)
tq_sig = stats.t.ppf(sig_level, df=n - 2)
tq_pow = stats.t.ppf(power_level, df=n - 2)
sq = np.sqrt(phi * (n + 1) / (n * n_test * (n - 1)) + 1 / n + 1 / n_test)
term = (tq_sig + tq_pow) * n_test * sq
return term

`

I've done a lot of google searches but could not find any clue

0 Answers0