29 std::map<core::Identifier, FactorDynamicEquation>
male{};
32 std::map<core::Identifier, FactorDynamicEquation>
female{};
48 std::shared_ptr<RiskFactorSexAgeTable> expected,
49 std::shared_ptr<std::unordered_map<core::Identifier, double>> expected_trend,
50 std::shared_ptr<std::unordered_map<core::Identifier, int>> trend_steps,
51 const std::map<core::IntegerInterval, AgeGroupGenderEquation> &equations,
52 const std::map<core::Identifier, core::Identifier> &variables,
53 const double boundary_percentage);
57 std::string
name()
const noexcept override;
64 const std::map<core::IntegerInterval, AgeGroupGenderEquation> &equations_;
65 const std::map<core::Identifier, core::Identifier> &variables_;
66 double boundary_percentage_;
70 void update_risk_factors_exposure(
72 const std::map<core::Identifier, double> ¤t_risk_factors,
73 const std::map<core::Identifier, FactorDynamicEquation> &equations);
75 static std::map<core::Identifier, double>
78 double sample_normal_with_boundary(
Random &random,
double mean,
double standard_deviation,
79 double boundary)
const;
94 std::unique_ptr<RiskFactorSexAgeTable> expected,
95 std::unique_ptr<std::unordered_map<core::Identifier, double>> expected_trend,
96 std::unique_ptr<std::unordered_map<core::Identifier, int>> trend_steps,
97 std::map<core::IntegerInterval, AgeGroupGenderEquation> equations,
98 std::map<core::Identifier, core::Identifier> variables,
99 const double boundary_percentage = 0.05);
103 std::unique_ptr<RiskFactorModel>
create_model()
const override;
106 std::map<core::IntegerInterval, AgeGroupGenderEquation> equations_;
107 std::map<core::Identifier, core::Identifier> variables_;
108 double boundary_percentage_;
DynamicHierarchicalLinearModelDefinition(std::unique_ptr< RiskFactorSexAgeTable > expected, std::unique_ptr< std::unordered_map< core::Identifier, double > > expected_trend, std::unique_ptr< std::unordered_map< core::Identifier, int > > trend_steps, std::map< core::IntegerInterval, AgeGroupGenderEquation > equations, std::map< core::Identifier, core::Identifier > variables, const double boundary_percentage=0.05)
Initialises a new instance of the DynamicHierarchicalLinearModelDefinition class.
Definition dynamic_hierarchical_linear_model.cpp:143
std::unique_ptr< RiskFactorModel > create_model() const override
Construct a new DynamicHierarchicalLinearModel from this definition.
Definition dynamic_hierarchical_linear_model.cpp:162
std::string name() const noexcept override
Gets the model name.
Definition dynamic_hierarchical_linear_model.cpp:25
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.
Definition dynamic_hierarchical_linear_model.cpp:11
RiskFactorModelType type() const noexcept override
Gets the model type identifier.
Definition dynamic_hierarchical_linear_model.cpp:21
void update_risk_factors(RuntimeContext &context) override
Update risk factors for population.
Definition dynamic_hierarchical_linear_model.cpp:39
void generate_risk_factors(RuntimeContext &context) override
Generates the initial risk factors for a population and newborns.
Definition dynamic_hierarchical_linear_model.cpp:27
Defines the hierarchical model mapping data type.
Definition mapping.h:61
General purpose Random number generator algorithms.
Definition random_algorithm.h:8
RiskFactorAdjustableModelDefinition(std::unique_ptr< RiskFactorSexAgeTable > expected, std::unique_ptr< std::unordered_map< core::Identifier, double > > expected_trend, std::unique_ptr< std::unordered_map< core::Identifier, int > > trend_steps, TrendType trend_type=TrendType::Null)
Constructs a new RiskFactorAdjustableModelDefinition instance.
Definition risk_factor_adjustable_model.cpp:640
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.
Definition risk_factor_adjustable_model.cpp:73
Defines the Simulation runtime context data type.
Definition runtime_context.h:22
Interval< int > IntegerInterval
Interval representation integer data type.
Definition interval.h:73
Top-level namespace for Health-GPS Console host application.
Definition command_options.cpp:9
RiskFactorModelType
Health GPS risk factor module types enumeration.
Definition risk_factor_model.h:12
Define the age group dynamic equations data type.
Definition dynamic_hierarchical_linear_model.h:24
std::map< core::Identifier, FactorDynamicEquation > male
The males dynamic equations.
Definition dynamic_hierarchical_linear_model.h:29
std::map< core::Identifier, FactorDynamicEquation > female
The females dynamic equations.
Definition dynamic_hierarchical_linear_model.h:32
core::IntegerInterval age_group
The reference age group.
Definition dynamic_hierarchical_linear_model.h:26
Defines a factor linear regression equation.
Definition dynamic_hierarchical_linear_model.h:12
std::map< core::Identifier, double > coefficients
The regression model coefficients.
Definition dynamic_hierarchical_linear_model.h:17
std::string name
The factor name.
Definition dynamic_hierarchical_linear_model.h:14
double residuals_standard_deviation
The residuals standard deviation.
Definition dynamic_hierarchical_linear_model.h:20
Defines a virtual population person data type.
Definition person.h:39