src¶
Submodules¶
src.CalSim¶
-
class
src.CalSim.
CalSim
(path_dict=None, policy_dict=None, params_dict=None, cal_levers_dict=None, policy_levers_dict=None, system_sheet=None, general_dict=None)[source]¶ Bases:
object
-
grow_reg_pop
(year)[source]¶ inflates the population for the simulated year self.pop0 describes population for all ages and self.pop1 for population of < 65
loop that calculates premium for ESI plans
-
src.FamilyTable¶
src.FirmChoice¶
src.FirmTable¶
src.HieuTable¶
-
class
src.HieuTable.
Hieu
(hieu_table, ind_parms=None)[source]¶ Bases:
object
-
build_long_calib_table
(expnd_choices, pop_df, firm_df, calib_flag, debug)[source]¶ - in:
expnd_choices - wide data with individual choices or utility parameters calib_flag - 1 is default choice and 2 should be all choices!
- effect:
updates self.long_calib_table with unique utility parameters per unique choice and individual
-
classmethod
esi_expand
(choice_hieu, wrk_df, pop_df, temp_firm, Curr_esi)[source]¶ choice_types are choice_types = [‘adult_1’, ‘adult_2’, ‘child_1’, ‘child_2’,’adult_child_1’, ‘adult_child_2’,’adult_child_3’, ‘adult_child_4’] corresponding to indices 0 1 2 3 4 5 6 7
- Curr_esi.columns.values=[‘index’ ‘av_value’ ‘ch’ ‘choice’ ‘contr_p_ch’ ‘contr_p_fam’ ‘contr_p_self’
‘contr_p_sp’ ‘firm_id’ ‘oop_ch’ ‘oop_ch_actual’ ‘oop_fam’ ‘oop_fam_actual’ ‘oop_self’ ‘oop_self_actual’ ‘oop_sp’ ‘oop_sp_actual’ ‘plan_id’ ‘premium_ch’ ‘premium_ch_actual’ ‘premium_fam’ ‘premium_fam_actual’ ‘premium_self’ ‘premium_self_actual’ ‘premium_sp’ ‘premium_sp_actual’ ‘pt’ ‘sp’]
the goal is to link plan_id with each policy holder, when the person is eligible for the plan
-
individual_behavior
(Curr_esi, Esi_0, xc_prem, individual_mandate, family_table, worker_table, firm_table, income_adjuster)[source]¶
-
make_pop_df
(firm, Curr_esi, family_table, worker_table)[source]¶ - Input:
firm id
current esi
family table
- Output:
worker table
pop_df: a small version of hieu_table with family income and family_size
choice_types = [‘adult_1’, ‘adult_2’, ‘child_1’, ‘child_2’, ‘adult_child_1’, ‘adult_child_2’, ‘adult_child_3’, ‘adult_child_4’]
-
static
plan_details
(final_choice_df, firm, Curr_esi, choice_types, ab_choice)[source]¶ - input: choice_table after utility
current firm of interest
- return:
number of people by plan_id and by plan_type (self, sp, ch and fam)
number of policy holders by plan_id and by plan_type (self, sp, ch and fam)
total expenditure by plan_id and by plan_type (self, sp, ch and fam)
AV value of the plans
-
src.WorkerTable¶
-
class
src.WorkerTable.
Worker
(*args, **kwargs)[source]¶ Bases:
pandas.core.frame.DataFrame
-
adjust_hours
(x, y, match)[source]¶ takes matched worker (x) and (y) and returns adjusted hours; (x) workers are between either 30 and 32.5 or 32.5 and 35; (x) workers will either receive or donate enough hours to get out of 35, weighted allowing
-
match_adjust
(x, y)[source]¶ x is the index for the workers working from either 30 to 32.5 or 32.5 to 35 y is the index for the workers working under 30 hours or above 35 df is a shallow copy (pointer) of the WorkerTable instance
-