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

Defines the static linear model data type. More...

#include <static_linear_model.h>

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

Public Member Functions

 StaticLinearModelDefinition (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::unique_ptr< std::unordered_map< core::Identifier, double > > expected_trend_boxcox, std::vector< core::Identifier > names, std::vector< LinearModelParams > models, std::vector< core::DoubleInterval > ranges, std::vector< double > lambda, std::vector< double > stddev, Eigen::MatrixXd cholesky, std::vector< LinearModelParams > policy_models, std::vector< core::DoubleInterval > policy_ranges, Eigen::MatrixXd policy_cholesky, std::unique_ptr< std::vector< LinearModelParams > > trend_models, std::unique_ptr< std::vector< core::DoubleInterval > > trend_ranges, std::unique_ptr< std::vector< double > > trend_lambda, double info_speed, std::unordered_map< core::Identifier, std::unordered_map< core::Gender, double > > rural_prevalence, std::unordered_map< core::Income, LinearModelParams > income_models, double physical_activity_stddev, TrendType trend_type=TrendType::Null, std::unique_ptr< std::unordered_map< core::Identifier, double > > expected_income_trend=nullptr, std::unique_ptr< std::unordered_map< core::Identifier, double > > expected_income_trend_boxcox=nullptr, std::unique_ptr< std::unordered_map< core::Identifier, int > > income_trend_steps=nullptr, std::unique_ptr< std::vector< LinearModelParams > > income_trend_models=nullptr, std::unique_ptr< std::vector< core::DoubleInterval > > income_trend_ranges=nullptr, std::unique_ptr< std::vector< double > > income_trend_lambda=nullptr, std::unique_ptr< std::unordered_map< core::Identifier, double > > income_trend_decay_factors=nullptr, bool is_continuous_income_model=false, const LinearModelParams &continuous_income_model=LinearModelParams{}, core::IncomeCategoryLayout income_category_layout={}, const std::unordered_map< core::Identifier, PhysicalActivityModel > &physical_activity_models={}, const std::vector< IncomeStratumExpectedTableEntry > &income_stratum_expected_tables={}, bool income_stratum_adjustment_enabled=false, std::size_t adjustment_income_stratum_count=0u, bool has_active_policies=true, std::vector< LinearModelParams > logistic_models={}, core::Gender gender2_indicator=core::Gender::male)
 Initialises a new instance of the StaticLinearModelDefinition class.
 
std::unique_ptr< RiskFactorModelcreate_model () const override
 Construct a new StaticLinearModel from this definition.
 
- Public Member Functions inherited from hgps::RiskFactorAdjustableModelDefinition
 ~RiskFactorAdjustableModelDefinition () override=default
 Destroys a RiskFactorAdjustableModelDefinition instance.
 
 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.
 
- Public Member Functions inherited from hgps::RiskFactorModelDefinition
virtual ~RiskFactorModelDefinition ()=default
 Destroys a RiskFactorModelDefinition instance.
 

Additional Inherited Members

- Protected Attributes inherited from hgps::RiskFactorAdjustableModelDefinition
std::shared_ptr< RiskFactorSexAgeTableexpected_
 
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_
 

Detailed Description

Defines the static linear model data type.

Constructor & Destructor Documentation

◆ StaticLinearModelDefinition()

hgps::StaticLinearModelDefinition::StaticLinearModelDefinition ( 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::unique_ptr< std::unordered_map< core::Identifier, double > >  expected_trend_boxcox,
std::vector< core::Identifier names,
std::vector< LinearModelParams models,
std::vector< core::DoubleInterval ranges,
std::vector< double >  lambda,
std::vector< double >  stddev,
Eigen::MatrixXd  cholesky,
std::vector< LinearModelParams policy_models,
std::vector< core::DoubleInterval policy_ranges,
Eigen::MatrixXd  policy_cholesky,
std::unique_ptr< std::vector< LinearModelParams > >  trend_models,
std::unique_ptr< std::vector< core::DoubleInterval > >  trend_ranges,
std::unique_ptr< std::vector< double > >  trend_lambda,
double  info_speed,
std::unordered_map< core::Identifier, std::unordered_map< core::Gender, double > >  rural_prevalence,
std::unordered_map< core::Income, LinearModelParams income_models,
double  physical_activity_stddev,
TrendType  trend_type = TrendType::Null,
std::unique_ptr< std::unordered_map< core::Identifier, double > >  expected_income_trend = nullptr,
std::unique_ptr< std::unordered_map< core::Identifier, double > >  expected_income_trend_boxcox = nullptr,
std::unique_ptr< std::unordered_map< core::Identifier, int > >  income_trend_steps = nullptr,
std::unique_ptr< std::vector< LinearModelParams > >  income_trend_models = nullptr,
std::unique_ptr< std::vector< core::DoubleInterval > >  income_trend_ranges = nullptr,
std::unique_ptr< std::vector< double > >  income_trend_lambda = nullptr,
std::unique_ptr< std::unordered_map< core::Identifier, double > >  income_trend_decay_factors = nullptr,
bool  is_continuous_income_model = false,
const LinearModelParams continuous_income_model = LinearModelParams{},
core::IncomeCategoryLayout  income_category_layout = {},
const std::unordered_map< core::Identifier, PhysicalActivityModel > &  physical_activity_models = {},
const std::vector< IncomeStratumExpectedTableEntry > &  income_stratum_expected_tables = {},
bool  income_stratum_adjustment_enabled = false,
std::size_t  adjustment_income_stratum_count = 0u,
bool  has_active_policies = true,
std::vector< LinearModelParams logistic_models = {},
core::Gender  gender2_indicator = core::Gender::male 
)

Initialises a new instance of the StaticLinearModelDefinition class.

Parameters
expectedThe expected risk factor values by sex and age
expected_trendThe expected trend of risk factor values
trend_stepsThe number of time steps to apply the trend
expected_trend_boxcoxThe expected boxcox factor
namesThe risk factor names
modelsThe linear models used to compute a person's risk factors
rangesThe value range of each risk factor
lambdaThe lambda values of the risk factors
stddevThe standard deviations of the risk factors
choleskyCholesky decomposition of the risk factor correlation matrix
policy_modelsThe linear models used to compute a person's intervention policies
policy_rangesThe value range of each intervention policy
policy_choleskyCholesky decomposition of the intervention policy covariance matrix
trend_modelsThe linear models used to compute a person's risk factor trends
trend_rangesThe value range of each risk factor trend
trend_lambdaThe lambda values of the risk factor trends
info_speedThe information speed of risk factor updates
rural_prevalenceRural sector prevalence for age groups and sex
income_modelsThe income models for each income category
physical_activity_stddevThe standard deviation of the physical activity
trend_typeThe type of trend to apply (Null, UPFTrend, or IncomeTrend)
expected_income_trendThe expected income trend of risk factor values
expected_income_trend_boxcoxThe expected income trend boxcox factor
income_trend_stepsThe number of time steps to apply the income trend
income_trend_modelsThe linear models used to compute income trends
income_trend_rangesThe value range of each income trend
income_trend_lambdaThe lambda values of the income trends
income_trend_decay_factorsThe exponential decay factors for income trends
is_continuous_income_modelWhether this model uses continuous income calculation (FINCH approach)
continuous_income_modelThe continuous income model parameters (if using FINCH approach)
income_category_layoutFinal income category buckets from project_requirements
Exceptions
HgpsExceptionfor invalid arguments
Parameters
logistic_models
logistic_modelsLogistic regression models for two-stage modeling (optional)

Member Function Documentation

◆ create_model()

std::unique_ptr< RiskFactorModel > hgps::StaticLinearModelDefinition::create_model ( ) const
overridevirtual

Construct a new StaticLinearModel from this definition.

Returns
A unique pointer to the new StaticLinearModel instance

Implements hgps::RiskFactorModelDefinition.


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