From: Wayne King on 18 May 2010 07:39 "Alex " <alaios(a)yahoo.com> wrote in message <hstt56$hlq$1(a)fred.mathworks.com>... > "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hstr94$gue$1(a)fred.mathworks.com>... > > "Alex " <alaios(a)yahoo.com> wrote in message <hstpu4$k5h$1(a)fred.mathworks.com>... > > > Hello I am using the normpdf function to plot gaussian distributions for specific mean and std values. I have noticed that when sigma is small sigma<0.5 the normpdf returns values that are higher than 1 (which of course is not correct). > > > > > > > Why "of course is not correct"? The integral of pdf must be 1 but the value *can* of course get higher than 1. In fact the center value goes to infinity when sigma goes to zero. See the doc if you haven't sure about the formula. > > > > Bruno > > Thanks for your replies. I thought pdf was a way of finding out what is the percentage of rolling the number 2 in a (0,3) standard deviation? So far I was getting this reply by checking what was the y-value after finding where x-value (2 in this example) is. > > In that sense if normpdf returns number over 1 i could not translate this to the percentage or could I? > > Best Regards > Thanks for the support Hi, I'm not sure about your problem statement since you say "rolling the number 2" and then you are using a continuous random variable (Gaussian pdf). Are you sure you want to use a Gaussian pdf? Do you have a discrete random variable? At any rate, make sure you are using the right probability law to describe your experiment. To find probabilities for continuous random variables, you integrate the probability density over an interval. The probability of any continuous random variable at a single value is always zero. Integrate any pdf from point "a" to point "a" and that's zero. As one example (again assuming you really want to be using the Gaussian pdf here), assume you want to find the probability an outcome between [-1,1] for a N(0,1) random variable. You can use the cumulative distribution function: normcdf(1,0,1)-normcdf(-1,0,1) Hope that helps, Wayne
From: Alex on 18 May 2010 07:53 "Wayne King" <wmkingty(a)gmail.com> wrote in message <hstu8o$t69$1(a)fred.mathworks.com>... > "Alex " <alaios(a)yahoo.com> wrote in message <hstt56$hlq$1(a)fred.mathworks.com>... > > "Bruno Luong" <b.luong(a)fogale.findmycountry> wrote in message <hstr94$gue$1(a)fred.mathworks.com>... > > > "Alex " <alaios(a)yahoo.com> wrote in message <hstpu4$k5h$1(a)fred.mathworks.com>... > > > > Hello I am using the normpdf function to plot gaussian distributions for specific mean and std values. I have noticed that when sigma is small sigma<0.5 the normpdf returns values that are higher than 1 (which of course is not correct). > > > > > > > > > > Why "of course is not correct"? The integral of pdf must be 1 but the value *can* of course get higher than 1. In fact the center value goes to infinity when sigma goes to zero. See the doc if you haven't sure about the formula. > > > > > > Bruno > > > > Thanks for your replies. I thought pdf was a way of finding out what is the percentage of rolling the number 2 in a (0,3) standard deviation? So far I was getting this reply by checking what was the y-value after finding where x-value (2 in this example) is. > > > > In that sense if normpdf returns number over 1 i could not translate this to the percentage or could I? > > > > Best Regards > > Thanks for the support > > Hi, > I'm not sure about your problem statement since you say "rolling the number 2" and then you are using a continuous random variable (Gaussian pdf). Are you sure you want to use a Gaussian pdf? Do you have a discrete random variable? At any rate, make sure you are using the right probability law to describe your experiment. To find probabilities for continuous random variables, you integrate the probability density over an interval. The probability of any continuous random variable at a single value is always zero. Integrate any pdf from point "a" to point "a" and that's zero. > > As one example (again assuming you really want to be using the Gaussian pdf here), assume you want to find the probability an outcome between [-1,1] for a N(0,1) random variable. You can use the cumulative distribution function: > > normcdf(1,0,1)-normcdf(-1,0,1) > > Hope that helps, > Wayne It seems that I confused you. I used the dice and the number two rolling as an example. If I got it right when you have a Gaussian of (150,3) means that all your values are in the 150 region and if I want to see what is the change for the number 147,6 to appear in an imaginary rolling dice procedure I have to see what is the y-value for the 147,6 value. So what a value bigger than 1 would mean ?
From: Bruno Luong on 18 May 2010 08:05 "Alex " <alaios(a)yahoo.com> wrote in message <hstv30$m2f$1(a)fred.mathworks.com>... > It seems that I confused you. I used the dice and the number two rolling as an example. If I got it right when you have a Gaussian of (150,3) means that all your values are in the 150 region and if I want to see what is the change for the number 147,6 to appear in an imaginary rolling dice procedure I have to see what is the y-value for the 147,6 value. > > So what a value bigger than 1 would mean ? To interpret a continuous pdf you MUST integrate it. The probability of P(X=147.6) = 0 because the integral on a zero-length interval is zero. There is a difference between continuous random variable (eg Gaussian) and discrete random variable eg (rolling dice). Wayne gave you a correct explanation and his was not confused. Bruno
From: Alex on 18 May 2010 10:24
I would like to thank you all for the feedback. I think I got it right now! Best Regards Alex |