I have a dataset like this:
data = {0,0,1.1,1.3,0,0,3.4,0,0,2.3,0,0 .....}
You can imagine that data
is generated from a probability distribution of the form:
$$p(x)=w_0\delta(x) + (1 - w_0)f(x)$$
where $f(x)$ is a smooth probability density function, $\delta$ is Dirac-delta function, and $0\le w_0 \le 1$.
That is, there is a finite probability that $x=0$.
I want to plot an histogram of data
. If I exclude 0
, then a SmoothHistogram
is fine. But now I want to include also in this plot the frequency of 0
. In this case, SmoothHistogram
performs poorly, since it tries to draw a smooth peak centered at 0.
Can you suggest a better way to visualize data
? Note that I know that the location of the singularity is at 0
.
Join[RandomVariate[NormalDistribution[2, 1], 2000], ConstantArray[0, {100}]]
? $\endgroup$0
's in random positions. Other than that, yes. $\endgroup$0
, I don't get a plot that reflects that there may be different values of $w_0$ involved, since all the SmoothHistograms will get normalized to 1, instead of to $1-w_0$ (I rewrote the density as you suggested, thanks). $\endgroup$