Learn R Programming

OpVaR (version 1.2)

fitFreqdist: Fitting the frequency distribution

Description

Fitting the frequency distribution of operational losses

Usage

fitFreqdist(cell, distr)

Arguments

cell

A data frame giving the losses (cell$Loss) and the user-defined period (cell$Period) in which the loss occured.

distr

The frequency distribution: either "pois" or "nbinom"

Value

Returns a freqdist object with the given distribution fitted to the loss frequency.

Details

First, the number of losses per period is counted. With the results a Poisson or Negative Binomial distribution is fitted for the number of losses per period using a Maximum Likelihood estimator.

See Also

To build a freqdist object independently, use buildFreqdist.

Examples

Run this code
# NOT RUN {
  data(lossdat)
  fitFreqdist(lossdat[[1]],"pois")
  fitFreqdist(lossdat[[2]],"nbinom")
# }

Run the code above in your browser using DataLab