The value of ksdensity great than 1

11 views (last 30 days)
Hi every one , Iam Thao . i have some problem with image procesing in statictis like that : I tried using [f,xi] = ksdensity(dataser); to obtain the PDF of a random data set. owever, from the PDF I get, there are samples that have p(x)>1 The probablility density can't great than 1 , some one can explain why p(x) > 1...
example : [f,xi] = ksdensity(rand(100,1)/10) >> max(f)
ans =
10.2559
Thanks a bilion ... !

Accepted Answer

Roger Stafford
Roger Stafford on 14 Dec 2013
There is nothing wrong with a probability density being greater than one. A probability cannot be greater than one, but a probability density can be. As a simple example, suppose we have a statistically uniform distribution on the interval from 0 to .1 which could be generated by the random process
r = rand(n,1)/10;
Think what its probability density is - that is, what is the probability of a subinterval therein divided by the length of that subinterval. Of course, it is 10 which is certainly greater than 1. Or suppose you have a normal distribution in which the standard deviation is very small, say, equal to .2. Then ask for the probability density at its mean value and you will get 1.99 which again is greater than 1.
  2 Comments
Thao
Thao on 15 Dec 2013
Can you explain more clearly ? I don't see a static function f that f(x)>1 , f is density function . it wonderful if you proof your answer by mathematic . help me please , Thanks you
Roger Stafford
Roger Stafford on 15 Dec 2013
I refer you to the definition given by Wikipedia for "probability density" at the site:
http://en.wikipedia.org/wiki/Probability_density_function
I quote part of a statement there: "The probability of the random variable falling within a particular range of values is given by the integral of this variable’s density over that range".
If you accept this definition, consider what must be true if the probability of the random variable falling with that range is greater than the width of that range, something that is easily possible. Then somewhere within that range the integrand - in this case the density - must assume a value greater than 1 in order to obtain an integral with that large a probability value. You can't integrate over an interval from a to b with an integrand everywhere less than 1 and get an integral value greater than b-a.
In 'ksdensity' you can produce that effect, (as you apparently have,) by having a large number of sample points bunched tightly together over a small range of values.

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!