Download An Environment for Graphical Models

Transcript
11.5. Controlling Algorithms
129
After reading specification (and the use of SET READ { All | Subset hseti };)
CoCo chooses automatically between three internal data structures for marginal tables:
1) All marginal tables: If the dimension of the table is low (less than or equal to
9 for binary factors in PC) there is space for finding all marginal tables. In, e.g.,
a model search you will then save some time.
2) Necessary tables: If there is no space for all marginal tables but space for reading the full table into an array and it is expected that the full table can be read
faster than the list of cases, the data structure Necessary tables is selected.
On UNIX the size of the N-array is controlled by the option N[size] when
invoking CoCo. When performing a test necessary marginal tables are then
found. Necessary marginal tables are sufficient marginal tables + intersections
of sufficient marginal tables.
3) File: If the full table cannot fit into the memory (dimension is higher than 15
on PC) the data structure File is selected. Observations are then placed on an
internal file.
On the PC you are then able to compute log(L) for a model with 64 factors,
if the largest clique in the graph for the model has 14 vertices at the most and
there are no more than 13 vertices in the largest non-decomposable atom (or
more precisely, if the state-space of each irreducible component after adding a
fill-in can fit into the P-array).
The command STATUS Limits; will show the selected data structure.
After reading specification (and SET READ Subset hai;) you can change the choice
of data structure with the commands SET DATASTRUCTURE All;, SET DATASTRUCTURE
Necessary;, SET DATASTRUCTURE File;, SET LARGE On; and SET LARGE Off;. If,
e.g., you have a 6-dimensional table with binary factors then read data with the
three commands READ SPECIFICATION;, SET DATASTRUCTURE Necessary; and READ
OBSERVATIONS; instead of READ DATA; to avoid finding all marginal tables.
If there is space for reading the full table into an array but it is expected that
the list of cases can be read faster than the full table (it is expected that the table is
sparsed) the data structure File is selected and a message like “If more than ... cases
then use SET DATASTRUCTURE NECESSARY between READ SPECIFICATION
and READ OBSERVATIONS” is stated. The time used to read tables and lists
of cases depends on the computer. When reading the data, CoCo then uses time
to find out which data structure is the fastest on your computer for the particular
dataset. In subsequent runs of CoCo on the dataset, force CoCo to use the selected
data structure with SET DATASTRUCTURE Necessary; or SET DATASTRUCTURE File;
between the two commands READ SPECIFICATION; and READ OBSERVATIONS;.
If Large is off and there is sufficient workspace in the N-array and in the P-array
when performing tests all necessary marginal tables are found and the IPS-algorithm is
run on all non-decomposable atoms before computing log(L). If Large is on, marginal
tables (of observations and probabilities) are found and used in computing log(L) one
at a time, e.i., you force CoCo to dispose of sufficient marginal tables as soon as the
are used.