-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Dealing with correlations #29
Comments
Ciao Mauro, I think this is not working because you're using relative errors, and therefore saying that one error has a larger impact breaks the 100% correlation. I think you may need to use a summed error Therefore, for the second consideration, you probably need to use absolute errors (this is a simple example, but I think it may be the proper way to attack the problem): >>> sys = ufloat(0.0, 0.2)
>>> val_y = 10
>>> y = ufloat(val_y, 0.0) + val_y * sys
>>> val_z = 10
>>> z = ufloat(val_z, 0.0) + val_z * sys * 2 # Two times larger
>>> y + z
20.0+/-0.6 Or something like this... Albert |
Sorry, I forgot the x part >>> val_x = 5
>>> x = ufloat(val_x, 0.0) + val_x * sys
>>> x + y
15.0+/-0.3
>>> x/y
0.5+/-0
>>> y/x
2.0+/-0 Albert |
Mauro, the behavior that you observe is perfectly correct, since each number created with Albert's approach is a good idea: since you need a single independent variable, there should be a single If I were to code what you want, I would do:
In general, you can create correlated random variables with the |
Dear lebigot,
I am facing the problem of properly correlating the error sources in different observables (variables). I know that the package is supposed to properly deal with it, but that's only in case the error variable is actually the same.
I am in the unfortunate situation in which this is not the case and the same error source has different inpact on different observables. I was hoping that the tag attribute might do the trick but this example shows it's not the case:
So, how do I fully correlate (positively and negatively) two variables? Of course the problem is a lot trickier than this mock-up exaple, and has some error sources that correlate between variables and others that don't.
Let me know if I did not explain myself properly and of course if you have a solution :).
Thank you
The text was updated successfully, but these errors were encountered: