scope_rl.utils.estimate_confidence_interval_by_t_test#

scope_rl.utils.estimate_confidence_interval_by_t_test(samples, alpha=0.05, **kwargs)[source]#

Estimate the confidence interval by Student T-test.

Note

Student T-test assumes that \(X \sim p(X)\) follows a normal distribution. Based on this assumption, the \(1 - \alpha\) % confidence interval of \(\mu := \mathbb{E}[X]\) is derived as follows.

\[|\hat{\mu} - \mu| \leq \frac{T_{\mathrm{test}}(1 - \alpha, n-1)}{\sqrt{n} / \hat{\sigma}},\]

where \(n\) is the data size, \(T_{\mathrm{test}}(\cdot,\cdot)\) is the T-value, and \(\sigma\) is the standard deviation, respectively.

Parameters:
  • samples (NDArray) – Samples.

  • alpha (float, default=0.05) – Significance level. The value should be within [0, 1).

Returns:

estimated_confidence_interval – Dictionary storing the estimated mean and upper-lower confidence bounds.

Return type:

dict