You are on page 1of 5

CS2B: Poisson processes – Summary Page 1

Poisson processes

Summary
Syllabus objectives
3.3 Define and apply a Markov process

3.3.2 Define a Poisson process, derive the distribution of the number of events in a
given time interval, derive the distribution of inter-event times, and apply
these results.

The Actuarial Education Company © IFE: 2020 Examinations


Page 2 CS2B: Poisson processes – Summary

0 Introduction
In this document we provide a summary of the key techniques you have learned throughout this
section.

We advise you to keep this close by so that you can refer back to it throughout your study.

© IFE: 2020 Examinations The Actuarial Education Company


CS2B: Poisson processes – Summary Page 3

1 Summary
This summary assumes that dates are given in the first column of your data.

Data files
To find your working directory:

getwd()

To set your working directory:

setwd("c:\\Temp")

Reading data files


To tell R to read the dates in the format day/month/year:

claims$claim.date <- as.Date(claims$claim.date, format("%d/%m/%Y"))

To see our table of data:

claims

Summarising data
To see just the first few rows:

head(claims)

To find out the number of rows:

nrow(claims)

To see the sixth row:

claims[6,]

To see the entry in the first column of the sixth row:

claims[6,1]

Manipulating dates
To convert dates into an integer number of days:

as.numeric(claims[6,1])

To get the difference in days between consecutive dates:

diff(as.numeric(claims[,1]))

The Actuarial Education Company © IFE: 2020 Examinations


Page 4 CS2B: Poisson processes – Summary

Combining values
To create vectors of data:

c(NA,diff(as.numeric(claims[,1])))

To add this as a new column in our table:

claims <- cbind(claims,c(NA,diff(as.numeric(claims[,1]))))

To rename a column (in this case the fourth column):

colnames(claims)[4] <- "Diff"

Or, if claims is a data frame and not a matrix, add a new column and name it all in one step:

claims$Diff <- c(NA,diff(as.numeric(claims[,1])))

Fitting a Poisson process to the data


To fit the mean of an exponential distribution to the expected waiting times from the data (if the
waiting times are in rows 2 onwards of column 4):

mean.time = mean(claims[,4][2:length(claims$Diff)])

The fitted Poisson parameter is the reciprocal of this:

Poiss.param = 1/mean.time

Subdividing the data


To subdivide the data into types:

motor <- claims[claims$claim.type=="Motor",]


house <- claims[claims$claim.type=="House",]

Thinning a Poisson process


To ‘thin’ a Poisson parameter:

proportion.motor = length(motor[,4])/length(claims[,4])
Poiss.param.motor = Poiss.param*proportion.motor

© IFE: 2020 Examinations The Actuarial Education Company


CS2B: Poisson processes – Summary Page 5

Fitting a gamma distribution to the claim amounts


X j ~ Ga  ,  

E  X j     and var  X j     2

  E  X j  var  X j  and    E  X j 

If claims are in column 2, then:

mean.amount = mean(claims$claim.amount)
sd.amount = sqrt(var(claims$claim.amount))
mean.amount
sd.amount
beta = mean.amount/sd.amount^2
alpha = beta*mean.amount

The Actuarial Education Company © IFE: 2020 Examinations

You might also like