Health-GPS 3.0.0.0
Global Health Policy Simulation model (Health-GPS)
Loading...
Searching...
No Matches
hgps::RiskFactorAdjustableModel Class Reference

Risk factor model interface with mean adjustment by sex and age. More...

#include <risk_factor_adjustable_model.h>

Inheritance diagram for hgps::RiskFactorAdjustableModel:
[legend]
Collaboration diagram for hgps::RiskFactorAdjustableModel:
[legend]

Public Member Functions

 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.
 
- Public Member Functions inherited from hgps::RiskFactorModel
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.
 

Detailed Description

Risk factor model interface with mean adjustment by sex and age.

Constructor & Destructor Documentation

◆ RiskFactorAdjustableModel()

hgps::RiskFactorAdjustableModel::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.

Parameters
expectedThe risk factor expected values by sex and age
expected_trendThe expected trend of risk factor values (for UPF trends)
trend_stepsThe number of time steps to apply the trend (for UPF trends)
trend_typeThe type of trend to apply to factors mean adjustment
expected_income_trendThe expected income trend of risk factor values
expected_income_trend_decay_factorsThe exponential decay factors for income trends

Member Function Documentation

◆ adjust_risk_factors()

void hgps::RiskFactorAdjustableModel::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.

Parameters
contextThe simulation run-time context
factorsA list of risk factors to be adjusted
rangesAn optional list of risk factor value boundaries
apply_trendWhether to apply expected value time trend
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_expected()

double hgps::RiskFactorAdjustableModel::get_expected ( RuntimeContext context,
core::Gender  sex,
int  age,
const core::Identifier factor,
OptionalRange  range,
bool  apply_trend 
) const
virtual

Gets a person's expected risk factor value.

Parameters
contextThe simulation run-time context
sexThe sex key to get the expected value
ageThe age key to get the expected value
factorThe risk factor to get the expected value
rangeAn optional expected value range
apply_trendWhether to apply expected value time trend
Returns
The person's expected risk factor value
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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
factorThe risk factor to get the trend steps
Returns
The number of time steps to apply the trend
Here is the caller graph for this function:

◆ 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_factorsSet of factors that have logistic models
Here is the caller graph for this function:

The documentation for this class was generated from the following files: