next | previous | forward | backward | up | top | index | toc | Macaulay2 website
RandomMonomialIdeals :: sample(String)

sample(String) -- creates an object of type Sample from a sample stored in a directory on disk

Synopsis

Description

A random sample of objects can be generated from an arbitrary model and stored to a directory on disk using the function writeSample. This shows how to retrieve that stored sample and have it loaded as an object of type Sample:

i1 : writeSample(sample(ER(2,3,0.1),5), "testDirectory")
i2 : mySample = sample("testDirectory")

o2 = Sample{...4...}

o2 : Sample
i3 : peek mySample

o3 = Sample{ModelName => Erdos-Renyi                            }
            Parameters => (2, 3, .1)
            SampleSize => 5
                       2   2            2       2          2
            Data => {{x , x x }, {0}, {x x , x x }, {0}, {x x }}
                       1   1 2          1 2   1 2          1 2

See also