----------------------------------------- lines 6-161 of file: example/remission.py ----------------------------------------- {xrst_begin_parent remission} {xrst_spell dage dtime } Example Estimation With Remission and No Incidence Data ####################################################### For this example everything is constant in time so the functions below do not depend on time. Nodes ***** The following is a diagram of the node tree for this example. The :ref:`glossary@root_node` is n0, the :ref:`glossary@fit_goal_set` is equal to the leaf set {n3, n4, n5, n6}:: n0 /-----/\-----\ n1 n2 / \ / \ n3 n4 n5 n6 fit_goal_set ============ {xrst_literal # BEGIN fit_goal_set # END fit_goal_set } Rates ***** The non-zero dismod_at rates for this example are :ref:`glossary@iota`, :ref:`glossary@rho`, and :ref:`glossary@omega`. For *rate* equal to iota, rho, and omega, we use *rate(a, n)* to denote the value for *rate* as a function of age *a* and node *n*. Covariate ********* There are not covariates for this example. Random Effects ************** For each node, there is a random effect on iota an rho that is constant in age and time. Note that the total effect for a leaf is the sum of its random effect plus its parents random effect. s_n === We use *s_n* to denote the sum of the random effects for node *n*. The code below sets this sum using the name sum_random: {xrst_literal # BEGIN sum_random # END sum_random } Simulated Data ************** Random Seed =========== The random seed can be used to reproduce results. If the original value of this setting is zero, the clock is used get a random seed. The actual value or *random_seed* is always printed. {xrst_literal # BEGIN random_seed # END random_seed } rate_true(rate, a, t, n, c) =========================== For *rate* equal to iota, rho, omega, this is the true value for *rate* in node *n* at age *a*, time *t*, and covariate values *c*. The time and covariate list are not used. {xrst_literal # BEGIN rate_true # END rate_true } y_i === The simulated integrand for this example are :ref:`glossary@Sincidence`, and :ref:`glossary@prevalence`. The data is simulated without any noise but it is modeled as having noise. n_i === Data is only simulated for the leaf nodes; i.e., each *n_i* is in the set { n3, n4, n5, n6 }. Since the data does not have any nose, the data residuals are a measure of how good the fit is for the nodes in the fit_goal_set. a_i === For each leaf node, data is generated on the following *age_grid*: {xrst_literal # BEGIN age_grid # END age_grid } Omega Constraints ***************** The :ref:`omega_constraint-name` routine is used to set the value of omega in the parent and child nodes. Parent Rate Smoothing ********************* iota ==== This is the smoothing used in the fit_node model for iota. Note that the value part of this smoothing is only used for the *root_node*. This smoothing uses the *age_gird* and one time point. There are no :ref:`glossary@dtime` priors because there is only one time point. Parent Rate Priors ================== The following is the value and dage priors used for the root_node {xrst_literal # BEGIN parent_prior # END parent_prior } The mean and standard deviation are only used for the root_node. The :ref:`create_shift_db-name` routine replaces them for other nodes. Child Rate Smoothing ******************** This is the smoothing used for the random effect for each child of the fit_node. There are no :ref:`glossary@dage` or dtime priors because there is only one age and one time point in this smoothing. Value Prior =========== The following is the value prior used for the children of the fit_node: {xrst_literal # BEGIN child_value_prior # END child_value_prior } Checking The Fit **************** The results of the fit are checked by check_cascade_node using the :ref:`check_cascade_node@avgint_table` that was created by the root_node_db routine. The node_id for each row is replaced by the node_id for the fit being checked. routine uses these tables to check that fit against the truth. {xrst_end remission}