-------------------------------------------------- lines 6-134 of file: at_cascade/create_shift_db.py -------------------------------------------------- {xrst_begin create_shift_db} {xrst_spell dage dtime var } Create Database With Shifted Covariate References ################################################# Prototype ********* {xrst_literal # BEGIN_DEF # END_DEF } all_node_database ***************** is a python string containing the name of the :ref:`all_node_db-name`. fit_database ************ is a python string containing the name of a dismod_at database. This is a :ref:`glossary@fit_database` which has two predict tables (mentioned below). These tables are used to create priors in the child node databases. This argument can't be ``None``. fit_node ======== We use *fit_node* to refer to the parent node in the dismod_at option table in the *fit_database*. sample Table ============ This table is not used if *no_ode_fit* is true. If *no_ode_fit* is false, it contains the results of a dismod_at sample command for both the fixed and random effects. c_shift_avgint Table ==================== This is the :ref:`avgint_parent_grid-name` table corresponding to this fit_database. c_shift_predict_sample Table ============================ This table is not used if *no_ode_fit* is true. If *no_ode_fit* is false, it contains the predict table corresponding to a predict sample command using the c_shift_avgint table. Note that the predict_id column name was changed to c_shift_predict_sample_id (which is not the same as sample_id). c_shift_predict_fit_var Table ============================= This table contains the predict table corresponding to a predict fit_var command using the c_shift_avgint table. Note that the predict_id column name was changed to c_shift_predict_fit_var_id (which is not the same as var_id). shift_databases *************** We use the notation *shift_name* for the keys in this ``dict``. shift_name ========== For each *shift_name*, *shift_databases[shift_name]* is the name of a :ref:`glossary@input_node_database` that is created by this command. The corresponding directory is assumed to already exist. split_reference_name ==================== If *shift_name* is a :ref:`split_reference_table@split_reference_name`, the node corresponding to this shift database is the fit_node. Child Node ========== If *shift_name* is the node name for a child of fit_node, the child is the node corresponding to this shift database. Fit Node ======== If *shift_name* is the name of the *fit_node*, the node corresponding to this shift database is the fit_node. This case is used by :ref:`no_ode_fit-name` to create priors without shifting the covariate references. Value Priors ============ If the upper and lower limits are equal, the value priors in fit_database and the shift_databases are effectively the same. Otherwise the mean in the value priors are replaced using the corresponding values in the predict tables in the *fit_database*. If *no_ode_fit* is true (false), the standard deviations in the value priors are not replaced (are replaced). Note that if the value prior is uniform, the standard deviation is not used and the mean is only used to initialize the optimization. dage and dtime Priors ===================== The mean of the dage and dtime priors are replaced using the corresponding difference in the predict tables in the *fit_database*. Log Table ========= There is no log table in the shifted databases. no_ode_fit ********** If this argument is true (false) if the *fit_database* is (is not) the result of a :ref:`no_ode_fit-name` . If *no_ode_fit* is false, the sample table and the c_shift_predict_sample table must be in the *fit_database*. In this case both the means and standard deviations in the value priors are replaced using the results of the fit. Otherwise, only the means are replaced. job_table ********* If *no_ode_fit* is true this argument must be None. Otherwise it is the :ref:`create_job_table@job_table` for this cascade. {xrst_end create_shift_db}