Macaulay2 » Documentation
Packages » RandomMonomialIdeals :: Sample
next | previous | forward | backward | up | index | toc

Sample -- a type used to store a data sample from a statistical model

Description

A sample of algebraic objects is a set of data collected by a random generating process, necessarily captured by a formal statistical model. The type Sample defined here stores a set of data generated using an object of type Model. This allows for a streamlined way to sample random objects, store the data as a proper statistical sample, and study their algebraic properties under the probabilistic regime.

An object of type Sample is a hash table with the following keys: name of the model used to generate the sample, values of the model's parameters used to generate the sample, the size of the sample (that is, the number of data points in it), and the data itself.

i1 : peek sample(ER(3,2,0.2),4)

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

See also

Functions and methods returning an object of class Sample :

Methods that use an object of class Sample :

For the programmer

The object Sample is a type, with ancestor classes MutableHashTable < HashTable < Thing.