-
Notifications
You must be signed in to change notification settings - Fork 34
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
Test failing randomly #99
Comments
I did look at the distribution for various appliance numbers with the following code
And here is the result graph It seems to me that when the value of appliance number is too small the distribution is not normal at all and when it is larger, than there are two larger tails for coincidence values of 1 and In this test the method
The call of min and max explains the tails at 1 and Was this behavior intended @FLomb ? If not, thank to @ClaudiaLSS test we could spot it :) ! |
The reason of the failure must be investigated in a dedicated issue #99
|
The reason of the failure must be investigated in a dedicated issue #99
https://doi.org/10.1145/1146238.1146263 Might be a good reference for stochastic testing, their repo is located https://github.com/UDST/urbansim |
@FLomb - a comment on #99 (comment) would help me to address this failing test :) |
Hi, This issue is related to something we dealt with quite some time ago (in PR #7). Unfortunately, most of the discussion with the user who proposed that PR happened via email. So I took the time to look back at those very lengthy email discussions to get my head around this issue. Here are my thoughts. As you correctly noted, the calls of min and max explain the tails at 1 and appliance.number. Those are not ideal, and it would be nice to find a solution for them, but they are not unexpected. The fact that the distribution is skewed to the right, especially when simulating few appliances, is not due to the math.ceil that needs to remain in place to ensure we only get integer numbers. Instead, it is due to the hard-coded +0.5 bit. This was initially introduced as part of the above-referenced past PR as a way to skew on-peak distributions to the right on purpose. Nonetheless, looking back at this with some perspective, and having made additional tests today, I think that was a mistake. In fact, the mu_peak parameter is what is supposed to allow users to skew the distribution more towards the right or the left (by making it larger or smaller than the default 0.5). The parameter works perfectly for this aim, and the +0.5 is unnecessary. If we agree that on-peak switch-on events shouldn't be perfectly Gaussian by default, but slightly more in favour of a higher number of appliances switched-on coincidentally, we should just modify the default value for this parameter, not add a +0.5 to the code. Regarding the test, all of the above means the following:
In addition, regardless of what we do with this test, I propose we scrap the +0.5 parameter. |
HI @Bachibouzouk, thanks for the update! As a side note, was it on purpose that you edited my comment with your updates instead of replying to it? I find it less straightforward to follow the discussion this way. Anyhow, I tried replicating your original code, but I couldn't, due to an Adding the |
No this was a manipulation mistake, sorry for that! Here is my message (now not in the right order of the timeline) @FLomb - I think actually the 0.5 factor is needed but not at the same place The following picture is the distribution where I removed the +0.5 factor One can see that the distribution is shifted to the right compared to gaussian distribution. If I add a correction shift of -0.5 within the So I suggest we change the current code:
to
|
This is peculiar, which branch were you on? Maybe we can have a bilateral call on this? |
This test passes and fails randomly, which can be confusing
The text was updated successfully, but these errors were encountered: