------------------------------------------------------ lines 7-68 of file: at_cascade/csv/covariate_spline.py ------------------------------------------------------ {xrst_begin csv.covariate_spline} {xrst_spell cov } Create Spline Functions For Covariates ###################################### Prototype ********* {xrst_literal , BEGIN_DEF, END_DEF BEGIN_RETURN, END_RETURN } covariate_table *************** Is a ``list`` of ``dict`` representation of a :ref:`csv.simulate@Input Files@covariate.csv` file. All of the keys in this ``dict`` are covariate names except for ``node_name`` , ``sex``, ``age`` , ``time`` and ``omega`` . All of the columns have been converted to type ``float`` except for *node_name* and *sex* which have type ``str`` . node_set ******** This is the set of nodes in :ref:`csv.simulate@Input Files@node.csv` age_grid ******** This is a sorted list of float containing the age values that are present for each node_name and sex. time_grid ********* This is a sorted list of float containing the time values that are present for each node_name and sex. spline_cov ********** This is a dict of dict of dict. Let spline be defined by for node_name in covariate_table for sex in covariate_table for cov_name a covariate name or omega spline = spline_cov[node_name][sex][cov_name] Then spline is the corresponding function of age and time; i.e., {xrst_code py} z = spline(age, time) {xrst_code} sets *z* to the value of the covariate or omega for the specified age, time, node_name, and sex where *age*, *time*, and *z* are floats. Side Effects ************ This routine aborts with an assert if covariate.csv does not have the same rectangular grid in age and time for each (node_name, sex) pair. {xrst_end csv.covariate_spline}