From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How can I find the mean between to points of normal distribution?
Date: Mon, 2 Aug 2010 22:39:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <i37he8$cmp$>
References: <i371ts$ht3$> <i37711$fqu$> <i37ctu$1ta$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1280788744 13017 (2 Aug 2010 22:39:04 GMT)
NNTP-Posting-Date: Mon, 2 Aug 2010 22:39:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: comp.soft-sys.matlab:658457

"BobC Cadenza" <> wrote in message <i37ctu$1ta$>...
> Thanks Roger, that works perfectly.  Since that worked so nice, how about adding in a wrinkle.   How would I include in the mean the values, that are outside a and b limited to a and b.  For example p(x<a)=p(a) and p(x>b)=p(b)
- - - - - - - - - - -
  Well that alters the assumption I was making.  When you write


as I did, that implies that the probability P2(a<=x & x<=b) is one, so that P2(x<a) and P2(x>b) are therefore each equal to zero (where P2 means the revised probability.)  In other words, by that former assumption x can't be outside [a,b].

  It sounds to me as though you are now saying that the probability density between a and b is to remain that same as in the original normal density, but that all x's below a are now to be concentrated in the single point x=a and similarly for x>b at the point x=b.  In that case there is no normalization to be done.  The mean would be the straightforward expression:

 int(a*p(x),'x',-inf,a) + int(x*p(x),'x',a,b) + int(b*p(x),'x',b,inf)

where again p(x) is the original pdf for mu and sigma.  The first and last of these integrals just involves the cdf for p(x).  The middle term is evaluated by the same trick I described earlier.

  I hope I have understood correctly what you are asking.

Roger Stafford