---------------------------------------------- lines 5-81 of file: example/user/hold_out_1.py ---------------------------------------------- # {xrst_begin user_hold_out_1.py} # {xrst_spell # exp # } # {xrst_comment_ch #} # # Using hold_out in Data, Subset Data, and Option Tables # ###################################################### # # Purpose # ******* # This example shows how to use hold_out in the # :ref:`data_table` , # :ref:`option_table` , and # :ref:`hold_out_command-name` . # # Integrands # ********** # For this example there are two integrand, # ``Sincidence`` and ``prevalence`` . # # Nodes # ***** # The node table is set up so that there are lots of child nodes # (with no data. This makes sure that the data being fit gets # evenly distributed between the nodes that do have data and # reaches :ref:`hold_out_command@max_fit` . # # Data # **** # # prevalence # ========== # All of the prevalence data is zero, but it is held out using # :ref:`option_table@hold_out_integrand` . # # Sincidence # ========== # There are many incidence data points. # The first Sincidence data value is zero and it is held out using # the data table :ref:`data_table@hold_out` equal to one. # The other Sincidence data are # the true value for incidence and have the data table hold_out # equal to zero. # There are four data points for each node, except the root node n0. # The :ref:`hold_out_command-name` is used to randomly select a subset of these # points to be held out using max_fit equal to two time the number of nodes. # # Model # ***** # There is only one rate *iota* and it is constant in age and time. # The corresponding model for the Sincidence data is *iota* . # The corresponding mode for the prevalence data is # 1 ``- exp`` ( *iota* * *age* ) . # # Fit # *** # Because the zero prevalence data and zero incidence data is held out, # the fitting value for *iota* is very close to the true value # for incidence. # # Parameters # ********** # you can change the following parameters in this test: # {xrst_literal # BEGIN_PARAMETERS # END_PARAMETERS # } # # Source Code # *********** # {xrst_literal # BEGIN PYTHON # END PYTHON # } # # {xrst_end user_hold_out_1.py}