--------------------------------------------------------- lines 6-89 of file: python/dismod_at/average_integrand.py --------------------------------------------------------- {xrst_begin average_integrand} {xrst_spell tol } Compute The Average Integrand ############################# Syntax ****** {xrst_literal # BEGIN_AVERAGE_INTEGRAND # END_AVERAGE_INTEGRAND } {xrst_literal # BEGIN_RETURN # END_RETURN } Purpose ******* The :ref:`predict_command-name` is a much faster way to calculate these values. This routine is easier to use and provides independent testing of the dismod_at integrators. rate_fun ******** This is a dictionary and it's possible keys are the :ref:`rate names` . If a *key* is a key in the dictionary, *value* = *rate_fun* [ *key* ]( *age* , *time* ) returns a float equal to the value of the specified rate at the specified age and time (where *age* and *time* are floats). Note that *age* will always be zero when evaluating *value* = *rate_fun* [ ``'pini'`` ]( *age* , *time* ) If a rate name is not in the *rate_fun*, the corresponding rate is zero. integrand_name ************** This string is one of the :ref:`integrand names` . grid **** This argument defines the grid for trapezoidal integration. (The dismod_at integrands are often non-smooth and so a low order integration method is called for.) The *grid* is a dictionary with the following keys: age === *grid* [ ``'age'`` ] is a list of floats containing the grid points for the average w.r.t. age. These points are monotone increasing, the first (last) point is the lower (upper) age limit for the average time ==== *grid* [ ``'time'`` ] is a list of floats containing the grid points for the average w.r.t. time. These points are monotone increasing, the first (last) point is the lower (upper) time limit for the average abs_tol ******* This float is an absolute error bound, that the integrator will achieve. avg *** The return value *avg* is the corresponding :ref:`average integrand` . {xrst_toc_hidden example/user/average_integrand.py } Example ******* The file :ref:`user_average_integrand.py-name` contains an example and test of this routine. {xrst_end average_integrand}