Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am aware that we can find the expectation under the assumption that x follows some probability distribution, something like this:

Expectation[((1 - x)/x), x \[Distributed] BetaDistribution[alpha, beta]]

However, is it possible to find the variance of the above equation (1-x)/x under the same assumption that x follows a beta distribution?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

Something like :

Expectation[(((1 - x)/x))^2, x \[Distributed] BetaDistribution[alpha, beta]] -     
(Expectation[((1 - x)/x), x \[Distributed] BetaDistribution[alpha, beta]])^2 // Simplify

(* (beta (-1 + alpha + beta))/((-2 + alpha) (-1 + alpha)^2) *)
share|improve this answer
    
ah, so we are using the fact that var(x)=E(x^2)-E(X)^2 thanks!! –  yyasinta Oct 10 '12 at 14:46
add comment

This is a perfect place to try out TransformedDistribution.

dist = TransformedDistribution[(1 - x)/x, x \[Distributed] BetaDistribution[alpha, beta]];

Variance[dist]

==> (beta (-1 + alpha + beta))/((-2 + alpha) (-1 + alpha)^2)

Edit:

Based on the comments it is worth pointing out that TransformedDistribution rarely auto-evaluates to a known distribution.

This happens when auto-evaluation to a known distribution either isn't possible or hasn't been added yet. That doesn't mean that the result isn't a perfectly good distribution to work with.

Here we see that the distribution remains unevaluated but we can still generate random numbers (and compute just about any other property) and then compare to the theoretical expectation.

Block[{alpha = 5, beta = 2}, 
 ndist = TransformedDistribution[(1 - x)/x, 
   x \[Distributed] BetaDistribution[alpha, beta]];
 rnd = RandomVariate[ndist, 10^5];
 {Head[ndist], N@Variance[dist], Variance[rnd]}
 ]

==> {TransformedDistribution, 0.25, 0.245677}
share|improve this answer
    
I tried that and gave up because it just returned the TransformedDistribution line unchanged; I didn't know you could still proceed from there. –  b.gatessucks Oct 10 '12 at 15:26
3  
Right. That is a common point of confusion. Many things in the Probability and Statistics framework work this way. Also, of note is that using N on an unevaluated result can often give a numeric approximation. –  Andy Ross Oct 10 '12 at 15:28
    
perfect!! thanks :)) –  yyasinta Oct 10 '12 at 15:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.