Solving a two equation system yields strange results
Subject: Solving a two equation system yields strange results
From: Raymond Toy
Date: Wed, 9 May 2012 14:46:48 -0700
On Wed, May 9, 2012 at 1:56 PM, Jason Filippou <jason.filippou at gmail.com>wrote:
> Yes, this particular equation is only defined if k is an integer.
> However, even after I make this known in maxima, the system appears to
> have no solutions:
>
> (%i2) declare(k, integer);
> (%o2) done
> (%i3) solve([b*(k - 1) = 0.1, exp(-1/b) * sum(1/(i! * b^i), i, 0, k
> -1) = 0.02], [b, k]);
>
> rat: replaced -0.1 by -1/10 = -0.1
>
> rat: replaced -0.02 by -1/50 = -0.02
> (%o3) []
> (%i4) solve([b*(k - 1) = a, exp(-1/b) * sum(1/(i! * b^i), i, 0, k -1)
> = 0.02], [b, k]);
>
> rat: replaced -0.02 by -1/50 = -0.02
> (%o4) []
>
> FYI, what I'm trying to do here is to fit the parameters ? (theta) and
> k of a gamma distribution such that 98% of its mass is contained
> within the interval [0, 1]. In addition, I require that the "top" of
> the distribution, which is situated at ?*(? - 1) is equal to 0.1, or a
> in the general case. Unfortunately I can't use the first
> characterization of the CDF (as described in the link above, where x =
> 1) to do this because Maxima does not support the incomplete gamma
> function ?), so I'm using the second characterisation, which includes
> a sum of k terms.
>
>
Update your version of maxima to something newer like 5.27 or 5.26. The
incomplete gamma function is defined there. (5.21 is very old.)
This won't help with solve because solve doesn't know anything about the
incomplete gamma function. But you should be able to find numerical
solutions using find_root.
> Two unknown quantities, two equations; there should be a solution to this.
>
Only if the equations are consistent. :-)
Ray