Closed Efrem-Braun closed 2 months ago
@ptmerz would you have time to take a quick look? Is it using bootstrapping or introducing some other randomness to get the uncertainty? We should be providing the same standard error for the same data.
Note that with new simulations, the z-score WILL change by as much as 0.2, so it's difficult make automated decisions. But for the same data, we should be able to provide consistency.
Huh, that's unexpected! I'll take a look tonight.
Hi @Efrem-Braun, thanks for filing a ticket! Looking at your MWE, it seems you missed a part when copying your script: The actual call to physical_validation.kinetic_energy.distribution
is missing, and that makes it difficult to know what exactly is happening here.
My guess would be, however, that you didn't specify the bootstrap_seed
. See here: https://physical-validation.readthedocs.io/en/stable/physical_validation.html#physical_validation.kinetic_energy.distribution
bootstrap_seed – Sets the random number seed for bootstrapping (if strict=False). If set, bootstrapping will be reproducible. Default: None, bootstrapping is non-reproducible.
For the kinetic energy distribution test, the errors are calculated using bootstrapping, so if you don't define the seed what you're seeing is actually expected (contrary to my earlier comment...).
Let me know if this solves your issue. If it doesn't I'd appreciate if you could copy a true MWE, including the call to physical_validation.kinetic_energy.distribution
. Thank you!
My apologies; I didn't copy the last few lines of the script. I just edited the example above so it's now complete.
And you are indeed correct that setting the bootstrap_seed
makes the code consistent. Thanks so much for your help!
I implemented some physical validation tests for a system, and I've found that I get different z scores for the kinetic_energy.distribution test each time I run it, even running on the exact same data. I found that this is because the calculated standard deviation between runs is different.
Here's a minimal reproducible example:
When I run this multiple times in a directory with the attached energies.csv file, I get results like:
You can see that for the "trajectory" analysis, I get:
with different standard deviations, even though all used the exact same input data. This changes the z scores up to 0.2, which for my particular case was causing the test to fail sometimes and pass other times.
These reports were obtained using physical_validation v1.0.5 (the current version) and Python 3.11.4 on my Ubuntu machine.