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

Calculation of medianconversion factors #2

Closed
Gregor0815 opened this issue Feb 11, 2016 · 3 comments
Closed

Calculation of medianconversion factors #2

Gregor0815 opened this issue Feb 11, 2016 · 3 comments
Assignees
Labels

Comments

@Gregor0815
Copy link

In order to understand all steps in quantity calculation, I rebuilt the medianconversion factor calculation. I was aming for the same results.
But unfortunately I didn't get them. After little investigation I figured out that in your calculation conversion factors replaced by inf (division by zero) are not removed before calculating the median. Why are those values beeing kept, what is the idea behind that? Or is it simply a bug?

best regards

@paulrougieux
Copy link
Collaborator

Fixed in this commit by removing Inf values from the calculation.

But this problem of conversion factors equal to Inf would be better solved earlier by changing 0 quantities to NA values. In other words, a zero quantity doesn't make sense, it should be replaced by a missing value. This might be done in an earlier stage. I'll mark this issue as solved for now.

@Gregor0815
Copy link
Author

As it is the same topic, I just want to mention that 0 conversion factors exists as well (due to 0 weight) in medianconversion factor calculation. If inf values are removed, 0 values should be removed too - I would consider it just as the same problem.

@paulrougieux paulrougieux reopened this Feb 18, 2016
@paulrougieux
Copy link
Collaborator

Correct, I have removed 0 and Inf values from the conversion factor calculation in commit 3e91a1d.
I have also added a unit test.

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

No branches or pull requests

2 participants