You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Context:**
### What is Rademacher sampler
We used such a sampler in our finite-diff gradient module. Long story
short, it's an evenly distributed `{+1, -1}` sampling.
As a result, the `np.var` of such sampling can be proved to be **not a
normal distribution**; in fact, as a
[textbook](https://statproofbook.github.io/P/norm-chi2.html) chi-squared
distribution, it satisfies
$$S^2 = 1 - \bar{X}^2 \le 1$$
where $\bar{X}$ is the sampling average, which is clearly not symmetric
over the expected variance $\sigma^2 = 1$.
Furthermore, the CDF of this distribution looks like
<img width="1200" height="700" alt="Code_Generated_Image(1)"
src="https://github.com/user-attachments/assets/f37967e4-d347-42b9-83fe-c3d94fcf6b4c"
/>
Hence our original test for this sampler that validates the sampling
variance with `atol = 4/N` has a considerable chance to fail given
correct samples from correct distribution.
**Description of the Change:**
Complicated but basically just recall the stats stuff and set up the
correct threshold.
**Benefits:**
**Possible Drawbacks:**
**Related GitHub Issues:**
[sc-90962]
0 commit comments