def emax(self, param1, model): """ Takes given betas and estimates the emax function (en emax_dic) """ #free up memory gc.collect() #updating with new betas np.random.seed(1) #always the same emax, for a given set of beta emax_ins_1 = emax.Emaxt(param1, self.D, self.dict_grid, self.hours_p, self.hours_f, self.wr, self.cs, self.ws, model) return emax_ins_1.recursive() #t=1 to t=8
model = util.Utility(param0,N,x_w,x_m,x_k,passign,nkids0,married0,hours,childcare, agech0,hours_p,hours_f,wr,cs,ws) tracemalloc.start() ##############Computing EmaxT##################### print ('') print ('') print ('Getting a dictionary of emax') start_time = time.time() print ('') print ('') D=20 np.random.seed(2) emax_function_in=emax.Emaxt(param0,D,dict_grid,hours_p,hours_f, wr,cs,ws,model) emax_dic=emax_function_in.recursive() #8 emax (t=1 to t=8) time_emax=time.time() - start_time print ('') print ('') print ('Done with procedure in:') print("--- %s seconds ---" % (time_emax)) print ('') print ('') #########Simulating data###############