Re: A nasty 2x2 system of equations?
- To: mathgroup at smc.vnet.net
- Subject: [mg54122] Re: A nasty 2x2 system of equations?
- From: Roland Franzius <roland.franzius at uos.de>
- Date: Fri, 11 Feb 2005 03:33:34 -0500 (EST)
- Organization: Universitaet Hannover
- References: <cuf559$glj$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Bruce Colletti wrote:
> Re Mathematica 5.1.
>
> The code below keeps running without getting an answer. Is the code flawed or is this a really nasty system of 2-equations in 2-unknowns?
>
> Here's background: X and Y are independent beta-distributed random variables and Z is a convex combination of X and Y, i.e., Z = cX + (1 - c)Y.
>
> Although Z need not be beta-distributed, let's pretend it is and in turn, solve for its parms (a3 and b3) in terms of c and the known parms of X and Y.
>
> Thanks.
>
> Bruce
>
> -------------
>
>
> X = BetaDistribution[a1, b1];
> Y = BetaDistribution[a2, b2];
> Z = BetaDistribution[a3, b3];
>
> Solve[{Mean[Z] == c*Mean[X] + (1 - c)*Mean[Y],
> Variance[Z] == c^2*Variance[X] + (1 - c)^2*Variance[Y]}, {a3, b3}]
>
<< Statistics`ContinuousDistributions`
X = BetaDistribution[a1, b1];
Y = BetaDistribution[a2, b2];
Z = BetaDistribution[a3, b3];
eq1 = Mean[Z] - c*Mean[X] - (1 - c)*Mean[Y] // Together // Numerator;
eq2 = Variance[Z] - c^2*Variance[X] - (1 - c)^2*Variance[Y] //
Together // Numerator;
Solve[{eq1 == 0, eq2 == 0}, {a3, b3}];
but don't expect a useful expression except with real number input.
--
Roland Franzius