| Home | Trees | Indices | Help |
|
|---|
|
|
|
|||
| KeyedList | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
logger = logging.getLogger('Ensembles')
|
|||
Imports: logging, copy, shutil, sys, time, scipy, KeyedList_mod, Utility, HAVE_PYPAR, my_rank, my_host, num_procs, pypar
|
|||
Generate a Bayesian ensemble of parameter sets consistent with the data in
the model. The sampling is done in terms of the bare parameters.
Inputs:
(All not listed here are identical to those of ensemble_log_params.)
recalc_func --- Function used to calculate the hessian matrix. It should
take only a parameters argument and return the matrix.
If this is None, default is to use m.GetJandJtJ.
|
Generate a Bayesian ensemble of parameter sets consistent with the data in
the model. The sampling is done in terms of the logarithm of the parameters.
Inputs:
m -- Model to generate the ensemble for
params -- Initial parameter KeyedList to start from
hess -- Hessian of the model
steps -- Maximum number of Monte Carlo steps to attempt
max_run_hours -- Maximum number of hours to run
temperature -- Temperature of the ensemble
step_scale -- Additional scale applied to each step taken. step_scale < 1
results in steps shorter than those dictated by the quadratic
approximation and may be useful if acceptance is low.
sing_val_cutoff -- Truncate the quadratic approximation at eigenvalues
smaller than this fraction of the largest.
seeds -- A tuple of two integers to seed the random number generator
recalc_hess_alg --- If True, the Monte-Carlo is done by recalculating the
hessian matrix every timestep. This signficantly
increases the computation requirements for each step,
but it may be worth it if it improves convergence.
recalc_func --- Function used to calculate the hessian matrix. It should
take only a log parameters argument and return the matrix.
If this is None, default is to use
m.GetJandJtJInLogParameteters
save_hours --- If save_to is not None, the ensemble will be saved to
that file every 'save_hours' hours.
save_to --- Filename to save ensemble to.
skip_elems --- If non-zero, skip_elems are skipped between each included
step in the returned ensemble. For example, skip_elems=1
will return every other member. Using this option can
reduce memory consumption.
Outputs:
ens, ens_fes, ratio
ens -- List of KeyedList parameter sets in the ensemble
ens_fes -- List of free energies for each parameter set
ratio -- Fraction of attempted moves that were accepted
The sampling is done by Markov Chain Monte Carlo, with a Metropolis-Hasting
update scheme. The canidate-generating density is a gaussian centered on the
current point, with axes determined by the hessian. For a useful
introduction see:
Chib and Greenberg. "Understanding the Metropolis-Hastings Algorithm"
_The_American_Statistician_ 49(4), 327-335
|
The cost from the quadratic approximation of a trialMove, given the hessian. (Note: the hessian here is assumed to be the second derivative matrix of the cost, without an additional factor of 1/2.) |
Return the mean and standard deviation trajectory objects for the given input list of trajectories. (All must be evaluated at the same points.) |
Return the Principle Component Analysis eigenvalues and eigenvectors (in log parameters) of an ensemble. (This function takes the logs for you.) |
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Wed Jun 3 10:15:00 2009 | http://epydoc.sourceforge.net |