예제 #1
0
 def function(self, simulation, period):
     rfr = simulation.calculate('rfr', period)
     weight_foyers = simulation.calculate('weight_foyers', period)
     champm_foyers_fiscaux = simulation.calculate('champm_foyers_fiscaux', period)
     labels = arange(1, 11)
     # Alternative method
     # method = 2
     # decile, values = mark_weighted_percentiles(niveau_de_vie, labels, pondmen, method, return_quantiles = True)
     decile, values = weighted_quantiles(rfr, labels, weight_foyers * champm_foyers_fiscaux, return_quantiles = True)
     return period, decile
예제 #2
0
 def formula(foyer_fiscal, period):
     rfr = foyer_fiscal('rfr', period)
     weight_foyers = foyer_fiscal('weight_foyers', period)
     menage_ordinaire_foyers_fiscaux = foyer_fiscal('menage_ordinaire_foyers_fiscaux', period)
     labels = arange(1, 11)
     # Alternative method
     # method = 2
     # decile, values = mark_weighted_percentiles(niveau_de_vie, labels, pondmen, method, return_quantiles = True)
     decile, values = weighted_quantiles(rfr, labels, weight_foyers * menage_ordinaire_foyers_fiscaux, return_quantiles = True)
     return decile
예제 #3
0
 def formula(foyer_fiscal, period):
     rfr = foyer_fiscal('rfr', period)
     weight_foyers = foyer_fiscal('weight_foyers', period)
     menage_ordinaire_foyers_fiscaux = foyer_fiscal(
         'menage_ordinaire_foyers_fiscaux', period)
     labels = arange(1, 101)
     centile, values = weighted_quantiles(rfr,
                                          labels,
                                          weight_foyers *
                                          menage_ordinaire_foyers_fiscaux,
                                          return_quantiles=True)
     return centile
예제 #4
0
 def function(self, simulation, period):
     rfr = simulation.calculate('rfr', period)
     weight_foyers = simulation.calculate('weight_foyers', period)
     champm_foyers_fiscaux = simulation.calculate('champm_foyers_fiscaux',
                                                  period)
     labels = arange(1, 11)
     # Alternative method
     # method = 2
     # decile, values = mark_weighted_percentiles(niveau_de_vie, labels, pondmen, method, return_quantiles = True)
     decile, values = weighted_quantiles(rfr,
                                         labels,
                                         weight_foyers *
                                         champm_foyers_fiscaux,
                                         return_quantiles=True)
     return period, decile
예제 #5
0
 def formula(foyer_fiscal, period):
     rfr = foyer_fiscal('rfr', period)
     weight_foyers = foyer_fiscal('weight_foyers', period)
     menage_ordinaire_foyers_fiscaux = foyer_fiscal(
         'menage_ordinaire_foyers_fiscaux', period)
     labels = arange(1, 11)
     # Alternative method
     # method = 2
     # decile, values = mark_weighted_percentiles(niveau_de_vie, labels, pondmen, method, return_quantiles = True)
     decile, values = weighted_quantiles(rfr,
                                         labels,
                                         weight_foyers *
                                         menage_ordinaire_foyers_fiscaux,
                                         return_quantiles=True)
     return decile
예제 #6
0
 def function(self, simulation, period):
     rfr = simulation.calculate('rfr', period)
     nbptr = simulation.calculate('nbptr', period)
     weight_foyers = simulation.calculate('weight_foyers', period)
     champm_foyers_fiscaux = simulation.calculate('champm_foyers_fiscaux', period)
     salaire_imposable = simulation.calculate('salaire_imposable', period)
     labels = arange(1, 11)
     # Alternative method
     # method = 2
     # decile, values = mark_weighted_percentiles(niveau_de_vie, labels, pondmen, method, return_quantiles = True)
     decile, values = weighted_quantiles(rfr / nbptr, labels, weight_foyers * champm_foyers_fiscaux, return_quantiles = True)
     print values
     print (weight_foyers * champm_foyers_fiscaux * rfr / nbptr).sum()
     print weight_foyers.sum()
     print champm_foyers_fiscaux.sum()
     print (weight_foyers * champm_foyers_fiscaux).sum()
     print 'salaire_imposable', salaire_imposable.sum()
     return period, decile
예제 #7
0
 def function(self, simulation, period):
     rfr = simulation.calculate('rfr', period)
     nbptr = simulation.calculate('nbptr', period)
     weight_foyers = simulation.calculate('weight_foyers', period)
     champm_foyers_fiscaux = simulation.calculate('champm_foyers_fiscaux',
                                                  period)
     salaire_imposable = simulation.calculate('salaire_imposable', period)
     labels = arange(1, 11)
     # Alternative method
     # method = 2
     # decile, values = mark_weighted_percentiles(niveau_de_vie, labels, pondmen, method, return_quantiles = True)
     decile, values = weighted_quantiles(rfr / nbptr,
                                         labels,
                                         weight_foyers *
                                         champm_foyers_fiscaux,
                                         return_quantiles=True)
     print values
     print(weight_foyers * champm_foyers_fiscaux * rfr / nbptr).sum()
     print weight_foyers.sum()
     print champm_foyers_fiscaux.sum()
     print(weight_foyers * champm_foyers_fiscaux).sum()
     print 'salaire_imposable', salaire_imposable.sum()
     return period, decile