------------------------------------------ lines 5-75 of file: example/user/censor.py ------------------------------------------ # {xrst_begin user_censor.py} # {xrst_comment_ch #} # # Fitting Data That Has Negative Values Censored # ############################################## # # Purpose # ******* # This example uses the # :ref:`density_table@density_name@cen_gaussian` # density to represent data that is has its negative value replaced by zero. # # 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 matter for this problem # because all the functions are constant in age and time. # This can be seen by the fact that all of the smoothings have one age # and one time point. # # Variables # ********* # There is one model variable for this example *iota_true* # :ref:`iota` # the true value used to simulate the data. # # Rate Table # ********** # The :ref:`rate_table-name` only specifies that *iota* for the parent # is the only nonzero rate for this example. # In addition, it specifies the smoothing for that rate which has only # one grid point. Hence there is only one model variable corresponding to # the rates. # # Data Table # ********** # For this example, all the data is # :ref:`avg_integrand@Integrand, I_i(a,t)@Sincidence` , # with a Gaussian density, with mean *iota_true* # and standard deviation 2* *iota_true* . # The data is then censored, to be specific, # values below zero are replaced by the value zero. # # Prior Table # *********** # There is one prior in the :ref:`prior_table-name` for the only # model variable. # # Discussion # ********** # This fits two data sets. # The first is simulated using python and put in the :ref:`data_table-name` . # The second is simulated using the :ref:`simulate_command-name` # and put in the :ref:`data_sim_table-name` . # # Source Code # *********** # {xrst_literal # BEGIN PYTHON # END PYTHON # } # # {xrst_end user_censor.py}