bomeara / treevo

1 stars 1 forks source link

Make references to param vectors use names, rather than order of elements #22

Open dwbapst opened 6 years ago

dwbapst commented 6 years ago

Currently in TreEvo there's lots of cases where models refer to the order of elements in a params vector, e.g.

sigma<-params[1]

This is okay, if the order of params is held constant and respected by the user. It would be more ideal if we referenced elements by name instead, which would be robust to users accidentally putting params in the wrong order (but naming them correctly... it might be that if one thing goes wrong, the other thing would too, though).

sigma<-params["sigma"]

This should be relatively easy to implement, but it might reveal areas of the code where the names of the elements get removed or altered - for example, some of the operations we do to draw new parameter values from the prior. Also, all input that refers to params (technically users don't input params, typically, they input priors into doRun instead) will have to have names, rather than being ordered a special way, which will put some additional roadblocks on things.

Thus we are recording this idea for later implementation.