示例#1
0
print(budget_bundle.good_y == budget_endowment.good_y)
print(budget_bundle.income == budget_endowment.income)
print(budget_bundle.x_lim == budget_endowment.x_lim)
print(budget_bundle.y_lim == budget_endowment.y_lim)

budget = budget_endowment

budget.show_plot()

# net buyer of good 1:
cb_utility = CobbDouglas(.7, .3)
my_person.utility = cb_utility
my_person.income = endowment_value
my_person.budget = budget
my_person.premium = good_1.price
my_person.get_consumption(p1=good_1.price, p2=good_2.price)
my_person.get_consumption_figure()
my_person.show_consumption()
print(my_person.optimal_bundle)

# if price of good 1 decreases, person must remain a net buyer:

good_1.price = .5
endowment_value = 5 * good_1.price + 5 * good_2.price
my_person.income = endowment_value

budget = Budget(good_x=good_1, good_y=good_2, income=endowment_value)
my_person.budget = budget
my_person.premium = good_1.price
my_person.get_consumption(p1=good_1.price, p2=good_2.price)
my_person.get_consumption_figure()
示例#2
0
company_1 = Insurer(4000000, 'company_1')
company_1_formula = 'severity ~ age_class + profession + health_status + education_level'

rayon.place_business(pricing_date, company_1)

ahura.smite(pricing_date + dt.timedelta(days=1))

company_1.price_book(company_1_formula)

rayon.place_business(pricing_date, company_1)

my_person = Person(person_id=1)
my_person.get_policy_history()
my_person.get_policy('company_1', 1001)
my_person.get_budget()
my_person.get_consumption()
my_person.get_consumption_figure()

fig = my_person.consumption_figure

fig['layout'].update({
    'title_x': 0.5,
    'width': 1200,
    'height': 627,
    'margin': {
        'l': 10
    }
})

plot(fig)