Risk factor model interface with mean adjustment by sex and age.
More...
#include <risk_factor_adjustable_model.h>
|
| | RiskFactorAdjustableModel (std::shared_ptr< RiskFactorSexAgeTable > expected, std::shared_ptr< std::unordered_map< core::Identifier, double > > expected_trend, std::shared_ptr< std::unordered_map< core::Identifier, int > > trend_steps, TrendType trend_type=TrendType::Null, std::shared_ptr< std::unordered_map< core::Identifier, double > > expected_income_trend=nullptr, std::shared_ptr< std::unordered_map< core::Identifier, double > > expected_income_trend_decay_factors=nullptr) |
| | Constructs a new RiskFactorAdjustableModel instance.
|
| |
| virtual double | get_expected (RuntimeContext &context, core::Gender sex, int age, const core::Identifier &factor, OptionalRange range, bool apply_trend) const |
| | Gets a person's expected risk factor value.
|
| |
| void | adjust_risk_factors (RuntimeContext &context, const std::vector< core::Identifier > &factors, OptionalRanges ranges, bool apply_trend, const RiskFactorSexAgeTable *expected_override=nullptr, std::optional< std::size_t > income_stratum_filter=std::nullopt, std::vector< IncomeStratumAdjustmentExampleRow > *debug_example_rows=nullptr) const |
| | Adjust risk factors such that mean sim value matches expected value.
|
| |
| int | get_trend_steps (const core::Identifier &factor) const |
| | Gets the number of time steps to apply the trend.
|
| |
| const std::shared_ptr< std::unordered_map< core::Identifier, double > > & | get_expected_trend () const noexcept |
| | Gets the expected trend values.
|
| |
| void | set_logistic_factors (const std::unordered_set< core::Identifier > &logistic_factors) |
| | Sets the logistic factors for simulated mean calculation.
|
| |
| virtual | ~RiskFactorModel ()=default |
| | Destroys a RiskFactorModel instance.
|
| |
| virtual RiskFactorModelType | type () const noexcept=0 |
| | Gets the model type identifier.
|
| |
| virtual std::string | name () const noexcept=0 |
| | Gets the model name.
|
| |
| virtual void | generate_risk_factors (RuntimeContext &context)=0 |
| | Generates the initial risk factors for a population and newborns.
|
| |
| virtual void | update_risk_factors (RuntimeContext &context)=0 |
| | Update risk factors for population.
|
| |
Risk factor model interface with mean adjustment by sex and age.
◆ RiskFactorAdjustableModel()
Constructs a new RiskFactorAdjustableModel instance.
- Parameters
-
| expected | The risk factor expected values by sex and age |
| expected_trend | The expected trend of risk factor values (for UPF trends) |
| trend_steps | The number of time steps to apply the trend (for UPF trends) |
| trend_type | The type of trend to apply to factors mean adjustment |
| expected_income_trend | The expected income trend of risk factor values |
| expected_income_trend_decay_factors | The exponential decay factors for income trends |
◆ adjust_risk_factors()
Adjust risk factors such that mean sim value matches expected value.
- Parameters
-
| context | The simulation run-time context |
| factors | A list of risk factors to be adjusted |
| ranges | An optional list of risk factor value boundaries |
| apply_trend | Whether to apply expected value time trend |
◆ get_expected()
Gets a person's expected risk factor value.
- Parameters
-
| context | The simulation run-time context |
| sex | The sex key to get the expected value |
| age | The age key to get the expected value |
| factor | The risk factor to get the expected value |
| range | An optional expected value range |
| apply_trend | Whether to apply expected value time trend |
- Returns
- The person's expected risk factor value
◆ get_expected_trend()
| const std::shared_ptr< std::unordered_map< core::Identifier, double > > & hgps::RiskFactorAdjustableModel::get_expected_trend |
( |
| ) |
const |
|
inlinenoexcept |
Gets the expected trend values.
- Returns
- The expected trend values
◆ get_trend_steps()
| int hgps::RiskFactorAdjustableModel::get_trend_steps |
( |
const core::Identifier & |
factor | ) |
const |
Gets the number of time steps to apply the trend.
- Parameters
-
| factor | The risk factor to get the trend steps |
- Returns
- The number of time steps to apply the trend
◆ set_logistic_factors()
| void hgps::RiskFactorAdjustableModel::set_logistic_factors |
( |
const std::unordered_set< core::Identifier > & |
logistic_factors | ) |
|
Sets the logistic factors for simulated mean calculation.
- Parameters
-
| logistic_factors | Set of factors that have logistic models |
The documentation for this class was generated from the following files: