lmoffatt / macro_dr

GNU General Public License v3.0
1 stars 1 forks source link

Discuss the general architecture of an static rstan-like macro_dr #161

Open lmoffatt opened 7 months ago

lmoffatt commented 7 months ago

This would start as a completely c++ project.

The modularization should be done by main only including the necessary files.

Each macro_dr optimization results in a different executable.

Should the name be different? well, if it resides in a different directory, that would not be necessary.

So, the identity of the optimization is given by the name of the directory plus some configuration files (that include the commit hash).

In this sense we can follow the lead of cache2 that generates its own main based on the different tests. But, no. The idea would be that the main says which optimization of the many possible would be run.

Each model would be defined in its own modelxxx.h file

Each experiment also would be defined in its own experimentxxx.h file

each optimization would also be defined in its own optimizationxxx.h file (which in turn would call the models and experiments it needs).

Lets think for a moment how much change in the structure of macro_dr a change to a static rstan like would mean:

  1. We would have to change main.

main would still gather some data from the command line: where to get the data and the priors for the used models. Also some variables that fine tune the optimization.

The serialization is strange: the only way to serialize templated classes is to save it as c++ code.