\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
com_cov_reference¶
View page sourceCompute Covariate Reference Values¶
Compute covariate references by averaging values in the data table for a specific node and split reference value.
Prototype¶
# at_cascade.com_cov_reference
def com_cov_reference(
option_all_table ,
split_reference_table ,
node_table ,
covariate_table ,
shift_node_id ,
split_reference_id = None,
data_table = None,
) :
assert type(option_all_table) == list
assert type(split_reference_table) == list
assert type(node_table) == list
assert type(covariate_table) == list
assert type(shift_node_id) == int
assert type(split_reference_id) == int or split_reference_id == None
assert type(data_table) == list or data_table == None
# ...
assert type(cov_reference_list) == list
return cov_reference_list
option_all_table¶
The split_covariate_name and absolute_covariates rows of this table (if they exist) are the only rows of this table that are used.
split_reference_table¶
is the split_reference_table as a list
of dict .
node_table¶
This is a list of dict representing the node table in the root_database .
covariate_table¶
This is the covariate table for any fit or the one in the root node database.
shift_node_id¶
This is the dismod_at node that the computed covariate reference values correspond to.
split_reference_id¶
This is the split_reference_id that the computed covariate reference values correspond to.
cov_reference_list¶
The return value is a
listwith length equal to the length of the covariate table (in the root node database).The absolute_covariates have the same reference value as in the root_database .
The splitting covariate has reference value corresponding to split_reference_id in the split_reference table.
The Relative Covariate reference values are equal to the average of the corresponding covariates in the data table.
Only rows of the data table that get included when shift_node_id is the parent node are included in the average.
Only rows of the data that are within the max difference for the splitting covariate for this split_reference_id are included in the average.
null values for a covariate are not included in the average.
If there are no values to average for a relative covariate, the reference in the root_database covariate table is used for that covariate.