[SciPy-User] scipy.stats.gaussian_kde ppf?

Robert Kern robert.kern@gmail....
Thu Aug 30 11:35:31 CDT 2012


On Thu, Aug 30, 2012 at 5:15 PM,  <josef.pktd@gmail.com> wrote:
> On Thu, Aug 30, 2012 at 12:41 AM, Serge Rogov <SergeRogov@minifab.com.au> wrote:
>> Hi all,
>>
>> I need to compute confidence intervals from gaussian_kde, but I found that
>> the ppf function is missing. I have implemented my own naïve version that
>> precomputes the cdf for the kde and then performs a search for the desired
>> probability, but it’s extremely slow and shows a bit of error when compared
>> to norm.ppf even at large sample sizes. Has anyone had to do something like
>> this before?
>
> I've never seen a ppf for a kde.
>
> gaussian_kde is multivariate, and I don't know if there is a
> definition of ppf for multivariate distributions.
>
> My guess is that there is nothing better than 2 rootfinding calls to
> find the confidence interval for 1d (maybe with norm.ppf as starting
> values if the distribution is approximately normal)

You can invert the empirical CDF for a nicer starting value,
regardless of distribution.

-- 
Robert Kern


More information about the SciPy-User mailing list