0

I am really new to this and I have no idea how to use the ecdf function in R. Below I have mention everything step by step:

  1. Frequency of losses is defined using a Poisson distribution
  2. Generate an ecdf function that is going to be used for the severity of losses.
  3. Linearly interpolate the ecdf function.
  4. Take inverse transform of the linearly interpolated ecdf function.

For example, I can use code freq <- rpois(10,5) to generate the random number of loss frequency but further I have to use this vector to do steps 2-4 and I have no idea how to do that. For step 2 I am facing the problem that how can I use that Poisson distribution as an input and then use to compute severity using the ecdf function. If anybody knows this please help me.

Wimpel
  • 26,031
  • 1
  • 20
  • 37
  • 1
    welcome to SO, please create a MRE (https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example ) of your question. – Wimpel Mar 22 '21 at 11:54
  • See help, `?ecdf` at the console. It should explain how to do what you want to do. – SteveM Mar 22 '21 at 12:50
  • my question is how can I use this frequency vector to generate an empirical distribution function? – Deepak Panchal Mar 22 '21 at 16:02

0 Answers0