------------------------------------------------- lines 5-68 of file: example/user/age_avg_split.py ------------------------------------------------- # {xrst_begin user_age_avg_split.py} # {xrst_comment_ch #} # # Non-uniform Age Average Grid # ############################ # # Purpose # ******* # This example demonstrate one reason for using the # :ref:`option_table@Age Average Grid@age_avg_split` option to create an # :ref:`age_avg_table@Age Average Grid` # that is not uniformly spaced. # # Variables # ********* # For this case there is only one rate *omega* for the parent node # and there are no other :ref:`model_variables-name` . # # Prior # ***** # The prior for *omega* is mean ``0.1`` and standard deviation # ``.01`` for ages ``0.0`` and ``0.9`` . # The prior for *omega* is mean ``0.01`` and standard deviation # ``0.001`` for ages ``1.1`` and ``100.0`` . # # Data # **** # There is no data for this model; i.e., the prior is the only # information available. # # Fit # *** # A fit is done, and this should make :ref:`fit_var_table-name` # equal to the mean of the prior. # # Predict # ******* # A predict is done for other cause mortality for two cases. # The first case averages over the age interval ``[ 0.0, 0.9 ]`` . # The second case averages over the age interval ``[ 1.1, 100.0 ]`` . # # ode_step_size # ************* # The :ref:`option_table@Age Average Grid@ode_step_size` is # ``50.0`` for this example. # If there were no *age_avg_split* , a linear approximation # would be used from age 0.0 to age 50. # # age_avg_split # ************* # The age average grid is split at age ``1.0`` ; i.e., # The age average grid points are ``0.0`` , ``1.0`` , ``50.0`` , and # ``100.0`` . # A piecewise linear function of age is used between these grid points. # (Note everything is constant w.r.t time for this case.) # # Source Code # *********** # {xrst_literal # BEGIN PYTHON # END PYTHON # } # # {xrst_end user_age_avg_split.py}