Skip to content

Commit

Permalink
Used canned example for solverMLE(...,RealPrecision=>...)
Browse files Browse the repository at this point in the history
This example has been known to cause division by zero errors when the
random seed changes.
  • Loading branch information
d-torrance committed Sep 18, 2024
1 parent c976fa1 commit 2704235
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions M2/Macaulay2/packages/GraphicalModelsMLE.m2
Original file line number Diff line number Diff line change
Expand Up @@ -1485,11 +1485,23 @@ doc ///
Text
This optional input only applies when the sample data or the sample covariance matrix has real entries.
By default, the precision is 53 (the default precision for real numbers in M2).
Example
G = mixedGraph(digraph {{1,2},{1,3},{2,3},{3,4}},bigraph {{3,4}});
U = matrix{{6.2849049, 10.292875, 1.038475, 1.1845757}, {3.1938475, 3.2573, 1.13847, 1}, {4/5, 3/2, 9/8, 3/10}, {10/7, 2/3,1, 8/3}};
solverMLE(G,U,RealPrecision=>10)
CannedExample
i1 : G = mixedGraph(digraph {{1,2},{1,3},{2,3},{3,4}},bigraph {{3,4}});

i2 : U = matrix{{6.2849049, 10.292875, 1.038475, 1.1845757}, {3.1938475, 3.2573, 1.13847, 1}, {4/5, 3/2, 9/8, 3/10}, {10/7, 2/3,1, 8/3}};

4 4
o2 : Matrix RR <-- RR
53 53

i3 : solverMLE(G,U,RealPrecision=>10)

o3 = (1.83311, | 4.52904 7.81123 -.0250185 .309951 |, 2)
| 7.81123 14.3732 -.0382332 .473665 |
| -.0250185 -.0382332 .00337164 -.0418254 |
| .309951 .473665 -.0418254 .742627 |

o3 : Sequence
SeeAlso
scoreEquations
solverMLE
Expand Down

0 comments on commit 2704235

Please sign in to comment.