metrumresearchgroup/example-models

Restructure example scripts and folders

Opened this issue · 3 comments

I propose to implement the following changes to the examples:

  • Organize the files of each example to be more self-contained within their respective folders rather than spread between the example folder and the R folder
  • Move tools folder containing the shared function scripts to the top level of example-models.
  • Revise stanTools.R functions to use the bayesplot package.
  • Modify the "driver" R scripts for each example to use either CmdStan or RStan depending on the value of a logical set by the user.

In branch issue-15-restruct I pushed a revised version of the TwoCptModel example. Comments welcome about extending this approach to the remaining example---or changing it.

Hi Bill,
this is all sounds good to me. I would consider grouping models which work on the same data, but use a different method. For example, two Cpt can be specified with an analytical, a matrix exp, and a numerical solution. Similarly, the FK model can be fitted with a numerical integrator or with a mixed solver.

This means having more than one model in the directory. The other files remain unchanged. In the R script, the user can specify which model they use.

It's a good layout. Every model should be orthogonal to the others, so that it can be shipped and reproduced separately.