----------------------------------------------- lines 5-95 of file: example/user/predict_fit.py ----------------------------------------------- # {xrst_begin user_predict_fit.py} # {xrst_comment_ch #} # # Predict Average Integrand Using Results of a Fit # ################################################ # # Purpose # ******* # This examples used the :ref:`fit both` command # to estimate the model variables. # It then uses the :ref:`predict fit_var` # command to compute the # :ref:`avg_integrand@Integrand, I_i(a,t)@susceptible` # population :math:`S(a)` at age :math:`a = 50`. # # Note Table # ********** # :: # # north_america # / \ # united_states canada # # Problem Parameters # ****************** # The following values are used to simulate the data and set the priors # for fitting the data: # {xrst_literal # begin problem parameters # end problem parameters # } # # Age and Time Values # ******************* # The age and time values do not affect the fitting for this problem # because all the functions are constant in age and time. # This follows from the fact that all of the smoothings have one age # and one time point. # # Rate Table # ********** # The :ref:`rate_table-name` only specifies that the only # :ref:`var_table@var_type@rate` variables are # *iota* for the parent and children. # In addition, it specifies the smoothings for these rates # each of which has one grid point. # # Variables # ********* # There are three model variables in this example: # # .. list-table:: # :widths: auto # # * - *iota_north_america* # - The true value for # :ref:`iota(a,t)` in north_america. # * - *canada_effect* # - The true model value for the canada # :ref:`child rate effect` on iota. # * - *united_states_effect* # - The true model value for the united_states # :ref:`child rate effect` on iota. # # Integrand Table # *************** # The :ref:`integrand_table-name` for this example includes # :ref:`avg_integrand@Integrand, I_i(a,t)@Sincidence` and # :ref:`avg_integrand@Integrand, I_i(a,t)@susceptible` . # # Data Table # ********** # There are three measurements of *Sincidence* # in the :ref:`data_table-name` , one for each node. # No noise is added to the measurements, and the priors on # *iota* are uniform, so the fit should correspond to the # model values used to simulate the data. # # Avgint Table # ************ # There are three predictions of the susceptible population at # age 50 specified in the :ref:`avgint_table-name` , one for each node. # # Source Code # *********** # {xrst_literal # BEGIN PYTHON # END PYTHON # } # # {xrst_end user_predict_fit.py}