Graphical Models MLE is a package for algebraic statistics that broadens the functionalities of GraphicalModels. It computes the maximum likelihood estimates (MLE) of the covariance matrix of Gaussian graphical models associated to loopless mixed graphs(LMG).
The main features of the package are the computation of the sampleCovarianceMatrix of sample data, the ideal generated by scoreEquations of loglikelihood functions of Gaussian graphical model, the MLdegree of such models and the MLE for the covariance or concentration matrix via solverMLE.
For more details on the type of graphical models that are accepted see gaussianRing. In particular, for further information about LMG with undirected, directed and bidirected edges, check partitionLMG.
References:
An introduction to key notions such as MLE and MLdegree can be found in the books:
Seth Sullivant, Algebraic statistics, American Mathematical Society, Vol 194, 2018.
Mathias Drton, Bernd Sturmfels and Seth Sullivant, Lectures on Algebraic Statistics, Oberwolfach Seminars, Vol 40, Birkhauser, Basel, 2009.
The definition and classification of loopless mixed graphs (LMG) can be found in the paper:
Kayvan Sadeghi and Steffen Lauritzen, Markov properties for mixed graphs, Bernoulli, 20 (2014), no 2, 676696.
Examples:
Computation of a sample covariance matrix from sample data:


The ideal generated by the score equations of the loglikelihood function of the graphical model associated to the graph $1\rightarrow 2,1\rightarrow 3,2\rightarrow 3,3\rightarrow 4,3<> 4$ is computed as follows:




Computation of the MLdegree of the 4cycle:


Next compute the MLE for the covariance matrix of the graphical model associated to the graph $1\rightarrow 3,2\rightarrow 4,3<> 4,1  2$. The input is the sample covariance instead of the sample data.



As an application of solverMLE: positive definite matrix completion
Consider the following symmetric matrix with some unknown entries:


Unknown entries correspond to the nonedges of the 4cycle. A positive definite completion of this matrix is obtained by giving values to x and y and computing the MLE for the covariance matrix in the Gaussian graphical model given by the 4cycle. Check solverMLE for more details.



GraphicalModelsMLE requires Graphs, StatGraphs and GraphicalModels. In order to use the default numerical solver, it also requires EigenSolver.
Graphs allows the user to create graphs whose vertices are labeled arbitrarily. However, several functions in GraphicalModels sort the vertices of the graph. Hence, graphs used as input to methods in GraphicalModelsMLE must have sortable vertex labels, e.g., all numbers or all letters.
StatGraphs allows the user to work with objects such as bigraphs and mixedGraphs.
GraphicalModels is used to generate gaussianRing, i.e. rings encoding graph properties.
Version 1.0 of this package was accepted for publication in volume 12 of The Journal of Software for Algebra and Geometry on 14 March 2022, in the article Computing maximum likelihood estimates for Gaussian graphical models with Macaulay2 (DOI: 10.2140/jsag.2022.12.1). That version can be obtained from the journal or from the Macaulay2 source code repository.
This documentation describes version 1.0 of GraphicalModelsMLE.
The source code from which this documentation is derived is in the file GraphicalModelsMLE.m2.
The object GraphicalModelsMLE is a package.