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

Custom LoS distribution #71

Open
samclifford opened this issue Apr 9, 2020 · 5 comments
Open

Custom LoS distribution #71

samclifford opened this issue Apr 9, 2020 · 5 comments

Comments

@samclifford
Copy link
Collaborator

samclifford commented Apr 9, 2020

We can continue to parametrise these in terms of mean and cv for users, but it might be worth considering asking if they want to use a Weibull via a drop-down menu. This would mean reworking los_gamma() to be a more general function that accepts an argument specifying whether the distribution to be used is one of gamma or weibull (or any other).

This would require checking which parameters are to be passed on to the distribution. There's no closed form solution for moment matching a weibull, but we have λ = μ/Γ(1 + 1/k) and then we solve the following for k: CV^2 - (Γ(1 + 2/k))/(Γ(1 + 1/k))^2 + 1 = 0 and substitute the result into the equation for λ

@samclifford
Copy link
Collaborator Author

Considering it might be worth adding a boxplot horizontally under the barplot that we visualise with in order to show more than just the 95% quantile. Gamma and Weibull with the same mean and variance will have different skewness and kurtosis and, probably more importantly, median. Could be useful visual feedback for user.

@samclifford
Copy link
Collaborator Author

And with this implemented it might be worth having the Zhou parameter sets provide feedback with the 95% CI under the selectInput.

thibautjombart added a commit that referenced this issue Apr 22, 2020
adding functions to incorporate weibull distribution #71
@samclifford
Copy link
Collaborator Author

@pearsonca has mentioned that it might be worth moving towards using the same sort of approach to LoS distributions as gets reported in the studies cited by the LoS review paper. This is most often the 25%, 50% and 75% quantiles. Specifying three numbers for a two parameter distribution would require moving to a call to optim as was written for the LoS review. Might be a little more computationally intensive and you'd need to check the sanity of the slider values to ensure you don't specify a median outside the IQR. Alternatively we could just ask for the IQR and return the exact match. Might require a call to optim still, but at least we would be returning what they asked for.

@samclifford
Copy link
Collaborator Author

The weibull_IQR branch contains this now and is complete as of 3730d5c

@samclifford
Copy link
Collaborator Author

Feedback from authors of LoS review is to include the China distributions as well as the rest of the world. Added in c721730

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

No branches or pull requests

1 participant