-
Notifications
You must be signed in to change notification settings - Fork 11
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
Extracting parameters from reported median and range #1
Comments
I think it's a good idea to implement extraction of distributional parameters from a wide range summary statistics (e.g. mean, variance, CIs etc.). I'm not sure I follow what's going on here though: if
Is that right? |
There are two parts to the loss function above. One minimises the least square residual for the median, i.e.
And above aims to minimise the log likelihood, by adding the negation of the above to the loss function for the median. Which is quite a rough approach, as it's implicitly weighting the two parts – and from some simulation recoveries, looks like can make a slight difference, e.g. whether or not to use log likelihood or just likelihood. |
Reference for |
Two suggested updates to extract_param():
|
Another suggested update to extract_param():
|
Posting example implementation in current {epiparameter} version for reference: sample_out <- rlnorm(200,meanlog=2.5,sdlog=0.6)
hist(sample_out)
extract_param(
type = "range",
values = c(median(sample_out), round(min(sample_out)), round(max(sample_out))),
distribution = "lnorm",
samples = length(sample_out),
control = list(max_iter = 100)
) |
Descriptive studies often report summary values such as median, range, or percentiles (e.g. 95%) for estimated incubation periods. We already have functionality to extract parameters for an assumed distribution and its cdf from a reported percentiles using least squares in
extract_param
, e.g.extract_param(type = "percentiles", values = c(5.9,21.4), distribution = "lnorm", percentiles = c(0.025,0.975))
However, it would also be useful to be able to extract parameters for an assumed distribution
g(x)
from a reported median. If we defined our observed median, range and number of samples asvals = c(median, min, max, n)
, then one option for a function to minimise over two parameters for a lognormal distribution,a
andb
would be:This seems to be able to recover the correct expected median and range for a given sample size in bootstrap simulations from the estimated distribution. But there may be a more elegant way of defining the function to be minimised.
The text was updated successfully, but these errors were encountered: