Conditional expectation in matlab
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
I have to calculate conditional expected value of a and b. a and b are random variables that are normally distributed with mean 1/2 and variance 1/2. The support for a and b, ie. Values of a and b, falls in the interval [0,1]. I have to calculate E(a|a>b) and E(b|a>b). How can I do this in Matlab?
Help @Torsten
6 件のコメント
Paul
2023 年 10 月 14 日
Hi Sabrina,
If a and b are normal, they each have support over the entire real line, so the statement about the interval of [0,1] is unclear.
I suspect some important information is missing from the question.
In any case, do you already have an approach that is supposed to be implemented in Matlab?
Sabrina Garland
2023 年 10 月 14 日
William Rose
2023 年 10 月 14 日
"I can't find code in Matlab which will help me define interval for normal distribution."
As @Paul correctly noted, you cannot find that because if the interval is not -If to +Inf, it would not be a normal distribution.
If you have an experimental situaiton where there is a ratio, and the ratio mut be between 0 and 1, then the ratio is not normally distributed. The classic example is the fraction of heads in N coin flips, which has a scaled binomial distribution.
William Rose
2023 年 10 月 14 日
編集済み: William Rose
2023 年 10 月 14 日
[edit : fix typos]
another aspect of your original post which is impossible is
"... mean 1/2 and variance 1. The support for a and b, ie. Values of a and b, falls in the interval [0,1]."
Let's forget about whether the variables are normal or not. If the interval is [0,1], then it is impossible for the variance to be 1. Because var=1 means the average squared distance of each point from the mean is 1. For a variable with range [0,1], the mean will be between 0 and 1 (and you said mean=1/2, so that's fine). But the maximum distance from mean=1/2 to a point in this range is 1/2 (if the point is at 0 or 1). So the variance must be <1.
Sabrina Garland
2023 年 10 月 14 日
William Rose
2023 年 10 月 14 日
編集済み: William Rose
2023 年 10 月 14 日
@Sabrina Garland, you're welcome.
[edit: correct typo. I wrote var(1)=0.5 and I meant to write var(a)=0.5]
I think you meant that the standard deviation (not variance) is 1/2. Because if var(a)=0.5 then SD=1/sqrt(2)=0.707, which is still too much, if
and range is [0,1].
If I am right that mean(a)=0.5 and s.d.(a)=0.5, and if range(a)=[0,1], then you must be talking about the Bernoulli distribution, i.e. the distribution of results from a single coin flip, for an evenly-weighted coin. The result of one flip is either 0 or 1, with mean 0.5 and variance=0.25, s.d.=0.5. Any other distribution with mean=0.5 will have an s.d. that is less than 0.5.
But you also said the random variable is a gain, so I don't know what to think.
Can you give a more detailed description of what you mean by the variable being the ratio of gains? How is each gain calculated? Whay can't the gain be more than 1 or less than 0. You also called it a profit. If you have an opportunity where the profit cannot be negative, there will be a lot of intereted people... :)
回答 (0 件)
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!