6. Rating algorithm parts 1 & 2 Flashcards

1
Q

Where does the pricing algorithm sit in the model?

A

The pricing algorithm in hx Renew is written in Python and the rating.py file controls how the model will recalculate values when in use.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you get parameters in the rating algorithm?

A
  • Add the following line after import hx
    from algorithms.json_parameter_files.parameters import get_parameters
  • Then e.g.
    industries = get_parameters(‘industry.json’)
    We can then reference this value like so:
    hxd.model_base_rate.calculated = industries[hxd.industry]
  • hxd. stands for hx data and is the way to access any of the variables defined in your data schema.
  • In order to get a value for the key we use the syntax dictionary_name[hxd.key]
  • When assigning to the model base rate, we have used the syntax .calculated. This is because we set the model base rate to be an override.
  • With overrides you can also use .selected. If the value has been overwritten by the user, this will equal the value they have provided, if not it will be equal to the calculated value. This allows the overwritten value to flow through to other calculations that may depend on it
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How do you access children of a structure?

A

hxd.structure_name.child_name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do you access data from a csv for use in the ratings algorithm?

A
  • Instead of reading and saving the data into a dictionary, we will store it in a pandas DataFrame. The syntax hx.params is used followed by the table name. This will read the table and store it in a pandas DataFrame, which can then be accessed and manipulated. e.g.
    sor_table = hx.params.size_of_risk
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How do you get the last value from a list?

A

lookup_value][column_to_return].iloc[-1]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Riebesell function?

A

The Riebesell function is a commonly used curve for calculating increased limit factors (ILFs) in the absence of reliable claims data. Given a calibrated base limit and constant factor (z), we can use Riebesell ILFs to price higher levels of insurance coverage beyond the base limit. x is the limit to evaluate the ilf at.
def riebesell(riebesell_base_limit, riebesell_z, limit):

ilf = (limit / riebesell_base_limit) ** math.log(1 + riebesell_z, 2)

return ilf
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How might you use a for loop to calculate sections for each layer?

A

for layer in hxd.layers:
ilf_attach = riebesell(riebesell_base_limit, riebesell_z, layer.excess)
ilf_exhaust = riebesell(riebesell_base_limit, riebesell_z, layer.limit + layer.excess)
layer.ilf = ilf_exhaust - ilf_attach

    Calculated Premium
    layer.calculated_premium = hxd.technical_premium * layer.ilf

    #ULR
    if layer.calculated_premium is not None and layer.charged_premium is not None and layer.calculated_premium >0 and layer.charged_premium >0:
        layer.ulr = base_model_ulr * layer.calculated_premium / layer.charged_premium
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the ILF attachment point?

A

ilf_attach = riebesell(riebesell_base_limit, riebesell_z, layer.excess)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the ILF exhaust point?

A

ilf_exhaust = riebesell(riebesell_base_limit, riebesell_z, layer.limit + layer.excess)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do you calculate totals for layers?

A
  • To calculate the totals, you are going to use list comprehensions, which is a concise way of looping through an iterable and returning a list.
  • List comprehension syntax is:
    [expression for item in list if conditional]
    For example:
    hxd.layer_totals.calculated_premium = sum([layer.calculated_premium for layer in hxd.layers if layer.calculated_premium is not None and layer.selected])
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the hx_core values that the ratings algorithm needs to calculate?

A

hxd.hx_core.model_premium = hxd.layer_totals.calculated_premium
hxd.hx_core.charged_premium = hxd.layer_totals.charged_premium
hxd.hx_core.ulr = hxd.layer_totals.ulr
hxd.hx_core.premium_currency = hxd.currency

BLANK

How well did you know this?
1
Not at all
2
3
4
5
Perfectly