Site logo

The ELM data structure now supports the simultaneous use of id-case-id-alt (idCA) and id-case-only (idCO) data, as well as multiple linked relational database tables containing id-group-id-alt (idGA) and id-group-only (idGO) data.

A group table might be used for repetitive data that does not change between decision makers (e.g. population density for destination zone choices) or that is the same for a group of decision makers (e.g. travel time to different destination choices for all decision makers with the same origin location). During program execution, group tables save memory allocation requirements, at the expense of greater processor loads. If, however, the reduced memory requirements eliminate the need for the program to use virtual memory space on a hard disk, the processor load hit will almost always be worthwhile. If there is enough real memory to create arrays in memory to store the full expansion of all relational data that will be used in the model, it will be fastest to estimate the model by doing so.

Index of Datasets

This is the master index of available data tables. It is also valid and potentially useful to reference not just actual tables but also views of data in this table, which can pre-link relational database tables together, if enough memory is available to estimate the model in full-memory modes.

CREATE TABLE datasets ( name char(128), tablename char(128), description text, data_format int, num_cats int, num_vars int, num_rows int, parent_table char(128), parent_var text, type text, alt_col_name text DEFAULT 'altnum', case_col_name text DEFAULT 'casenum');

name char(128)

The name of the table

tablename char(128)

Another more descriptive name. Not used by the program.

description text

A description. Not used by the program.

data_format int

The type of data in the table.

  • 91 = idCA
  • 92 = idCO
  • 94 = idGA
  • 95 = idGO

parent_table

This is the name of the idCA or idGO table to which this table is linked, if it is a idGA or idGO table. One idGA or idGO table may appear multiple times in the datasets table, with links to different origin tables.

parent_var text

This is the name of the variable (column) in the parent table that contains the group indexes for this linked table.

type text

This is the type of table in SQLite, either 'table' or 'view'

alt_col_name text DEFAULT 'altnum'

The field name of the alternative number in CA or GA data, or the chosen alternative in CO data.

case_col_name text DEFAULT 'casenum'

The field name of the case id in CA or CO data, or the group id in GA or GO data.

Raw Data

CREATE TABLE XXX ( casenum int, altnum int, variable1 double variable2 double, ... category1 int, category2 int, ...);

(XXX is the dataset name, exactly as it appears in the associated row of the datasets table.)

casenum int

In an idCA or idCO table, the case-id number.
In an idGA or idGO table, the group-id number.
The actual name of the database field is specified in the datasets table, it need not be casenum

altnum int

In an idCA or idGA table, the alternative-id number.
In an idCO table, the alternative-id of the chosen variable.
In an idGO table, this column may be safely omitted or included, as its presence will not adversely affect operations.
The actual name of the database field is specified in the datasets table, it need not be altnum

variable_name double

a variable

category_name int

the group-id in the relevant idGA or idGO table to which this case belongs.

Alternatives

CREATE TABLE alternatives (id text, name char(128), upcodes text, dncodes text);

This table holds the names and id numbers of the alternatives. All ID numbers should be positive integers. Zero is not a valid alternative number, it is reserved for non-choice. All possible alternatives must appear and be named in this table, even if they are never chosen.

id text

This is the ID code of the alternative. It is usually a integer number, but the format also allows an alpha-numeric text string, which facilitates usage of alternative numbers that are larger than the maximum integer on 32 bit computers (for example, for a FIPS code identifier).

name char(128)

This is the name of the alternative. It is for using human-readable input and output.

upcodes text
dncodes text

These fields hold a tab-delimited list of the codes for upward and downward links from the alternative. This allows the specification of a fundamental data structure, which serves as the basis for a nesting structure.