Closed smwindecker closed 3 months ago
potentially as pmf utility package check what packages already exist
remembering that model wants delay dist input as long format that can be fed to data_to_matrix
note we might want to do another pass at naming of these things, a seropositivity curve would be used in the exact same way but it is not a pmf, so maybe we should choose a more generic term for it
@njtierney notes it would perhaps be better to save our class first:
class(delay_pmf) <- c("delay_pmf", class(delay_pmf))
class attribute for the pmf should include a note on how the pmf is begotten (ie parameteric or empirical), and what the columns mean
Need to run make_massfun on NSW linelist to get new delay for symptom-notification in correct format. Kate to do once code finalized.
Note - current make_massfun doesn't work if you're converting an ecdf to a pmf if the ecdf has already had the tailed clipped or been normalised because it will potentially clip off a large amount of the weight.
If we want to this into a generic ecdf- pmf function then need to have warnings or options for this
Notes for August - old incubation period function sets the range of days from 0:28 - the new code with quantiles cuts this same distribution off at 0:12 days which captures 98% of the mass. Is this ok and just simpler?
Not always adding up to 1 when normalise is used. Seems to be when data is cut off - weight doesn't seem to be reassigned
Not always adding up to 1 when normalise is used. Seems to be when data is cut off - weight doesn't seem to be reassigned
Fixed with the following code:
if (normalise) { delay_massfun <- delay_massfun %>% dplyr::mutate( correction = sum(mass), mass = mass / correction ) }
implement pmf instead of cdfs for distributions
@goldingn 's notes on the topic: