solverMLE(G,U)
This function takes as input a graph, or a digraph, or a bigraph or a mixed graph and a list or matrix that encodes, by default, the sample data. It computes the critical points of the score equations and selects the maximum value achieved among those that lie in the cone of positivedefinite matrices. The default output is the maximum value in the loglikelihood function, maximum likelihood estimators (MLE) for the covariance matrix and the MLdegree of the model. MLE for the concentration matrix can be obtained by setting the optional input ConcentrationMatrix to false.
The same optional inputs as in scoreEquations can be used, plus extra optional inputs related to the numerical solver (EigenSolver by default, NAG4M2 alternatively) and its functionalities.
Below we reproduce Example 2.1.13 for the 4cycle in the book: Mathias Drton, Bernd Sturmfels and Seth Sullivant, Lectures on Algebraic Statistics, Oberwolfach Seminars, Vol 40, Birkhauser, Basel, 2009.



The data sample can also be given as a list:



In the following example we compute the MLE for the covariance matrix of the graphical model associated to the graph $1\rightarrow 2,1\rightarrow 3,2\rightarrow 3,3\rightarrow 4,3<> 4$ In this case we give as input the sample covariance matrix:



Next we provide the MLE for the concentration matrix of the graphical model associated to the graph $1\rightarrow 3,2\rightarrow 4,3<>4,1  2$. Again the sample covariance matrix is given as input.



Application to positive definite matrix completion problems
Consider the following symmetric matrix with some unknown entries:


Unknown entries correspond to 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. To understand which values of x and y will result in a maximum likelihood estimate, see Example 12.16 in the book: Mateusz Michalek and Bernd Sturmfels, Invitation to Nonlinear Algebra, Graduate Studies in Mathematics, Vol ???, American Mathematical Society, 2021.



The MLE of the covariance matrix is the unique positive definite completion of the matrix M such that its inverse, namely the concentration matrix, has zero's in the entries corresponding to nonedges of the graph. Observe that all entries of V remain the same in the MLE except for those that correspond to nonedges of the graph.
The object solverMLE is a method function with options.