imperialCHEPI/healthgps

Fix time coefficient after 20 years

jzhu20 opened this issue · 1 comments

Feature request description

We are using an exponential time coefficient to allow time trend in nutrient intake. This time coefficient needs to be fixed after 20 years of simulation.

Describe the solution you'd like

Keep the exponential time coefficient for the first 20 years, and keep it constant from the 21st year onwards.
Based on my understanding of the code, when updating time trend, we can add a range of not exceeding 20 to elapsed_time.
https://github.com/imperialCHEPI/healthgps/blob/main/src/HealthGPS/static_linear_model.cpp#L209-L210
Then the time coefficient will be fixed after 20 years.
The same applies when expected nutrients are adjusted with time trend. https://github.com/imperialCHEPI/healthgps/blob/main/src/HealthGPS/risk_factor_adjustable_model.cpp#L45-L48
The elapsed_time can be restricted to not over 20.

Describe alternatives you've considered

NA

Additional context

NA

  • Add a config field TrendNumSteps
  • use TrendNumSteps to bound elapsed_time in StaticLinearModel::update_trends
  • use TrendNumSteps to bound elapsed_time in RiskFactorAdjustableModel::get_expected