Package gmisclib :: Module mcmc_logtools
[frames] | no frames]

Module mcmc_logtools

source code

Classes
  onelog
Functions
tuple(dict(str:onelog), dict(str:str))
read_many_files(fnames, uid, Nsamp, tail, trigger)
OBSOLETE
source code
tuple(dict(str:onelog), dict(str:str))
read_uid_many_files(fnames, uid, Nsamp, tail, trigger)
Returns: a dictionary mapping filenames onto "data" and header information.
source code
 
get_pmap(per_fn) source code
 
list_prm_samples(per_fn, sample_selector, out) source code
 
indexer_covar(per_fn, sample_selector, weight_by_T=False) source code
 
logp_stdev(per_fn, sample_selector) source code
 
all(per_fn, source=None)
This selects all measurements.
source code
 
some_after_convergence(per_fn, source=None)
This selects which measurements will be used.
source code
 
near_each_max(per_fn, source=None)
This selects which measurements will be used.
source code
 
last(per_fn, source=None)
This selects which measurements will be used.
source code
 
each_best(per_fn, source=None)
This selects which measurements will be used.
source code
 
overall_best(per_fn, source=None)
This selects which measurements will be used.
source code
 
indexer_stdev(per_fn, selector, weight_by_T=False)
Return a summary of the properties of the selected indexers.
source code
 
print_index_error(ke) source code
 
drop_files(per_fn, FileDropFac, Trim=None, Stretch=None) source code
 
ascii_cmp(a, b)
Compares the ASCII form of keys, for sorting purposes.
source code
 
key_cmp(a, b)
Compares the tuple form of keys, for sorting purposes.
source code
 
P_bayes_list(per_fn, argv, m, arg, selector, hdr)
Log(PosteriorMarginalLikelihood) is the posterior marginal likelihood of this model: P_posterior[Data|model] = integral( P[D|params,model] * P[params|data,model] * d_params).
source code
 
P_bayes(per_fn, argv, m, arg, selector, hdr) source code
Variables
  FILE_DROP_FAC = 0.2
  TRIGGER = 'run_to_bottom finished'
  __package__ = 'gmisclib'

Imports: math, numpy, die, fiatio, gpkmisc, mcmc_logger, LG, IC


Function Details

read_many_files(fnames, uid, Nsamp, tail, trigger)

source code 

OBSOLETE

Returns: tuple(dict(str:onelog), dict(str:str))
a dictionary mapping filenames onto "data" and header information. Header information is from the last file read. The "data" are onelog class instances that encapsulate log information from one log file.

read_uid_many_files(fnames, uid, Nsamp, tail, trigger)

source code 
Returns: tuple(dict(str:onelog), dict(str:str))
a dictionary mapping filenames onto "data" and header information. Header information is from the last file read. The "data" are onelog class instances that encapsulate log information from one log file.

get_pmap(per_fn)

source code 
Parameters:

list_prm_samples(per_fn, sample_selector, out)

source code 
Parameters:

indexer_covar(per_fn, sample_selector, weight_by_T=False)

source code 
Parameters:

logp_stdev(per_fn, sample_selector)

source code 
Parameters:

some_after_convergence(per_fn, source=None)

source code 

This selects which measurements will be used. It looks after convergence, then throws out optimizations that haven't converged.

near_each_max(per_fn, source=None)

source code 

This selects which measurements will be used. It looks after convergence, then gives you the best few results from each run.

Parameters:

last(per_fn, source=None)

source code 

This selects which measurements will be used.

Parameters:

indexer_stdev(per_fn, selector, weight_by_T=False)

source code 

Return a summary of the properties of the selected indexers.

Parameters:

drop_files(per_fn, FileDropFac, Trim=None, Stretch=None)

source code 
Parameters:
  • per_fn - produced byLT.read_uid_many_files()

ascii_cmp(a, b)

source code 

Compares the ASCII form of keys, for sorting purposes. Does a good attempt at ASCII ordering for strings and numeric ordering for numbers.

key_cmp(a, b)

source code 

Compares the tuple form of keys, for sorting purposes. Does a good attempt at ASCII ordering for strings and numeric ordering for numbers.

P_bayes_list(per_fn, argv, m, arg, selector, hdr)

source code 

Log(PosteriorMarginalLikelihood) is the posterior marginal likelihood of this model: P_posterior[Data|model] = integral( P[D|params,model] * P[params|data,model] * d_params). It's the average of P[D|params,model] over the posterior distribution of P[params|data,model]*Prior(params).

References are:

  • Rampal S. Etienne, Han Olff (2005) Confronting different models of community structure to species-abundance data: a Bayesian model comparison Ecology Letters 8 (5) , 493-504 doi:10.1111/j.1461-0248.2005.00745.x

and that references

  • M. Aitkin 1991: Posterior Bayes Factors, J. of the Royal Statistical Soc. B 53: 111-142
  • P. W. Laud and J. G. Ibrahim 1995: Predictive Model Selection, J. of the Royal Statistical Soc. B 57: 247-262.
  • F. De Santis and F. Spezzaferri 1997: Alternative Bayes Factors for Model Selection, Canadian J. of Statistics 25: 503-515
  • S. K. Upadhyay and M. Peswani 2003: Choice between Weibull and Lognormal Models: a simulation based Bayesian Study Communications in Statistics: Theory and Methods 32: 318-405
  • P. K. Vlachos and A. E. Gelfand 2003: On the calibration of Bayeseian model choice criteria, J. of Statistical Planning and Inference 111: 223-234
  • R. E. Kass and A. E. Rafferty 1995: Bayes Factors, J. of the American Statistical Assoc. 90: 773-795

The other thing, Log(BayesWeightedBayes) is the average of P(D|params,M)*Prior(params) over the posterior distribution of P[params|data,model]*Prior(params). It has no real statistical backing, but it's a crude approximation for the Bayes evidence itself, the normalized P[params|data,model]*Prior(params).