Source code for utility_modules.calibrate_exante_latents

#!/usr/bin/env python
# -*- coding: utf-8 -*-
#PARAMETERS
import pandas as pd
import pdb
[docs]class calibrate_exante_latents(): def __init__(self,calibrate_ex_ante_variables,Latent_vars,output_calib,person_id): #all input parameters self.delta=calibrate_ex_ante_variables['delta'] self.seed=calibrate_ex_ante_variables['seed'] self.IM_range_under400=calibrate_ex_ante_variables['IM_range_under400'] self.IM_range_over400=calibrate_ex_ante_variables['IM_range_over400'] self.unins_delta=calibrate_ex_ante_variables['unins_delta'] self.unins_random=calibrate_ex_ante_variables['unins_random'] self.extra_esi_delta=calibrate_ex_ante_variables['extra_esi_delta'] self.extra_esi_latent=calibrate_ex_ante_variables['extra_esi_latent'] self.esi_crowdout_delta=calibrate_ex_ante_variables['esi_crowdout_delta'] self.extra_medicaid_delta = calibrate_ex_ante_variables['extra_medicaid_delta'] self.Latent_vars=Latent_vars self.long_calibration_table=output_calib #read in person_id of hieu_table so that the program can know the shape of output exante when there is no update_lv self.person_id=person_id #import firm_choice
[docs] def create_ex_ante_latent(self): #the case we don't have update_lv if self.Latent_vars is None: exante_latents=pd.DataFrame(data=0,index=range(0,self.person_id.shape[0]),\ columns=['c_unins','c_esi_self','c_esi_spouse','c_esi_parent_1','c_esi_parent_2','c_silver','c_bronze','c_cat','c_mcaid','c_mcare','c_unins_adj' \ 'c_esi_self_adj','c_esi_spouse_adj', 'c_esi_parent_1_adj', 'c_esi_parent_2_adj', 'c_silver_adj', 'c_bronze_adj', 'c_cat_adj', 'c_mcaid_adj','c_mcare_adj','person_id']) #create the exante_latents with all 0 but have all person_id exante_latents.person_id = self.person_id.astype(int) #Dave should add his code here #temporarily just return 0 return 0
# EXPORT TO INDIVIDUAL DATA FOLDER