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

Implements the dynamic hierarchical linear model type. More...

#include <dynamic_hierarchical_linear_model.h>

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

Public Member Functions

 DynamicHierarchicalLinearModel (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, const std::map< core::IntegerInterval, AgeGroupGenderEquation > &equations, const std::map< core::Identifier, core::Identifier > &variables, const double boundary_percentage)
 Initialises a new instance of the DynamicHierarchicalLinearModel class.
 
RiskFactorModelType type () const noexcept override
 Gets the model type identifier.
 
std::string name () const noexcept override
 Gets the model name.
 
void generate_risk_factors (RuntimeContext &context) override
 Generates the initial risk factors for a population and newborns.
 
void update_risk_factors (RuntimeContext &context) override
 Update risk factors for population.
 
- Public Member Functions inherited from 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.
 
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.
 

Detailed Description

Implements the dynamic hierarchical linear model type.

The dynamic model is used to advance the virtual population over time.

Constructor & Destructor Documentation

◆ DynamicHierarchicalLinearModel()

hgps::DynamicHierarchicalLinearModel::DynamicHierarchicalLinearModel ( 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,
const std::map< core::IntegerInterval, AgeGroupGenderEquation > &  equations,
const std::map< core::Identifier, core::Identifier > &  variables,
const double  boundary_percentage 
)

Initialises a new instance of the DynamicHierarchicalLinearModel class.

Parameters
expectedThe expected values
expected_trendThe expected trend of risk factor values
trend_stepsThe number of time steps to apply the trend
equationsThe linear regression equations
variablesThe factors delta variables mapping
boundary_percentageThe boundary percentage to sample

Member Function Documentation

◆ generate_risk_factors()

void hgps::DynamicHierarchicalLinearModel::generate_risk_factors ( RuntimeContext context)
overridevirtual

Generates the initial risk factors for a population and newborns.

Parameters
contextThe simulation run-time context

Implements hgps::RiskFactorModel.

Here is the call graph for this function:

◆ name()

std::string hgps::DynamicHierarchicalLinearModel::name ( ) const
overridevirtualnoexcept

Gets the model name.

Returns
The human-readable model name

Implements hgps::RiskFactorModel.

◆ type()

RiskFactorModelType hgps::DynamicHierarchicalLinearModel::type ( ) const
overridevirtualnoexcept

Gets the model type identifier.

Returns
The module type identifier

Implements hgps::RiskFactorModel.

◆ update_risk_factors()

void hgps::DynamicHierarchicalLinearModel::update_risk_factors ( RuntimeContext context)
overridevirtual

Update risk factors for population.

Parameters
contextThe simulation run-time context

Implements hgps::RiskFactorModel.

Here is the call graph for this function:

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