Copyright © Risa/Asir committers 2004–2025. All rights reserved.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| 1 About this document | ||
| • Complex to A matrix | ||
| • Direct sampler of two way contigency table | ||
| Index |
This document explains Risa/Asir functions for direct sampler
by contiguity relations of GKZ hypergeometric systems
Loading the package:
import("gtt_ds.rr");
References cited in this document.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
2.1 gtt_ds.getA |
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gtt_ds.getA:: It returns a matrix A standings for a simplicial complex defined by Facets and the set of levels of each vertex Levels.
Matrix A to define a GKZ system.
Levels of each vertex of the simplicial complex Facets.
The set of facets of a simplicial complex. A facet is expressed by a 0, 1 vector. 1 stands for the vertex of the position belongs to the facet and 0 stands for the vertex of the position does not belong to the facet.
1 2 *------* |\ | | \ | | \ | | \ | | \ | *------* 4 3
The facet 12 is expressed as [1,1,0,0],
The facet 23 is expressed as [0,1,1,0],
the facet 13 is expressed as [1,0,1,0].
The set of all facets is
[[1,1,0,0],[0,1,1,0],[1,0,1,0],[1,0,0,1],[0,0,1,1]].
[2,2,3,4], then the vertex 1 has the levels 1,2,
the vertex 2 also has the levels 1,2,
the vertex 3 has the levels 1,2,3,
and the vertex 4 ahs the levels 1,2,3,4.
[2,2,3,4].
Then, all levels of the facet F is
[1,0,1,0],[1,0,2,0],[1,0,3,0],[2,0,1,0],[2,0,2,0],[2,0,3,0].
The rows of the matrix A is indexed by such index that runs over all facets.
Levels=[2,4], then the column index is
[1,1],[1,2],[1,3],[1,4],[2,1],[2,2],[2,3],[2,4].
Example:
Consider the simplicial complex [1][2] (independent two points)
with Levels=[2,2].
Then, the rows of the matrix A is indexed by
[1,0],[2,0],[0,1],[0,2]
and the columns of the matrix A is indexed by
[1,1],[1,2],[2,1],[2,2].
The matrix A is
\pmatrix{1&1&0&0\cr
0&0&1&1\cr
1&0&1&0\cr
0&1&0&1\cr
}
For example, [1,0],[1,1] matches (1?,11, replace 0 by the wild card ? and regard it a regular expression),
[1,0],[1,2] also matches (1?,12), but
[1,0],[0,1] does not match (1?,01).
[2122] import("gtt_ds.rr");
[4432] gtt_ds.getA([2,2],[[1,0],[0,1]]);
[ 1 1 0 0 ]
[ 0 0 1 1 ]
[ 1 0 1 0 ]
[ 0 1 0 1 ]
Example:
Consider the simplicial complex [1][2] (independent two points)
with Levels=[2,3].
Then, the rows of the matrix A is indexed by
[1,0],[2,0],[0,1],[0,2],[0,3]
and the columns of the matrix A is indexed by
[1,1],[1,2],[1,3],[2,1],[2,2],[2,3].
The matrix A is
\pmatrix{
1& 1& 1& 0& 0& 0 \cr
0& 0& 0& 1& 1& 1 \cr
1& 0& 0& 1& 0& 0 \cr
0& 1& 0& 0& 1& 0 \cr
0& 0& 1& 0& 0& 1 \cr
}
[2122] import("gtt_ds.rr");
[4432] gtt_ds.getA([2,3],[[1,0],[0,1]]);
[ 1 1 1 0 0 0 ]
[ 0 0 0 1 1 1 ]
[ 1 0 0 1 0 0 ]
[ 0 1 0 0 1 0 ]
[ 0 0 1 0 0 1 ]
Example:
Consider the simplicial complex [123][134]
with Levels=[2,2,3,4].
For example,
the row index [1,2,2,0] and the column index [1,1,1,1].
They do not match (122? and 1111).
The row index [1,2,2,0] and the column index [1,2,2,4].
matches (122? and 1114).
The row index [1,1,1,0] and the column index [1,1,1,1]. matches (111? and 1111). The row index [1,1,1,0] and the column index [1,1,1,2]. matches (111? and 1112). ... The row index [1,1,1,0] and the column index [1,2,1,1]. does not matche (111? and 1211). ... The row index [1,1,1,0] and the column index [2,2,3,4]. does not matche (111? and 2234).
[2122] import("gtt_ds.rr");
[4432] gtt_ds.getA([2,2,3,4],[[1,1,1,0],[1,0,1,1]]);
[ 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0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Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
gtt_ds.direct_sampler:: It returns a sample contingency table.
A sample contingency table.
Marginal sums of a two way contingency table.
A list of probabilities of each cell of the table.
gtt_ekn3.rr
to obtain contiguity relations for the GKZ hypergeometric systems
(Aomoto-Gel’fand system) for two way contingency tables.
Example: we consider 2 \times 3 contingency tables with the cell probability \pmatrix{ 1& 1/2 & 1/3 \cr 1& 1 & 1 \cr } , the row marginal sums (5,6), and the column marignal sums (3,3,5).
[1883] import("gtt_ds.rr");
[4447] for (I=0; I<3; I++)
printf("%a\n-----\n",gtt_ds.direct_sampler(MarginalSum,CellProb));
[ 2 0 3 ]
[ 1 3 2 ]
-----
[ 2 2 1 ]
[ 1 1 4 ]
-----
[ 2 0 3 ]
[ 1 3 2 ]
-----
Todo, install a function to obtain contiguity relations
for a given matrix A.
Call this function with optional variable a (A matrix),
MarginalSum is \beta.
Refer to mt_mm.rr and latest isom-project codes.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
| Jump to: | G |
|---|
| Index Entry | Section | ||
|---|---|---|---|
| | |||
| G | |||
gtt_ds.direct_sampler | 3.1 gtt_ds.direct_sampler | ||
gtt_ds.getA | 2.1 gtt_ds.getA | ||
| | |||
| Jump to: | G |
|---|
| [Top] | [Contents] | [Index] | [ ? ] |
| [Top] | [Contents] | [Index] | [ ? ] |
| [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on December 8, 2025 using texi2html 5.0.
The buttons in the navigation panels have the following meaning:
| Button | Name | Go to | From 1.2.3 go to |
|---|---|---|---|
| [ << ] | FastBack | Beginning of this chapter or previous chapter | 1 |
| [ < ] | Back | Previous section in reading order | 1.2.2 |
| [ Up ] | Up | Up section | 1.2 |
| [ > ] | Forward | Next section in reading order | 1.2.4 |
| [ >> ] | FastForward | Next chapter | 2 |
| [Top] | Top | Cover (top) of document | |
| [Contents] | Contents | Table of contents | |
| [Index] | Index | Index | |
| [ ? ] | About | About (help) |
where the Example assumes that the current position is at Subsubsection One-Two-Three of a document of the following structure:
This document was generated on December 8, 2025 using texi2html 5.0.