RandomMonomialIdeals is a package for sampling random monomial ideals from an Erdos-Renyi-type distribution, the graded version of it, and some extensions. It also introduces new types of objects, Sample and Model, to allow for streamlined handling of random objects and their statistics in Macaulay2. Most of the models implemented are drawn from the paper Random Monomial Ideals by Jesus A. De Loera, Sonja Petrovic, Lily Silverstein, Despina Stasi, and Dane Wilburne (https://arxiv.org/abs/1701.07130).
The main method, randomMonomialSets, generates a sample of size $N$ from the distribution $\mathcal B(n, D, p)$ of sets of monomials of degree at most $D$ on $n$ variables, where $p$ is the probability of selecting any given monomial:
|
|
For a formal definition of the distribution, see Section 1 of https://arxiv.org/abs/1701.07130. As is customary, we use the word `model' when referring to a distribution of the random objects at hand.
The model defined by $\mathcal B(n, D, p)$ was inspired by the Erdos-Renyi random graph model denoted by $G(n,p)$: it is a natural generalization, as squarefree monomials of degree tww can be encoded by edges of a graph whose vertices are the variables. The random graph model can be introduced in two ways: one can either fix the probability of an edge or fix the total number of edges. Thus the package also includes the model variant that generates a fixed number of monomials:
|
|
To sample from the graded model from Section 6 of https://arxiv.org/abs/1701.07130, simply replace $p$ by a list of $D$ probabilities, one for each degree. In the example below, monomials of degree 1 are not selected since their probability = 0, while each monomial of degree 2 is selected with probability 1.
|
|
The package also allows for sampling from the graded version of the fixed number of monomials model, where we specify the requested number of monomials of each degree. In the example below, we sample random sets of monomials with one monomial of degree 1, zero of degree 2 and three monomials of degree 3.
|
|
Finally, we can request the monomial sets generated by the graded model with a fixed number of monomials to be minimal generating sets. We can also employ the minimal strategy for a couple of other versions of the randomMonomialSets method.
|
|
|
|
Once a sample (that is, a set of random objects) is generated, one can compute various statistics of algebraic properties of the sample. The methods in the package offer a way to compute and summarize statistics of some of the common properties, such as degree, dimension, projective dimension, Castelnuovo-Mumford regularity, etc. For example, we can use the method dimStats to get the Krull dimension statistics:
|
|
The first entry in the output of the method dimStats is the mean Krull dimension of the sample. The second entry is the standard deviation. Similarly, one can obtain the mean and standard deviations of the number of minimal generators and degree complexity via mingenStats, and the average Betti table shape, mean Betti table, and its standard deviation via bettiStats:
|
|
For developing other models and computing statistics on objects other than monomial ideals, the package also defines two new types of object, Model and Sample, which allow for convenient storage of statistics from a sample of algebraic objects and streamlines writing sample data into files.
For example, below we create a sample of size 10 from the Erdos-Renyi distribution $\mathcal B(n, D, p)$ on monomials in $Q[y,w]$ with $D=4$, and $p=0.5$, and then a sample of size 15 from the graded version of this distribution on monomials in $Z/101[z_1..z_8]$ with $D=2$, and $p={0.25,0.5}$:
|
|
The output is a hash table with 4 entries. To obtain the random sets of monomials that were generated (that is, the actual data we are interested in), use the command getData:
|
|
|
|
We can also use the object of type Sample to calculate the mean, standard deviation, and tally of the dimension of the ideals in the sample:
|
Most of the methods in this package offer various options, such as selecting a specific ring with which to work, or specifying variable names, coefficients, etc. Here is a simple example:
|
|
|
In some cases, we may want to work directly with the sets of randomly chosen monomials, while at other times it may be more convenient to pass directly to the corresponding random monomial ideals. Both options induce the same distribution on monomial ideals:
|
|
|
Version 1.0 of this package was accepted for publication in volume 9 of The Journal of Software for Algebra and Geometry on 11 April 2019, in the article Random Monomial Ideals: a Macaulay2 package. That version can be obtained from the journal or from the Macaulay2 source code repository.
This documentation describes version 1.0 of RandomMonomialIdeals.
The source code from which this documentation is derived is in the file RandomMonomialIdeals.m2.
The object RandomMonomialIdeals is a package.