Message Boards Message Boards

Control bars of "HistogramDensity" in a DistributionChart?

Hi! I would like to use DistributionChart but I do not like the fact

that the smoothed distributions it produces have a larger support then they should

(for example see the picture below, where all the input numbers lie within range $[0,1]$ - as you would expect of probability or any other normalised quantity - but the distribution, y-axis, goes visibly below 0 and above 1.)

enter image description here

Using

ChartElementFunction ->"HistogramDensity"

produces a more faithful version, with bin boundaries from $[a, b)$, which only has the problem that all ones lie in an interval $[1,1+\epsilon)$.

enter image description here

Question

(How) can I set up the number of bins of a histogram which is computed by DistributionChart:

DistributionChart[data, ChartElementFunction ->"HistogramDensity"]

Follow-up question

Which of the Histogram binning methods is used by default in DistributionChart?

POSTED BY: Jeremi Ochab
2 Replies
Posted 8 years ago

Depending on the data sometimes transforming the observations, fitting the density, and then transforming back gives appropriate results (and by definition will respect the bounded domain). See "Density Estimation for Statistics and Data Analysis" by B. W. Silverman (pages 29-32).

POSTED BY: Jim Baldwin

Thanks for the suggestion!

Transforming the data there and back is not a problem, but is there a way of transforming the density back using the DensityChart function?

POSTED BY: Jeremi Ochab
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract