Package SloppyCell :: Package ReactionNetworks :: Module PerfectData
[hide private]

Module PerfectData

source code


Methods for generating "perfect data" hessians.

Functions [hide private]
 
apply_func_to_traj(traj, func, only_nonderivs=False)
Return a trajectory with func applied to each variable stored in the...
source code
 
update_typical_vals(networks, int_times, rtol=1e-9, fraction=1.0, cutoff=1e-14)
Update the typical var values for a group of networks.
source code
 
typ_val_uncert(fraction=0.1, cutoff=1e-14)
This is an uncertainty that is fraction of the variable's typical value.
source code
 
discrete_data(net, params, pts, interval, vars=None, random=False, uncert_func=typ_val_uncert(0.1,1e-14))
Return a set of data points for the given network generated at the given parameters.
source code
 
hessian_log_params(sens_traj, data_ids=None, opt_ids=None, fixed_sf=False, return_dict=False, uncert_func=typ_val_uncert(1.0,1e-14))
Calculate the "perfect data" hessian in log parameters given a sensitivity trajectory.
source code
 
compute_sf_LMHessian_conts(sens_traj, data_ids, data_sigmas, opt_ids, fixed_sf) source code
 
get_intervals(traj) source code
 
get_sf_derivs(traj, dataId, data_sigma, optIds) source code
 
computeLMHessianContribution(traj, dataId, data_sigma, optIds, scaleFactorDerivs) source code
Variables [hide private]
  logger = logging.getLogger('RxnNets.PerfectData')

Imports: copy, logging, sets, scipy, Dynamics, HAVE_PYPAR, my_rank, my_host, num_procs, pypar


Function Details [hide private]

apply_func_to_traj(traj, func, only_nonderivs=False)

source code 

Return a trajectory with func applied to each variable stored in the
trajectory

update_typical_vals(networks, int_times, rtol=1e-9, fraction=1.0, cutoff=1e-14)

source code 

Update the typical var values for a group of networks.

Find the maximum of each variable over the integrations. In each network
the typical value is set to fraction of that maximum. If that maximum value
is less than cutoff, the typical value is set to 1.

networks    List of networks to work with
int_times   List of corresponding integration endpoints 
              (ie. [(0, 100), (0, 50)])
fraction    Relative size of typical value, compared to max value over
            the integrations.
rtol        Relative tolerance for the integrations.
cutoff      Values below this are considered to be zero

discrete_data(net, params, pts, interval, vars=None, random=False, uncert_func=typ_val_uncert(0.1,1e-14))

source code 

Return a set of data points for the given network generated at the given
parameters.

net         Network to generate data for
params      Parameters for this evaluation of the network
pts         Number of data points to output
interval    Integration interval
vars        Variables to output data for, defaults to all species in net
random      If False data points are distributed evenly over interval
            If True they are spread randomly and uniformly over each
            variable
uncert_func Function that takes in a trajectory and a variable id and
            returns what uncertainty should be assumed for that variable,
            either as a scalar or a list the same length as the trajectory.

hessian_log_params(sens_traj, data_ids=None, opt_ids=None, fixed_sf=False, return_dict=False, uncert_func=typ_val_uncert(1.0,1e-14))

source code 

Calculate the "perfect data" hessian in log parameters given a sensitivity
trajectory.

sens_traj   Sensitivity trajectory of Network being considered.
data_ids    A sequence of variable id's to assume we have data for. If 
            data_ids is None, all dynamic and assigned variables will be 
            used.
opt_ids     A sequence of parameter id's to calculate derivatives with 
            respect to. The hessian is (len(opt_ids) x len(opt_ids)).
            If opt_ids is None, all optimizable variables are considered.
fixed_sf    If True, calculate the hessian assuming fixed scale factors.
return_dict If True, returned values are (hess, hess_dict). hess_dict is a
            dictionary keyed on the elements of data_ids; each corresponding
            value is the hessian assuming data only on a single variable.
            hess is the sum of all these hessians
uncert_func Function that takes in a trajectory and a variable id and
            returns what uncertainty should be assumed for that variable,
            either as a scalar or a list the same length as the trajectory.