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? Kind regards, Serge
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) (aside: for distributions with multiple modes the minimum length confidence region in 1d might be non-overlapping intervals.) What would be the best to find a confidence region in the multivariate case ? recipes, example code and/or pull request would be useful for future users. Josef
Kind regards,
Serge
_______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
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
On Thu, Aug 30, 2012 at 12:35 PM, Robert Kern <robert.kern@gmail.com> wrote:
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.
good idea, or even with a linear interpolation of the inverse empirical cdf, which might already be in statsmodels. Josef
-- Robert Kern _______________________________________________ SciPy-User mailing list SciPy-User@scipy.org http://mail.scipy.org/mailman/listinfo/scipy-user
participants (3)
-
josef.pktd@gmail.com -
Robert Kern -
Serge Rogov