check_cascade_node

View page source

Check the Cascade Results for a Node

Prototype

# at_cascade.check_cascade_node
def check_cascade_node(
         rate_true          ,
         all_node_database  ,
         fit_database  ,
         avgint_table       ,
         relative_tolerance = None,
) :
   assert type(all_node_database) == str
   assert type(fit_database) == str
   assert type(avgint_table) == list
   assert relative_tolerance == None or type(relative_tolerance) == float

rate_true

This argument is a function with the following syntax ` rate = rate_true(rate_name, a, t, n, c) `

rate_name

The argument rate_name is one of the following: iota, rho, chi, or omega.

a, t

The argument a ( t ) is the age ( time ) at which we are evaluating the rate.

n

The argument n is the node_name for the node where we are evaluating the rate.

c

The argument c is a list of covariate values in the same order as the covariate table.

rate

The result rate is the corresponding value for the rate.

all_node_database

is a python string specifying the location of the all_node_db relative to the current working directory.

fit_database

is a python string specifying the location of a dismod_at database relative to the current working directory. It is a fit_database with the extra properties listed under Output dismod.db in the cascade_root_node documentation.

avgint_table

This an avgint table specifying the predictions to check. The node_id in this table does not matter because the parent node in the fit_database is used in its place. The avgint table in the fit_database is replaced using this argument.

relative_tolerance

Is an upper bound for the relative error in the predictions corresponding to the avgint table. The error is the prediction using the true rates minus the prediction using the estimated rates. If this argument is None, the maximum relative error is printed. This is intended as an aid in setting the relative tolerance.