Skip to content

Commit f933799

Browse files
committed
insurancesimulation: Simplify riskmodel_config input
1 parent d225adc commit f933799

File tree

2 files changed

+14
-23
lines changed

2 files changed

+14
-23
lines changed

agents/metainsuranceorg.py

+1-11
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,7 @@ def init(self, simulation_parameters, agent_parameters):
5555
self.cash_last_periods = list(np.zeros(4, dtype=int)*self.cash)
5656

5757
rm_config = agent_parameters['riskmodel_config']
58-
self.riskmodel = RiskModel(damage_distribution=rm_config["damage_distribution"], \
59-
expire_immediately=rm_config["expire_immediately"], \
60-
cat_separation_distribution=rm_config["cat_separation_distribution"], \
61-
norm_premium=rm_config["norm_premium"], \
62-
category_number=rm_config["no_categories"], \
63-
init_average_exposure=rm_config["risk_value_mean"], \
64-
init_average_risk_factor=rm_config["risk_factor_mean"], \
65-
init_profit_estimate=rm_config["norm_profit_markup"], \
66-
margin_of_safety=rm_config["margin_of_safety"], \
67-
var_tail_prob=rm_config["var_tail_prob"], \
68-
inaccuracy=rm_config["inaccuracy_by_categ"])
58+
self.riskmodel = RiskModel(**rm_config)
6959

7060
self.category_reinsurance = [None for i in range(self.simulation_no_risk_categories)]
7161
if self.simulation_reinsurance_type == 'non-proportional':

insurancesimulation.py

+13-12
Original file line numberDiff line numberDiff line change
@@ -123,18 +123,19 @@ def __init__(self, override_no_riskmodels, replic_ID, simulation_parameters, rc_
123123

124124
self.inaccuracy = random.sample(self.inaccuracy, self.simulation_parameters["no_riskmodels"])
125125

126-
risk_model_configurations = [{"damage_distribution": self.damage_distribution,
127-
"expire_immediately": self.simulation_parameters["expire_immediately"],
128-
"cat_separation_distribution": self.cat_separation_distribution,
129-
"norm_premium": self.norm_premium,
130-
"no_categories": self.simulation_parameters["no_categories"],
131-
"risk_value_mean": risk_value_mean,
132-
"risk_factor_mean": risk_factor_mean,
133-
"norm_profit_markup": self.simulation_parameters["norm_profit_markup"],
134-
"margin_of_safety": self.simulation_parameters["riskmodel_margin_of_safety"],
135-
"var_tail_prob": self.simulation_parameters["value_at_risk_tail_probability"],
136-
"inaccuracy_by_categ": self.inaccuracy[i]} \
137-
for i in range(self.simulation_parameters["no_riskmodels"])]
126+
risk_model_configurations = [
127+
{"damage_distribution": self.damage_distribution,
128+
"expire_immediately": self.simulation_parameters["expire_immediately"],
129+
"cat_separation_distribution": self.cat_separation_distribution,
130+
"norm_premium": self.norm_premium,
131+
"category_number": self.simulation_parameters["no_categories"],
132+
"init_average_exposure": risk_value_mean,
133+
"init_average_risk_factor": risk_factor_mean,
134+
"init_profit_estimate": self.simulation_parameters["norm_profit_markup"],
135+
"margin_of_safety": self.simulation_parameters["riskmodel_margin_of_safety"],
136+
"var_tail_prob": self.simulation_parameters["value_at_risk_tail_probability"],
137+
"inaccuracy": self.inaccuracy[i]}
138+
for i in range(self.simulation_parameters["no_riskmodels"])]
138139

139140
# prepare setting up agents (to be done from start.py)
140141
self.agent_parameters = {"insurancefirm": [], "reinsurance": []} # TODO: rename reinsurance -> reinsurancefirm (also in start.py and below in method accept_agents

0 commit comments

Comments
 (0)