# Find the Kernel distribution over an already known histogram

I have an estimated distribution over a parameter, however, the distribution is not continuous, and InterpolatingPolynomial cannot estimate my distribution good enough, so I am going to use the Kernel distribution.

I have seen SmoothKernelDistribution function, but that applies only on a data. I already have a histogram, how can I find its kernel separately?

Lets say these are my histogram x and y axis :

positin of columns={0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5}
height= {0.000123464, 0.0086719, 0.119523, 0.394129, 0.36659, 0.105748, 0.00521382}


Thanks

positionofcolumns = {0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5};
height = {0.000123464, 0.0086719, 0.119523, 0.394129, 0.36659, 0.105748, 0.00521382};


You can use WeightedData with height as the weight vector:

wd = WeightedData[positionofcolumns, height]

SmoothHistogram[wd] skd = SmoothKernelDistribution[wd]

Plot[PDF[skd, x], {x, 0,.8}] • Great, and how do you make it normalized?! sorry, it's a basic question I know. – aaa Aug 27 at 21:04
• The integral over the finalized probability should be 1. In the final graph it's reaching 8. My original data points reach 0.34 . – aaa Aug 27 at 21:14
• @aaa, PDF[skd,x] does integrate to 1: try NIntegrate[PDF[skd, x], {x,0, 1}]. Btw, values in height are not directly comparable to the height of the continuous PDF; you should get something comparable to the height of a bin if you integrate the pdf between the relevant bin limits. – kglr Aug 27 at 21:25
• ok this is weird, I tried that and I'm getting something close to 1. If PDF is giving a probability of distribution then how can it be larger than 1 at some values? – aaa Aug 27 at 21:31
• Total@{Probability[x < 0.225, x \[Distributed] skd], Probability[0.225 < x < 0.275, x \[Distributed] skd], Probability[0.275 < x < 0.325, x \[Distributed] skd], Probability[0.325 < x < 0.375, x \[Distributed] skd], Probability[0.375 < x < 0.425, x \[Distributed] skd], Probability[0.425 < x < 0.475, x \[Distributed] skd], Probability[x > 0.475, x \[Distributed] skd]} evaluates to 1. – Bob Hanlon Aug 28 at 3:38