You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a placeholder discussion for me writing about all the existing functions in the package. For each function I'll write whether I think we should keep it, and whether I see that there is an alternative better way to implement the functionality given the package redesign.
I will ping people when I am finished and ready to discuss this.
Status:
Simulation
Preprocess
Observe
S3 generics
Method default
Latent individual model
Postprocess
Plot
Data
Utility functions
Simulation
I do find simulation functions to be useful as a developer (including e.g. to simulate data for a vignette or test), but am unsure that "running a simulation study" is a part of the core functionality of the package. Perhaps it is for more advanced users who might want to know what kind of biases they can expect for their observation process.
Simulate a censored PMF. Unsure exactly what this is doing. I like that you can put in any distribution for rprimary and rdelay. I don't know why there is a restriction to specify alpha and beta: suggests restriction to gamma distributions? Can we generalise here? Also how does it fit in with the below? Directing simulating the delay distribution rather than the case data?
Simulation of case data
So these three functions I think are all simulating case data in the same output format (a data.table with columns for case and ptime). Can we make these into one function with an argument for the type of simulated case data? Seems to be good to me to do that and probably not hard. Simplest is just distribution %in% c("exponential", "uniform", "gillespie"). (Maybe "Gillespie" isn't really a distribution like the others and we need whatever distribution it produces.)
Simulate secondary events based on a delay distribution. So I think this is a good complement to the simulation of case data and makes sense. Perhaps in that vein we should have simulate_primary above.
For a target variable convert from individual data to counts. I found that linelist_to_counts(sim_obs) works. What's target_time? The time that the counts should correspond to? pad_zeros is whether there should be a row with zero cases if there are no cases? Need to try additional_by argument.
Needs to be documented and add unit tests. Possible unit tests:
This takes draws, alters the mean by removing a random number in zero one (I guess this is supposing that the censoring interval is of length 1, but what about the two censoring windows?)
It then adds meanlog and sdlog parameters (the inverse of add_natural_scale_mean_sd)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This is a placeholder discussion for me writing about all the existing functions in the package. For each function I'll write whether I think we should keep it, and whether I see that there is an alternative better way to implement the functionality given the package redesign.
I will ping people when I am finished and ready to discuss this.
Status:
Simulation
I do find simulation functions to be useful as a developer (including e.g. to simulate data for a vignette or test), but am unsure that "running a simulation study" is a part of the core functionality of the package. Perhaps it is for more advanced users who might want to know what kind of biases they can expect for their observation process.
simulate_double_censored_pmf()
Simulate a censored PMF. Unsure exactly what this is doing. I like that you can put in any distribution for
rprimary
andrdelay
. I don't know why there is a restriction to specifyalpha
andbeta
: suggests restriction to gamma distributions? Can we generalise here? Also how does it fit in with the below? Directing simulating the delay distribution rather than the case data?Simulation of case data
So these three functions I think are all simulating case data in the same output format (a
data.table
with columns forcase
andptime
). Can we make these into one function with an argument for the type of simulated case data? Seems to be good to me to do that and probably not hard. Simplest is justdistribution %in% c("exponential", "uniform", "gillespie")
. (Maybe "Gillespie" isn't really a distribution like the others and we need whatever distribution it produces.)simulate_secondary()
Simulate secondary events based on a delay distribution. So I think this is a good complement to the simulation of case data and makes sense. Perhaps in that vein we should have
simulate_primary
above.Preprocess
calculate_censor_delay()
Calculate the mean difference between continuous and discrete event time.
truncated_obs
as input. What's that? Observations with right truncation?combine_obs()
Combine truncated and fully observed observations
truncated_obs
andobs
(appending a new column asobs_at
)construct_cases_by_obs_window()
Construct case counts by observation window based on secondary observations
event_to_incidence()
Convert from event based to incidence based data.
linelist_to_counts()
For a target variable convert from individual data to counts. I found that
linelist_to_counts(sim_obs)
works. What'starget_time
? The time that the counts should correspond to?pad_zeros
is whether there should be a row with zero cases if there are no cases? Need to tryadditional_by
argument.Needs to be documented and add unit tests. Possible unit tests:
time
andcases
columnstime
increasing monotonicallylinelist_to_cases()
I found that
linelist_to_counts(sim_obs)
works.reverse_obs_at()
For the observation observed at variable reverse the factor ordering
Observe
S3 generics
Should be kept.
Method default
Should be kept.
Latent individual model
Should be kept. (Perhaps reorganise these 3 sections [S3 generics, Method default, Latent individual model] see issue #162.)
Postprocess
add_natural_scale_mean_sd()
meanlog
andsdlog
parameters to "natural scale"mean
andsd
parameterscorrect_primary_censoring_bias()
draws
, alters the mean by removing a random number in zero one (I guess this is supposing that the censoring interval is of length 1, but what about the two censoring windows?)meanlog
andsdlog
parameters (the inverse ofadd_natural_scale_mean_sd
)correct_primary_censoring_bias
#168draws_to_long()
meanlog
sdlog
mean
andsd
extract_lognormal_draws()
epidist_family
make_relative_to_truth()
sample_model()
epidist
. Added an issue for this: Transfer functionality ofsample_model
toepidist::epidist
#163.summarise_draws() and summarise_variable()
Plot
Data
We should keep this.
Utility functions
Beta Was this translation helpful? Give feedback.
All reactions