Would anyone happen to know a formula for calculating the following either in Excel or VBA
E(X|X>1000)
The distribution I'm working with is a Normal Distribution (mu , sigma)
Would anyone happen to know a formula for calculating the following either in Excel or VBA
E(X|X>1000)
The distribution I'm working with is a Normal Distribution (mu , sigma)
I'm not sure if I understand your notation well -
Are you looking for mean for the part of normal distribution (cut by X=some value)?
Basically excel offers only built in functions for normal distribution frequency and cumulative frequency, as well as inversed cumulative (i.e. quantiles).
all the rest has to be derived either from just equations standard solving (or numerical methods for solving - excel is not perfect in that - max floating point precision is double)
Last edited by Kaper; 02-20-2015 at 09:40 AM.
Best Regards,
Kaper
Thanks for the reply?
What I am basically trying to do is calculate the expected value between 2 points
So we have a normal distribution (mu sigma)
I want to calculate the expected value of that distribution of between a given Y and Z
So if I have a distribution ( 1000, 500)
What is the expected value between 4000 and 5000.
I was thinking I could calculate the expected value above 4000 and then above 5000 and subtract the two?
I am not sure what you are trying to calculate. My first guess is that you want the NORMDIST() function https://support.office.com/en-us/art...2-c9ff422d6d58 It is not clear to me if you are looking for the probability density at your given x or the cumulative distribution -- both values can be calculated by NORMDIST(). See if that is what you are looking for.
Originally Posted by shg
Do you really want the probability, not the "expected value" (mean)?
If we substitute the word "probability" wherever you use "expected value", the procedure you describe calculates the probability of 4000<=X<=5000, which we might describe as P(X | 4000<=X<=5000).
It is simpler to calculate P(X | X<=5000) - P(X | X<=4000). That is:
=NORMDIST(5000,1000,500,1) - NORMDIST(4000,1000,500,1)
However, with mean=1000 and sd=500, 5000 is 8sd = (5000-1000)/500, and 4000 is 6sd = (4000-1000)/500. Those cumulative probabilities are nearly 100%, and their difference is infinitesimal (about 9.87E-10).
If you are making up example numbers, it might be more interesting to select X such that -3sd <= X <= 3sd, for example. With mean=1000 and sd=500, choose -500 <= X <= 2500.
[EDIT] If you truly mean "expected value", the result you are looking will be a number between -500 and 2500 (using my limits). Is that what you are indeed looking for?
[EDIT] PS.... I just realized you posted this in the VBA subforum. Use WorksheetFunction.NormDist in VBA.
Last edited by joeu2004; 02-21-2015 at 03:03 AM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks