Written by : Matt
There is a developing field called algebraic statistics which explores probability and statistics problems involving discrete random variables using methods coming from commutative algebra and algebraic geometry. The basic point is that the parameters for such statistical models are often constrained by polynomial relationships – and these are exactly the subject of commutative algebra and algebraic geometry. I would like to learn something more about this relationship, so in this post I’ll describe one example that I worked through – it comes from a book on the subject written by Bernd Sturmfels. Disclaimer : the rest of this post is technical.
Suppose that you have three independent exponential random variables with parameters respectively. Recall that this means has the density function
when and otherwise.
Such a random variable is often interpreted in terms of waiting time to first occurrence for a Poisson process.
Suppose that rather than observing the time of occurrence directly, we only get to observe whether and occur before or not. (I’ll leave you to think about how this could come up in practice, but it seems like it could). So what we observe is a discrete random variable with four possible states indicating whether or not variable occurs before variable three. Now for an exercise in working with probability distributions (something the students in the class I taught could hopefully do!):
Great. Now suppose that we sample the variable some large number of times, and record the number of times that takes on the four values above. Given these observances, we would like to predict the three values. One way of doing this is, given a choice of values for the s, to compute . Then we choose the values to maximize this probability (this is known as the method of maximum likelihood estimation). Rather than maximize this function, we’ll maximize the log of it (which amounts to the same thing) to take advantage of the multiplicative structure of the function. You can compute this function:
Since the probability function involves equations of degree in the , there’s no harm in setting and solving for and . Any other set of solutions will be the same as these up to scaling all the values. After doing this, the maximizing equations (i.e. the gradient components of ) are
Things are starting to look more like polynomials! If someone asked you to solve this, you would probably try to clear denominators, use one equation to solve for and plug it into the second equation to get one equation with one unknown. The problem is that when you clear denominators, you will introduce extra solutions into your equation. That is, you will find solutions to your new equations which are not solutions to the equations you are trying to solve. In this example, you will find is a solution to the problem with cleared denominators, but not to the original equation.
How do you know which solutions are extra and which are not? In commutative algebra, there is exactly a process for this, and it’s called the saturation of an ideal. The ideal we must use in our example is generated by the polynomials consisting of the equations above with cleared denominators, and the common denominator of all terms appearing in the two equations. (Our ideal is an ideal in the ring ).
Saturation of an ideal is a process which is cumbersome to carry out by hand for all but the simplest examples, but has been implemented by computer algebra packages like Macaulay, Sage, and Singular. In general it’s very computationally intensive, so it may be slow for ‘large’ ideals. One strategy that will speed it up in this example is to use actual numbers in place of . For example, when then
and is given by a solution to
Then I calculate that (there is only one positive root) and (full disclosure: used Mathematica). In general the result of the saturation will allow you to solve for in terms of and then you will have that is given by the zeros of some polynomial which is usually of degree 3: