Message Boards Message Boards

Plot full support of a distribution using DistributionChart[]

I am having some issues employing DistributionChart[], I think due to kernel smoothing. As a simple example, imagine I want to plot the following truncated distribution:

DistributionChart[
 Table[RandomVariate[
   TruncatedDistribution[{0.00, 0.05}, 
    NormalDistribution[0.025, 0.0025]]], {i, 1, 100}], 
 BarSpacing -> 0, ChartBaseStyle -> EdgeForm[None], 
 ChartElementFunction -> "Density", ChartStyle -> Darker[Red], 
 Frame -> True, PerformanceGoal -> "Quality", 
 PlotRange -> {0.00, 0.05}]

The support of this function has been defined as the interval {0.00,0.05}. However, as the standard deviation is low, most values are concentrated around the mean of the distribution, and the plot looks like there are no possible values out of a certain more limited range.

Is there any way I can obtain a representation of the density of the full support range? I am interested in using DistributionChart[] for my application.

Thanks in advance for any help!

2 Replies

The chart is showing the density of the sampled points, not the underlying distribution. You are only sampling 100, so there are essentially zero values from the long tails. That's why the plot doesn't include them. But even if you sample 10,000 points, you don't do much better with that small standard deviation.

Why don't you just show the underlying distribution instead? There's not an easy equivalent of Distribution Chart that takes a symbolic distribution, but you could use DensityPlot to achieve the same thing.

DensityPlot[f[y], {x, 0.4, 0.6}, {y, 0.0, 0.05}, 
 PlotRange -> {{0, 1}, All, All}, PlotPoints -> 50, 
 ColorFunction -> (ColorData["ValentineTones"][1 - #] &)]
POSTED BY: Gareth Russell

Thanks! It is a really good idea

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