------------------------------------------ lines 5-135 of file: example/user/speed.py ------------------------------------------ # {xrst_begin user_speed.py} # {xrst_comment_ch #} # # A Simulate Data Speed Test # ########################## # # Syntax # ****** # # | *python3* ``example/user/speed.py`` \\ # | |tab| *random_seed* \\ # | |tab| *n_children* \\ # | |tab| *quasi_fixed* \\ # | |tab| *ode_step_size* \\ # | |tab| *n_data* \\ # | |tab| *max_fit* # # python3 # ******* # This is the :ref:`install_settings.py@python3_executable` # on your system. # # random_seed # *********** # is a non-negative integer specifying # the :ref:`option_table@random_seed` used during the simulation. # # n_children # ********** # is a non-negative positive integer specifying the number of # :ref:`option_table@Parent Node@Children` . # # quasi_fixed # *********** # This argument is ``true`` or ``false`` and specifies # :ref:`option_table@Optimize Fixed Only@quasi_fixed` # in the option table. # # ode_step_size # ************* # This argument is a floating point value and specifies the # :ref:`option_table@Age Average Grid@ode_step_size` # in the option table. # The total work for the test increases with proportional to the # square of this step size # # n_data # ****** # number of simulated data values # ( should be greater than *n_children* ). # # max_fit # ******* # There are two integrands in this example, Sincidence and prevalence. # Each one gets about half the data. # One suggested max_fit value is *n_data* / 4; see # :ref:`hold_out_command@max_fit` is set to # If *max_fit* equals *n_data* , all the data will be included. # # Fixed Effects # ************* # {xrst_code py} iota_parent_true = 0.05 rho_parent_true = 0.2 mulcov_income_iota_true = 1.0 mulcov_sex_rho_true = -1.0 # {xrst_code} # # iota_parent_true # ================ # the value of :ref:`rate_table@rate_name@iota` corresponding # to the parent node. # # rho_parent_true # =============== # the value of :ref:`rate_table@rate_name@rho` corresponding # to the parent node. # # mulcov_income_iota_true # *********************** # value of the multiplier for the income covariate that affects *iota* . # # mulcov_sex_rho_true # ******************* # value of the multiplier for the sex covariate that affects *rho* . # # eta # *** # value of the offset :ref:`statistic@Notation@eta` in the # log transformation: # {xrst_code py} eta = 1e-6 # {xrst_code} # # measure_cv # ********** # the coefficient of variation for the simulated measurement noise. # If you use a larger *measure_cv* you will probably need # a larger number of data points; see *n_data* and *max_fit* above. # {xrst_code py} measure_cv = 0.05 # {xrst_code} # # age_list # ******** # This following is both the :ref:`age_table-name` and the age # grid points for the parent rate smoothing of *iota* and *rho* . # The child rate smoothing has a grid point at the minimum # and maximum age below. # {xrst_code py} age_list = [ 0.0, 5.0, 15.0, 35.0, 50.0, 75.0, 90.0, 100.0 ] # {xrst_code} # # time_list # ********* # This following is both the :ref:`time_table-name` and the time # grid points for the parent rate smoothing of *iota* and *rho* . # The child rate smoothing has a grid point at the minimum # and maximum time below. # {xrst_code py} time_list = [ 1990.0, 2000.0, 2010.0, 2020.0 ] # {xrst_code} # # Source Code # *********** # {xrst_literal # BEGIN PYTHON # END PYTHON # } # # {xrst_end user_speed.py}