\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
create_all_node_db¶
View page sourceCreate an All Node Database¶
Prototype¶
# at_cascade.create_all_node_db
def create_all_node_db(
all_node_database = None,
option_all = None,
fit_goal_table = None,
split_reference_table = None,
node_split_table = None,
mulcov_freeze_table = None,
omega_grid = None,
omega_data = None,
cov_reference_table = None,
) :
if fit_goal_table is None :
fit_goal_table = list()
if split_reference_table is None :
split_reference_table = list()
if node_split_table is None :
node_split_table = list()
if mulcov_freeze_table is None :
mulcov_freeze_table = list()
#
assert type(all_node_database) == str
assert type(option_all) == dict
assert type(fit_goal_table) == list
assert type(split_reference_table) == list
assert type(node_split_table) == list
assert type(mulcov_freeze_table) == list
assert type(cov_reference_table) == list or cov_reference_table == None
all_node_database¶
is a python string containing the name of the
all_node_db that is created by this call.
This argument can’t be None.
option_all¶
This argument can’t be None.
It is a dict with a key equal to each
option_name that appears in the
option_all table.
The value corresponding to the key is the
option_value
in the same row of the option_all_table.
Note that keys must have type str and all the values will be converted
to str.
fit_goal_table¶
This specifies the nodes in the fit_goal_table.
It must be a list of dict representation of the
fit_goal_table with one key for each dict.
If the key is node_id (node_name) the corresponding value is
the int ( str ) representation of the node.
If this argument is None, the fit_goal table is empty.
split_reference_table¶
This specifies the possible reference values for the splitting covariate.
It must be a list of dict representation of the
split_reference_table.
If this argument is None, the split_reference table is empty.
node_split_table¶
This specifies the nodes at which the cascade will split by the value
of the splitting covariate.
It must be a list of dict representation of the
node_split_table with one key for each dict.
If the key is node_id (node_name) the corresponding value is
the int ( str ) representation of the node.
If this argument is None, the node_split table is empty.
mulcov_freeze_table¶
This specifies the jobs at which the cascade will freeze specific
covariate multipliers.
If this argument is None, the node_split table is empty.
Otherwise, it must be a list of dict representation of the
mulcov_freeze_table .
We use row below to refer to a dict that is an entry in this list .
fit_node_id, fit_node_name¶
If row
["fit_node_id"]must beNoneif and only if the split_reference_table is empty.Otherwise if row
["fit_node_id"]exists it must be anintrepresentation of the fit_node_id for this job.Otherwise row
["fit_node_name"]is astrrepresentation of the corresponding node name.
split_reference_id¶
The value row["split_reference_id"] is an
int representation of the split_reference_id for this job or
row["split_reference_name"] is a
str representation of the corresponding split reference name.
mulcov_id¶
The value row["mulcov_id"] is an
int representation of the mulcov_id for the covariate multiplier
that is frozen.
omega_grid¶
is a dictionary with two keys age and time.
If this argument is None,
the omega_age_grid Table and
the omega_time_grid Table are empty.
age¶
The value omega_grid[age] is a list containing the
age_id values for the omega_grid.
These are indices in the
root_database age table.
We use the notation n_omega_age for the length of the age list.
time¶
The value omega_grid[time] is a list containing the
time_id values for the omega_grid.
These are indices in the root_database time table.
We use the notation n_omega_time for the length of the time list.
omega_data¶
This is a python dictionary with a key for each node name for the root_node and its descendant. The value omega_data[node_name] is a list. For each k, omega_data[node_name][k] is a list. For i equal 0, …, n_omega_age-1 and j equal 0, …, n_omega_time-1,
is the value of omega at the specified node,
the age corresponding to index i in omega_grid[age],
and time corresponding to index j in omega_grid[time].
If split_reference table is empty, k is zero.
Otherwise, let n_split be the length of the split_reference table.
For k equal 0, … , n_split-1, it specifies the value of
split_reference_id for the covariate value.
default¶
The omega_data argument is None if and only if omega_grid is None.
If omega_data is None the
omega_all Table and
omega_index Table will be empty.
cov_reference_table¶
This must be None or a list of dict representation of the
cov_reference_table.
If it None`, the com_cov_reference routine
is used to create the cov_reference table.