Quantcast
Viewing all articles
Browse latest Browse all 14011

sampling from a custom empirical cdf

I have a CDF which I have defined:

cdf = pd.DataFrame.from_dict({'x':[10e6,20e6,50e6,100e6,250e6],'cdf':[0.4,0.6,0.7,0.8,1]})

I want to draw 10,000 samples from this cdf by two methods:

  1. Directly using the cdf without any smoothing
  2. Directly using the cdf but smoothing between points (e.g. using a spline)

I can probably do

  1. by hand by sampling from a uniform distribution but I'm not sure how to do
  2. manually.

Is there any package that can help with sampling from a given CDF?


Viewing all articles
Browse latest Browse all 14011

Trending Articles