How can I estimate confidence bands for kernel density estimation?

20 views (last 30 days)
Hi everyone
I have a series of residuals that are supposed to be standard normally distributed. By using the ksdensity function, I obtain a smooth curve that indeed looks like a Gaussian. However, I want to construct confidence intervals (95%) around this density plot. Is there a built-in way how to achieve that? I also tried the Distribution fitting tool, which yielded a density plot but no confidence intervals.
Thank you in advance!

Answers (1)

José-Luis
José-Luis on 14 Oct 2016
You could use fitdist(), which gives you the bounds you are looking for.
  1 Comment
mr
mr on 14 Oct 2016
But how exactly do I have to proceed? Sample a sufficient number of observations and plot a histogram that depicts the pdf of the top 95% observations?

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!