# How to create an insurance premium pricing model using Linear Regression, Python and Jupyter

## Introduction

This article is about computation of cattle insurance premium for financial losses of farmers due to Tiger attacks in the Corbett Reserve National Park. These types of calculations are basic for an insurance company to price the products optimally.

As per the given business problem, there are various villages where farmers are suffering from livestock/cattle losses due to tiger attacks. Therefore, they plan to insure themselves through an insurance for their cattle in order to minimize the financial loss.  Being an actuarial aspirant and data science lover, I have tried to calculate the amount which is required to purchase the insurance. I have used Python and Jupyter for this project.

The data can be dowloaded from Data File, Model and Sights.

In this Article, we learn to calculate premium for the financial losses of Farmers due to tiger attacks using Python language. It includes several steps of coding.

1. Import Libraries
2. Import Datasets
1. Data
2. Model (probability of killing)
3. Sights
3. Build Regression Model (Intercept and Coefficient)
4. Predict the Probabilities
5. Calculate the Expected Loss
6. Graph of Expected Loss

### Import Libraries

• Open Jupiter notebook in Anaconda Navigator
• Import libraries

• Data
• Model
• Sights

### Build Regression Model

Now, we build the regression model.
Where “a” represent the intercept and “b” denotes the coefficient.

### Predict the Probabilities

After computing the linear regression model we use these values to predict the probabilities in dataset SIGHTS, where we define our own function to predict the Probability.

### Calculate the Expected Loss

Using probabilities and data we compute the figure of expected loss

### Graph of Expected Loss

Finally, we compute the premium, it involves two calculations:

• Consolidated Expected Present Value

Where B is the consolidated EPV of losses and P is the premium.

#### Consolidated Expected Present Value  