-------------------------------------------------- lines 5-451 of file: xrst/model/avg_integrand.xrst -------------------------------------------------- {xrst_begin avg_integrand} {xrst_spell ij ik jk mtall mtexcess mtother mtspecific mtstandard mtwith relrisk tincidence wbar } Model for the Average Integrand ############################### Ordinary Differential Equation ****************************** In the case where the :ref:`rates` do not depend on time, the dismod_ode ordinary differential equation is .. math:: :nowrap: \begin{eqnarray} S'(a) & = & - [ \iota(a) + \omega (a) ] S(a) + \rho(a) C(a) \\ C'(a) & = & + \iota(a) S(a) - [ \rho(a) + \chi(a) + \omega (a) ] C(a) \end{eqnarray} with the initial condition :math:`C(0) = p_0` and :math:`S(0) = 1 - p_0`. This equation is made more complicated by the fact that the rates vary with time as well as with each data point. The reason for the variation between data points due both to the :ref:`random effects` as well as the :ref:`mulcov_table@mulcov_type@rate_value` covariates. Data or Avgint Table Notation ***************************** i = We use :math:`i` to denote either, :ref:`data_table@data_id` for a row in the data table or, :ref:`avgint_table@avgint_id` for a row in the avgint table. a_i === We use :math:`a_i` to denote the corresponding *age_lower* in the :ref:`data table` or :ref:`avgint table` . b_i === We use :math:`b_i` to denote the corresponding *age_upper* in the :ref:`data table` or :ref:`avgint table` . c_i === We use :math:`c_i` to denote the corresponding *time_lower* in the :ref:`data table` or :ref:`avgint table` . d_i === We use :math:`d_i` to denote the corresponding *time_upper* in the :ref:`data table` or :ref:`avgint table` . s_i === We use :math:`s_i` to denote the corresponding *subgroup_id* in the :ref:`data table` or :ref:`avgint table` . g_i === We use :math:`g_i` to denote the :ref:`subgroup_table@group_id` that :math:`s_i` is part of. Covariate Difference, x_ij ========================== We use :math:`x_{i,j}` to denote the covariate difference for the *i*-th data point and the *j*-th covariate. Here *i* denotes a :ref:`data_table@data_id` in the data table and *j* denotes a :ref:`covariate_table@covariate_id` in the covariate table. The difference is the corresponding data table :ref:`covariate value` minus the covariate table :ref:`reference value` . w_i === We use :math:`w_i (a, t)` for the weighting as a function of age and time that corresponds to the :ref:`data_table@weight_id` for this *data_id* . n_i === We use :math:`n_i` to denote the corresponding :ref:`data_table@node_id` value. Rate Functions ************** Parent Rate, q_k ================ We use :math:`k` to denote a :ref:`rate_table@rate_id` and :math:`q_k (a, t)` the piecewise linear rate function for the corresponding to the :ref:`parent rate` . This is the model for the rate corresponding to the :ref:`option_table@Parent Node` and the reference value for the covariates; i.e. :math:`x_{i,j} = 0`. The adjusted rate :ref:`r_ik` is defined below. Child Rate Effect, u_ik ======================= If the node for this data point :math:`n_i` is a :ref:`child` node, or a descendant of a child node, :math:`u_{i,k} (a, t)` is the piecewise linear random effect for the corresponding :ref:`child and rate` . If :math:`n_i` is the parent node, there is no random effect for this data and :math:`u_{i,k} (a, t) = 0`. Otherwise :math:`n_i` is not the parent node or a descendant of the parent node and the corresponding data is not used. J_k === We use :math:`J_k` to denote the set of :ref:`mulcov_table@covariate_id` values in the mulcov table such that the corresponding :ref:`mulcov_table@rate_id` is equal to :math:`k`, :ref:`mulcov_table@mulcov_type` is ``rate_value`` , and :ref:`mulcov_table@group_id` equal to :math:`g_i`. These covariates that affect the *k*-th rate for this group of measurements. Group Rate Covariate Multiplier, alpha_jk ========================================= For each rate index :math:`k`, and each covariate index :math:`j \in J_k`, we use :math:`\alpha_{j,k} (a, t)` to denote the piecewise linear function corresponding to the :ref:`group covariate multiplier` . Note that these are :ref:`mulcov_table@mulcov_type@rate_value` covariate multipliers specified by the mulcov table. Subgroup Rate Covariate Multiplier, Delta alpha_jk ================================================== For each rate index :math:`k`, and each covariate index :math:`j \in J_k`, we use :math:`\Delta \alpha_{j,k} (a, t)` to denote the piecewise linear function corresponding to the :math:`s_i` :ref:`subgroup covariate multiplier` . Adjusted Rate, r_ik =================== We define the adjusted *k*-th rate for the *i*-th data point by .. math:: r_{i,k} (a , t) = \exp \left \{ u_{i,k} (a, t) + \sum_{j \in J(k)} x_{i,j} [ \alpha_{j,k} (a, t) + \Delta \alpha_{j,k} (a, t) ] \right \} q_k ( a, t ) If :math:`n_i` is the parent node, the random effects is zero :math:`u_{i,k} (a, t) = 0`. If this data point also has the reference value for the covariates, :math:`r_{i,k} (a, t) = q_k (a, t)`. pini, p_i0(t) ============= We use :math:`p_{i,0} (t)` to denote the model value (as apposed to a measurement value) for prevalence at the initial age as a function of time. Note that this function is constant with respect to age :math:`a`; see :ref:`rate_table@rate_name@pini` . This is denoted by :math:`r_{i,0} (a, t)` above. iota_i(a,t) =========== We use ``iota_i`` ( *a* , *t* ) and :math:`\iota_i (a,t)` to denote the model value for adjusted susceptible incidence as a function of age and time; see :ref:`rate_table@rate_name@iota` . This is denoted by :math:`r_{i,1} ( a, t )` above. rho_i(a,t) ========== We use ``rho_i`` ( *a* , *t* ) and :math:`\rho_i (a,t)` to denote the model value for adjusted remission as a function of age and time; see :ref:`rate_table@rate_name@rho` . This is denoted by :math:`r_{i,2} ( a, t )` above. chi_i(a,t) ========== We use ``chi_i`` ( *a* , *t* ) and :math:`\chi_i (a,t)` to denote the model value for adjusted excess mortality (mortality due to the cause) as a function of age and time. This is denoted by :math:`r_{i,3} ( a, t )` above. omega_i(a,t) ============ We use ``omega_i`` ( *a* , *t* ) and :math:`\omega_i (a,t)` to denote the model value for adjusted other cause mortality as a function of age and time; see :ref:`rate_table@rate_name@omega` . This is denoted by :math:`r_{i,4} ( a, t )` above. S_i(a,t) ******** We use :math:`S_i (a,t)` to denote the model value for susceptible fraction of the population. C_i(a,t) ******** We use :math:`C_i (a,t)` to denote the model value for with condition fraction of the population. Differential Equation ********************* We drop the subscript :math:`i` in the :ref:`adjusted rates` to simplify notation in the equations below. The with condition and susceptible fractions at age zero are .. math:: C (0, t) = p_0 (t) \; , \; S (0, t) = 1 - p_0 (t) We use :math:`c` to denote cohort; i.e., :math:`t = a + c`, Given the rates (initial prevalence is called a rate), the functions :math:`S (a,t)` and :math:`C (a,t)` for :math:`a > 0` are defined by .. math:: :nowrap: \begin{eqnarray} ( \B{d} / \B{d} a ) S(a, a+c) & = & - [ \iota (a, a+c) + \omega (a, a+c) ] S(a, a+c) + \rho(a, a+c) C(a, a+c) \\ ( \B{d} / \B{d} a ) C(a, a+c) & = & + \iota(a, a+c) S(a, a+c) - [ \rho(a, a+c) + \chi(a, a+c) + \omega(a, a+c) ] C(a, a+c) \end{eqnarray} Integrand, I_i(a,t) ******************* We use :math:`I_i (a, t)` to denote the integrand as a function of age and time. Depending on the value of see :ref:`data_table@integrand_id` for data index :math:`i`, the function :math:`I_i (a, t)` is defined below. The age and time arguments :math:`(a, t)` and the subscript :math:`i` are dropped to simplify notation. The rates are adjusted rates. (Integrands that do not use :math:`S`, :math:`C` or :math:`P`, do not require solving the differential equation.) Sincidence ========== The incidence rate relative to susceptible population is :math:`I = \iota`. remission ========= The remission rate is :math:`I = \rho`. mtexcess ======== The excess mortality rate is :math:`I = \chi`. mtother ======= The other cause mortality rate is :math:`I = \omega`. mtwith ====== The with condition mortality rate is :math:`I = \omega + \chi`. susceptible =========== The susceptible fraction of the population is :math:`I = S`. withC ===== The with condition fraction of the population is :math:`I = C`. prevalence ========== The prevalence of the condition is :math:`I = P = C / ( S + C )`. Tincidence ========== The incidence rate relative to the total population is :math:`I = \iota ( 1 - P )`. mtspecific ========== The cause specific mortality rate is :math:`I = \chi P`. mtall ===== The all cause mortality rate is :math:`I = \omega + \chi P`. mtstandard ========== The standardized mortality ratio is :math:`I = ( \omega + \chi ) / ( \omega + \chi P )`. relrisk ======= The relative risk is :math:`I = ( \omega + \chi ) / \omega`. mulcov ====== If the :ref:`integrand_table@integrand_name` is ``mulcov_`` *mulcov_id* , :math:`I` is the covariate multiplier corresponding to :ref:`mulcov_table@mulcov_id` . In this case there are no covariate that affect the measurement. Measurement Value Covariates **************************** K_i === We use :math:`K_i` to the set of :ref:`mulcov_table@covariate_id` values in the mulcov table such that the corresponding :ref:`mulcov_table@integrand_id` corresponds to :math:`I_i (a, t)`, :ref:`mulcov_table@mulcov_type` is ``meas_value`` , and :ref:`mulcov_table@group_id` equal to :math:`g_i`. These are the covariates that affect the *i*-th measurement value. Group Measurement Covariate Multiplier, beta_j ============================================== For each covariate index :math:`j \in K_i`, we use :math:`\beta_j (a, t)` to denote the piecewise linear function corresponding to the :ref:`group covariate multiplier` . Note that these are :ref:`mulcov_table@mulcov_type@meas_value` covariate multipliers specified by the mulcov table. Subgroup Measurement Covariate Multiplier, Delta beta_j ======================================================= For each covariate index :math:`j \in K_i`, we use :math:`\Delta \beta_j (a, t)` to denote the piecewise linear function corresponding to the :math:`s_i` :ref:`subgroup covariate multiplier` . Measurement Effect ================== The effect for the *i*-th measurement value, as a function of the fixed effects :math:`\theta`, is .. math:: E_i ( a, t ) = \sum_{j \in K_i} x_{i,j} [ \beta_j (a, t) + \Delta \beta_j (a, t) ] Adjusted Integrand ****************** The adjusted integrand is the following function of age and time: .. math:: I_i (a, t) \; \exp \left[ E_i (a, t) \right] Note that if :math:`I_i (a, t)` is a covariate multiplier :ref:`avg_integrand@Integrand, I_i(a,t)@mulcov` , the adjusted integrand is equal to :math:`I_i(a,t)`; i.e., there is no adjustment. Weight Integral, wbar_i *********************** We use :math:`\bar{w}_i` to denote the weight integral defined by .. math:: \bar{w}_i = \frac{1}{b_i - a_i} \frac{1}{d_i - c_i} \int_{a(i)}^{b(i)} \int_{c(i)}^{d(i)} w_i (a,t) \; \B{d} t \; \B{d} a Average Integrand, A_i ********************** We use :math:`u` and :math:`\theta` to denote the vector of :ref:`random effects` and :ref:`fixed effects` respectively. The model for the *i*-th measurement, not counting integrand effects or measurement noise, is .. math:: A_i ( u , \theta ) = \frac{1}{b_i - a_i} \frac{1}{d_i - c_i} \left[ \int_{a(i)}^{b(i)} \int_{c(i)}^{d(i)} \frac{ w_i (a,t) }{ \bar{w}_i } I_i (a, t) \; \exp \left[ E_i (a, t) \right] \; \B{d} t \; \B{d} a \right] \; Note that this is actually a weighted average of the integrand function :math:`I_i (a, t)` times the total measurement covariate effect :math:`E_i (a, t)` Also note that in the case where :math:`a(i) = b(i)`, :math:`c(i) = d(i)`, or both, the average is defined as the limiting value. {xrst_end avg_integrand}