UCL / TLOmodel

Epidemiology modelling framework for the Thanzi la Onse project
https://www.tlomodel.org/
MIT License
10 stars 5 forks source link

LinearModels do not pick up any later changes in the parameter values that are made later #137

Open tbhallett opened 4 years ago

tbhallett commented 4 years ago

From @tamuri

One general issue I've realised: It's easy enough to tune the model parameters after registering the module with the simulation but changes might not be picked up at the point of use. For example, LinearModels are set up in read_parameters, so adjusting the parameters at a later time has no impact on the saved instance of the LinearModel.

Doesn't feel ideal. I haven't thought up a solution as yet, but this might be a more serious problem in other contexts (parameter optimisation, or imagine testing different interventions - you would need to both update the parameter and the saved linear model that uses it)

Originally posted by @tbhallett in https://github.com/UCL/TLOmodel/pull/107#issuecomment-624008909

tbhallett commented 4 years ago

When doing optimisation etc, we would be using the forthcoming run management system, which builds everything up from scratch, so it shouldn't be a big issue???

Invites bugs I suppose though, as have arisen during the testing of this module. I suppose we could have a separate def in each module for "build_linear_model", or have the LinearModels contain pointers to the parameters rather than values. Either would seem fine to me, so will leave it to you to think about @tamuri.

tamuri commented 4 years ago

When doing optimisation etc, we would be using the forthcoming run management system, which builds everything up from scratch, so it shouldn't be a big issue???

The way I thought we'd do it was indeed adjusting the properties on an existing instance. Even if it's a new instance, all the parameters are populated from the resource file (consider these 'default') and then adjustments are made on top of that. I'll think through a few ideas and get back to you.