Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am puzzled because this toy example (in Mathematica 8)

dist = KernelMixtureDistribution[{{0, 1}, {0.0, 0}, {0, -1}},"Silverman",
                                  MaxMixtureKernels -> All];
DensityPlot[PDF[dist, {x1, x2}], {x1, -3, 3}, {x2, -3, 3}]

enter image description here

produces a density estimate with quite a large extent in x-direction although it has zero standard deviation. I would not have been surprised if that had produced an error because it should be a delta impulse in x-direction and I don't know if that can be represented by Mathematica. But this result does not make sense.

If I change it to

dist = KernelMixtureDistribution[{{0, 1}, {0.01, 0}, {0, -1}},"Silverman",
                                 MaxMixtureKernels -> All];
DensityPlot[PDF[dist, {x1, x2}], {x1, -3, 3}, {x2, -3, 3}]

enter image description here

the result is a very thin distribution as expected. The behaviour is similar for Silverman's and Scott's rules of thumb.

Can someone shed some light on how the standard deviations are interpreted here? Is this a bug maybe ?

share|improve this question
    
Thanks for your comment! I do not think it has to do with ColorFunctionScaling. My main issue is with the bandwidth of the kernels in x-direction which is nicely visible in the plot you proposed. The datapoints from which the distributions are estimated do not have a standard deviation of ~1 (in x-direction). Thus, I think the results of the automatic bandwidth selection methods are wrong here. –  Kai Petersburg Jul 30 '12 at 14:32

1 Answer 1

up vote 4 down vote accepted

The short answer is that when the standard deviation is zero it is treated as 1.

The benefit of this approach is that a single data point can be used to examine a sort of "standard" kernel.

For example:

ContourPlot[Evaluate@
    PDF[KernelMixtureDistribution[{{0, 0}}, Automatic, "Epanechnikov"],{x,y}], 
       {x, -2, 2}, {y, -2, 2}
]

enter image description here

Now whether this is the correct or desired behavior is certainly up for debate.

Keep in mind that automatic bandwidth selection is nice but after some initial exploration one can (and probably should) always set the bandwidth manually in practice based on some intuition and understanding about the data.

share|improve this answer
    
"Now whether this is the correct or desired behavior is certainly up for debate." Well, then it should at least be documented somewhere, no? Or is it? –  rm -rf Jul 30 '12 at 15:42
    
@R.M unless it were decided that this is a bug. In which case the behavior should be "fixed". –  Andy Ross Jul 30 '12 at 15:52
    
Thanks. I was hoping I could get away with automatic bandwidth selection because there are too many distributions in my data to even visualize them. Maybe I will give it a shot and implement my own Scott or Silverman method with a different treatment of 0 stddev... –  Kai Petersburg Jul 30 '12 at 16:23

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.