The nl class (nested logit) is derived from the mnl class, and retains all that class' methods, in addition to the ones listed here.
The nnnl class (non-normalized nested logit) is derived from the nl class, but adds no new methods, and can be operated in the same way as the nl class. However, the non-normalized nested logit is not consistent with utility maximization theory, and ELMWorks does not recommend that you use this model unless you fully understand what you are doing and have a good reason to want this particular model structure.
Constructor
nl(ec as core, model_name as string)
nnnl(ec as core, model_name as string)
ec
The core object from which to derive this model.
model_name
The name of the model. Using an existing name will automatically load the existing model.
Methods
node (logsum_name as string, logsum_code as string, nest_members as list of strings, optional parameter_value as float, optional constraint as int, optional std_err as float, optional bind_variable_name as string, optional bind_ratio as float) → status as string
node (logsum_name as string, logsum_code as int, nest_members as list of ints, optional parameter_value as float, optional constraint as int, optional std_err as float, optional bind_variable_name as string, optional bind_ratio as float) → status as string
item_name
this is a string describing the variable, in the format of [table_name.]variable_name[@alternative_name]
logsum_name
the name of the nest
logsum_code
The code number of the nest, which is added to the set of alternative codes. You may alternatively use strings as node codes, but it is best not to mix-and-match in one model.
nest_members
the code numbers of nest members, which can be an elemental alternative or another nest
parameter_value
an initial value for the logsum parameter (default=1)
constraint
a 1 to indicate the parameter is constrained to the initial value, 0 otherwise (default=0)
std_err
the standard error of the initial parameter (assumes that parameter was estimated already)
bind_variable_name
where a parameter is constrained equal to another in the same model uses table_name.variable_name[@alternative_name] format of the other parameter if the other parameter is another logsum parameter, use just the logsum_name of that parameter
bind_ratio
the multiplier on the free-floating parameter's value used to create this parameter (default=1)
status
returns OK on success, OOPS on error.
connect_nodes (upper_node_code as string, lower_node_code as string) → status as string
connect_nodes (upper_node_code as int, lower_node_code as int) → status as string
upper_node_code
The code of the upper (closer to root, farther from elemental alternatives) node.
lower_node_code
The code of the lower (closer to elemental alternatives, farther from root) node.
disconnect_nodes (upper_node_code as string, lower_node_code as string) → status as string
disconnect_nodes (upper_node_code as int, lower_node_code as int) → status as string
upper_node_code
The code of the upper (closer to root, farther from elemental alternatives) node.
lower_node_code
The code of the lower (closer to elemental alternatives, farther from root) node.
print_node (node_code as string) → node_description as string
print_node (node_code as int) → node_description as string
print_node () → node_description as string
node_code
The code of the relevant node. If omitted, will return a decription of all nodes in the model.
