\(\newcommand{\B}[1]{ {\bf #1} }\) \(\newcommand{\R}[1]{ {\rm #1} }\)
no_ode_fit¶
View page sourceDo A No Ode Fit For One Node¶
Prototype¶
# at_cascade.no_ode_fit
def no_ode_fit(
all_node_database ,
root_database ,
option_all_dict ,
fit_type ,
) :
assert type(all_node_database) == str
assert type(root_database) == str
assert type(option_all_dict) == dict
assert fit_type == 'fixed' or fit_type == 'both'
# ...
assert type(root_fit_database) == str
return root_fit_database
all_node_database¶
is a python string containing the name of the all_node_db.
root_database¶
is a python string specifying the location of the root_database.
option_all_dict¶
is a dict containing the values in the option_all table.
This dictionary has a key for each
option_name
and the corresponding value is
option_value.
If an option does not appear in the table, the corresponding key
does not appear in option_all_dict.
fit_type¶
is a str equal to both or fixed
(fit both fixed and random effect or just fixed effects).
no_ode_database¶
An intermediate database is stored in the file
result_dir/root_node_name/no_ode/dismod.db
see result_dir and root_node_name. This contains the results of fitting with only the integrand that do not require solving the ODE; i.e. Sincidence, remission, and mtexcess which measure iota, rho, and chi respectively. It also include relrisk which measures
( omega + chi ) / omega
These integrands are included even if they are held out in the root_fit_database using the hold_out_integrand option.
The integrand mtother is excluded because omega is constrained using omega_constraint.
The data likelihoods are fit as Gaussian using the dismod_at data_density command.
The results of fitting this data base can be converted to csv files and plotted using the dismod_at db2csv and plotting routines.
root_fit_database¶
The return value root_fit_database is equal to
result_dir/root_node_name/dismod.db
which can’t be the same file name as root_database. This is an input_node_database similar to root_database. The difference is that the mean value in the priors for the fixed effects have been replace by the optimal estimate for fitting with out the integrands that use the ODE. The last operation on this database is a dismod_at init command.