Re: Equation solving question
- To: mathgroup at smc.vnet.net
- Subject: [mg111711] Re: Equation solving question
- From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
- Date: Wed, 11 Aug 2010 04:46:16 -0400 (EDT)
First: Assuming does nothing at all with Solve. You would need to use FullSimplify or Simplify for assuming to be of any use.
Second: how can you expect to obtain your solution if:
In[45]:== Simplify[(D[lagr, #1] ==== 0 & ) /@ vars /. {q1 -> p1,
q2 -> p2, q3 -> p3,
q4 -> p4}]
Out[45]== {\[Lambda] ==== 0, \[Lambda] ==== 0, \[Lambda] ==== 0, \[Lambda] ====
0,
p1 + p2 + p3 + p4 ==== 1}
Note that for your solution to be valid lambda would have to be zero.
Third, even if this involves a simple mistake or a misunderstanding, you have a non-linear system of equations and unknowns with at least 8 variables, and since all relevant algorithms have very high complexity with respect to the number of variables is it ery unlikely that Mathematica can solve this system in a reasonable time.
Andrzej Kozlowski
Andrzej Kozlowski
On 10 Aug 2010, at 09:55, Yaroslav Bulatov wrote:
> I'd like to solve the system of equations below and Mathematica gets
> stuck, are the tricks I can do to help it solve this kind of system?
> It should produce solution q1==p1, q2==p2, q3==p3, q4==p4
>
> lagr == p1 (Log[q1/(q1 + q3)] + Log[q1/(q1 + q2)]) +
> p2 (Log[q2/(q1 + q2)] + Log[q2/(q2 + q4)]) +
> p3 (Log[q3/(q1 + q3)] + Log[q3/(q3 + q4)]) +
> p4 (Log[q4/(q2 + q4)] + Log[q4/(q3 + q4)]) - \[Lambda] (q1 + q2 +
> q3 + q4 - 1);
> vars == {q1, q2, q3, q4, \[Lambda]};
>
> Assuming[{p1 > 0 && p2 > 0 && p3 > 0 && p4 > 0 &&
> p1 + p2 + p3 + p4 ==== 1 && q1 > 0 && q2 > 0 && q3 > 0 && q4 > 0},
> Solve[D[lagr, #] ==== 0 & /@ vars, vars]]
>
> Motivation: I'm trying to show consistency of some pseudo-likelihood
> estimators, this example is the simplest case where PL applies
>