---------------------------------------------- lines 5-88 of file: example/user/bnd_mulcov.py ---------------------------------------------- # {xrst_begin user_bnd_mulcov.py} # {xrst_spell # diff # } # {xrst_comment_ch #} # # Bounding Covariate Multipliers Absolute Data Effect # ################################################### # # Purpose # ******* # This example shows how to use the # :ref:`bnd_mulcov_command-name` . # # Integrands # ********** # For this example there is only one integrand, ``Sincidence`` . # # Nodes # ***** # There are two nodes, one called ``world`` and the other called # ``europe`` . # # True Iota # ********* # For this example, the true incidence rates for europe is given by # {xrst_spell_off} # {xrst_code py} import math mulcov_true = -3e-3 income_reference = 1e3 def iota_europe_true(income) : effect = mulcov_true * (income - income_reference) return 0.01 * math.exp( effect ) # {xrst_code} # {xrst_spell_on} # Here *europe_avg* contains the reference value for # income and weight in europe. # # Parent Node # *********** # For this example the parent node is europe and hence world data # is not included in the :ref:`data_subset_table-name` . # This demonstrates that the world node is not included when # the bnd_mulcov command computes its limits for the covariate multiplier. # # Data # **** # There are four data points measuring Sincidence. # The first point is for the world, has a very large income, and is # not included when computing the multiplier bounds. # # Model # ***** # There is only one rate *iota* and it is constant as a function # of age and time. In addition, there is one covariate multiplier # for income. # # bnd_mulcov # ********** # The maximum absolute effect for the this example are # {xrst_spell_off} # {xrst_code py} max_abs_effect = 1.0 # {xrst_code} # {xrst_spell_on} # Note that the bound on the covariate multiplier have units # while the maximum absolute effect does not. # # max_cov_diff # ************ # The income values in the europe data are # its reference, its reference divided by two, and its reference times two. # The corresponding maximum absolute difference from the # reference is equal to the reference. # # Source Code # *********** # {xrst_literal # BEGIN PYTHON # END PYTHON # } # # {xrst_end user_bnd_mulcov.py}