Macaulay2 » Documentation
Packages » GraphicalModelsMLE :: solverMLE(...,SampleData=>...)
next | previous | forward | backward | up | index | toc

solverMLE(...,SampleData=>...) -- input sample covariance matrix instead of sample data

Synopsis

Description

solverMLE requires a matrix or a list of sample data as part of the default input. Setting solverMLE(...,SampleData=>...) to false allows the user to enter a sample covariance matrix as input. It must be a symmetric matrix.

i1 : G=graph{{1,2},{2,3},{3,4},{1,4}}

o1 = Graph{1 => {2, 4}}
           2 => {1, 3}
           3 => {2, 4}
           4 => {1, 3}

o1 : Graph
i2 : U=random(ZZ^4,ZZ^4)

o2 = | 8 8 8 8 |
     | 1 3 8 5 |
     | 3 3 5 2 |
     | 7 7 7 3 |

              4       4
o2 : Matrix ZZ  <-- ZZ
i3 : solverMLE(G,U,SampleData=>true)

o3 = (-5.76639, | 8.1875 6.3125  1.5433 2.625   |, 5)
                | 6.3125 5.1875  1.25   2.11114 |
                | 1.5433 1.25    1.5    2.25    |
                | 2.625  2.11114 2.25   5.25    |

o3 : Sequence
i4 : V=sampleCovarianceMatrix(U)

o4 = | 131/16 101/16 3/4 21/8 |
     | 101/16 83/16  5/4 23/8 |
     | 3/4    5/4    3/2 9/4  |
     | 21/8   23/8   9/4 21/4 |

              4       4
o4 : Matrix QQ  <-- QQ
i5 : solverMLE(G,V,SampleData=>false)

o5 = (-5.76639, | 8.1875 6.3125  1.5433 2.625   |, 5)
                | 6.3125 5.1875  1.25   2.11114 |
                | 1.5433 1.25    1.5    2.25    |
                | 2.625  2.11114 2.25   5.25    |

o5 : Sequence

Further information

See also

Functions with optional argument named SampleData: