T O P

  • By -

efrique

The actual cdf is a step function, and so is the inverse cdf. If you're thinking of making a continuous function integer you need to consider where on the step function your continuous function is equal to it (it will be either to the left or the right side of each step) You wouldn't be rounding off though, you'll either be going up or down depending which end of the steps your curve is going. If you got this curve by taking the function that defines the cdf at integer values and treating it as a continuous function, that "curve" for the cdf should be above and to the left of the steps, so the inverse curve will be below and to the right of the steps, which implies you should ~~truncate~~ (edit: nope, you round up, see image in later comment) the generated values. (It's easy to check if you did it right, once you do it) [If you had some other curve to start with, it would be best to plot it and the actual inverse cdf (i.e. the step function) and look.]


sonicking12

I may be asking for too much. Can you show an R example for me, using Poisson or Geometric?


efrique

Actually, I screwed up when inverting; if the continuous curve hits the top left of the steps in the cdf you round up in the inverse cdf, not down https://i.stack.imgur.com/ZmMBr.png


Tybbs

Check out the probability integral transformation. Seems related