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

- Model -- a type used to store a statistical model and its parameters
- statistics -- generate statistics for a sample

## Functions and methods returning an object of class Sample:

- sample -- generates a sample from the given model

## Methods that use an object of class Sample:

- `getData(Sample)` -- see getData -- get the underlying samples
- `statistics(Sample,Function)` -- see statistics -- generate statistics for a sample
- `writeSample(Sample,String)` -- see writeSample -- write sample data to a directory

## For the programmer

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

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/RandomMonomialIdeals.m2:1628:0.