Closed wlandau closed 5 months ago
I see two implementation challenges:
brms
.brms.mmrm
.To start, I am thinking about a new function brm_parameterize_successive()
for successive time differences (from https://github.com/openpharma/brms.mmrm/discussions/92). In this first attempt, it will accept:
brm_data()
objectbrm_formula()
objectAnd it will return a list of:
brms
prior on successive differencesLater, we will need to decide how to accept this output in brms_model()
and brm_marginal_draws()
in a clear, consistent, back-compatible way.
Maybe we decouple the prior from all of this and think about a consistent set of separate prior specification functions.
When I sketched https://github.com/openpharma/brms.mmrm/issues/93, I realized just how chaotic this fully manual approach would be in the interface. It is actually super disruptive if the user and the package needs to maintain two different sets of data and two different formulas.
On the other hand, #95 could be limiting because cell-means-like sdif contrasts would not be possible, and neither would many other types of models we might want to define. For example, because fixed effects are independent a priori, some users might even want to regress on principal components.
We might limit the chaos if we treat each end-to-end analysis as its own workflow which has minimal overlap with the main functions. For successive differences, we could have brm_data_sdf()
, brm_formula_sdif()
, etc.
brm_data_sdif()
could take a brm_data()
object as input. brm_formula()
and other methods could use S3 dispatch to handle specific cases.Moving the last couple comments to their own issue.
For #40, I think we are heading toward the following kind of workflow:
I will prototype this in a branch. It will be tricky because
brms.mmrm
thus far has been designed to use an ordinary data/formula and makes a lot of assumptions there.