Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Am/test/hl api noise checks #1975

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

IceTDrinker
Copy link
Member

@IceTDrinker IceTDrinker commented Jan 15, 2025

@mayeul-zama as I'm touching some of the stats primitives that you touched recently

Copy link
Contributor

@nsarlin-zama nsarlin-zama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small comments

tfhe/src/core_crypto/commons/mod.rs Show resolved Hide resolved
tfhe/src/core_crypto/commons/math/random/t_uniform.rs Outdated Show resolved Hide resolved
@IceTDrinker IceTDrinker force-pushed the am/test/hl-api-noise-checks branch 3 times, most recently from 27d936a to 496d568 Compare January 24, 2025 13:31
- add arithmetic mean primitive
- add variance confidence interval based on Chi Square test
- add a test on the confidence interval taken from a web site giving
examples of confidence intervals
@IceTDrinker
Copy link
Member Author

I'll try the "bootstrapping" method found online for the confidence interval for non gaussian stuff, if it does not work we won't have much choice than to go with the current stuff even if the confidence interval seems to not behave as expected for the TUniform distribution here

@IceTDrinker
Copy link
Member Author

got something that looks more reasonable based on the central limit theorem the gist is

X ~ TUniform(b)
define the auxiliary variable Y ~ X^2 given E[X] = 0 then sum(Y_i) / (N - 1) is the unbiased variance estimate.

for a sufficient number of samples E[Y] = sum(Y_i) / N distribution follows a normal law https://en.wikipedia.org/wiki/Central_limit_theorem#Classical_CLT

using that relationship with the normal law we can get a link between the variance estimate we want and that normal law allowing to use the normal law inverse CDF to have a confidence interval, managed to confirm that the confidence interval looks ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants