10#include <unordered_map>
28 static constexpr double missing = std::numeric_limits<double>::quiet_NaN();
54 void set_coefficients(std::unordered_map<
int, std::vector<FactorTerm>> by_category);
55 void set_recode(std::array<int, category_count + 1> detailed_to_cat4);
58 bool has_recode() const noexcept {
return recode_loaded_; }
62 int education_id)
const;
70 const Assignment ¤t,
Random &rng)
const;
75 int recode(
int employment_id)
const;
79 static double factor_value(
const std::string &factor,
const AgeFactors &age_f,
int gender,
83 Assignment assign_draw(
unsigned int age,
core::Gender gender,
int education_id,
85 static int draw_category(
const std::array<double, category_count> &probs,
Random &rng);
87 std::unordered_map<int, std::vector<FactorTerm>> coefficients_;
89 std::array<int, category_count + 1> recode_{};
90 bool recode_loaded_{
false};
Definition jacardi_employment_static.h:26
bool has_recode() const noexcept
Definition jacardi_employment_static.h:58
Assignment initialise(unsigned int age, core::Gender gender, int education_id, Random &rng) const
Part A — missing 0..18; else SCORE → DRAW → recode.
Definition jacardi_employment_static.cpp:232
static constexpr int age_cap
Definition jacardi_employment_static.h:31
static AgeFactors compute_age_factors(int age_capped)
Definition jacardi_employment_static.cpp:113
std::array< double, category_count > score_probabilities(unsigned int age, core::Gender gender, int education_id) const
Softmax probabilities p_1..p_6 for SCORE checks (indices 0..5 = categories 1..6).
Definition jacardi_employment_static.cpp:152
void set_coefficients(std::unordered_map< int, std::vector< FactorTerm > > by_category)
Definition jacardi_employment_static.cpp:93
static constexpr unsigned int age_missing_max
Definition jacardi_employment_static.h:29
static constexpr int category_max
Definition jacardi_employment_static.h:34
static double factor_value(const std::string &factor, const AgeFactors &age_f, int gender, int education_id)
Definition jacardi_employment_static.cpp:131
static constexpr unsigned int age_assign_min
Definition jacardi_employment_static.h:30
int recode(int employment_id) const
Definition jacardi_employment_static.cpp:211
static constexpr int category_min
Definition jacardi_employment_static.h:33
static constexpr int category_count
Definition jacardi_employment_static.h:32
static int gender_code(core::Gender gender)
Definition jacardi_employment_static.cpp:103
static constexpr double missing
Definition jacardi_employment_static.h:28
void set_recode(std::array< int, category_count+1 > detailed_to_cat4)
Definition jacardi_employment_static.cpp:98
Assignment update(unsigned int age, core::Gender gender, int education_id, const Assignment ¤t, Random &rng) const
Part B — missing under 19; first assign if still missing at 19+; else hold (temporary).
Definition jacardi_employment_static.cpp:244
bool has_coefficients() const noexcept
Definition jacardi_employment_static.h:57
static Assignment hold(const Assignment ¤t) noexcept
MAHIMA: Isolated hold — yearly package replaces this path only.
Definition jacardi_employment_static.h:73
General purpose Random number generator algorithms.
Definition random_algorithm.h:8
Gender
Enumerates gender types.
Definition forward_type.h:18
Top-level namespace for Health-GPS Console host application.
Definition command_options.cpp:9
bool person_has_employment(const Person &person)
Definition jacardi_employment_static.cpp:274
EmploymentStaticTables::Assignment get_person_employment(const Person &person)
Definition jacardi_employment_static.cpp:261
void set_person_employment(Person &person, const EmploymentStaticTables::Assignment &assignment)
Definition jacardi_employment_static.cpp:256
Age-only predictors (precomputed for 19..80).
Definition jacardi_employment_static.h:48
double school_fade
Definition jacardi_employment_static.h:51
std::array< double, 5 > age_rcs
Definition jacardi_employment_static.h:50
double age
Definition jacardi_employment_static.h:49
Drawn detailed id + recoded 4-cat id (both NaN when missing).
Definition jacardi_employment_static.h:42
double cat4_id
Definition jacardi_employment_static.h:44
double detailed_id
Definition jacardi_employment_static.h:43
Definition jacardi_employment_static.h:36
double coefficient
Definition jacardi_employment_static.h:38
std::string factor
Definition jacardi_employment_static.h:37
Defines a virtual population person data type.
Definition person.h:39