pymcmcstat.chain package¶
pymcmcstat.chain.ChainProcessing module¶
Created on Tue May 1 09:12:06 2018
@author: prmiles
-
pymcmcstat.chain.ChainProcessing.
print_log_files
(savedir)[source]¶ Print log files to screen.
- Args:
- savedir (
str
): Directory where log files are saved.
- savedir (
The output display will include a date/time stamp, as well as indices of the chain that were saved during that export sequence.
Example display:
-------------------------- Display log file: <savedir>/binlogfile.txt 2018-05-03 14:15:54 0 999 2018-05-03 14:15:54 1000 1999 2018-05-03 14:15:55 2000 2999 2018-05-03 14:15:55 3000 3999 2018-05-03 14:15:55 4000 4999 --------------------------
-
pymcmcstat.chain.ChainProcessing.
read_in_bin_file
(filename)[source]¶ Read in information from file containing binary data.
If file exists, it will read in the array elements. Otherwise, it will return and empty list.
-
pymcmcstat.chain.ChainProcessing.
read_in_parallel_savedir_files
(parallel_dir, extension='h5', chainfile='chainfile', sschainfile='sschainfile', s2chainfile='s2chainfile', covchainfile='covchainfile')[source]¶ Read in log files from directory containing results from parallel MCMC simulation.
-
pymcmcstat.chain.ChainProcessing.
read_in_savedir_files
(savedir, extension='h5', chainfile='chainfile', sschainfile='sschainfile', s2chainfile='s2chainfile', covchainfile='covchainfile')[source]¶ Read in log files from directory.
pymcmcstat.chain.ChainStatistics module¶
Created on Thu Apr 26 10:23:51 2018
@author: prmiles
-
pymcmcstat.chain.ChainStatistics.
batch_mean_standard_deviation
(chain, b=None)[source]¶ Standard deviation calculated from batch means
-
pymcmcstat.chain.ChainStatistics.
chainstats
(chain=None, results=None, returnstats=False)[source]¶ Calculate chain statistics.
-
pymcmcstat.chain.ChainStatistics.
get_parameter_names
(nparam, results)[source]¶ Get parameter names from results dictionary.
If no results found, then default names are generated. If some results are found, then an extended set is generated to complete the list requirement. Uses the functions:
generate_default_names()
andextend_names_to_match_nparam()
-
pymcmcstat.chain.ChainStatistics.
geweke
(chain, a=0.1, b=0.5)[source]¶ Geweke’s MCMC convergence diagnostic
Test for equality of the means of the first a% (default 10%) and last b% (50%) of a Markov chain - see [brooks1998assessing].
- Args:
- Returns:
Note
The percentage of the chain should be given as a decimal between zero and one. So, for the first 10% of the chain, define
a = 0.1
. Likewise, for the last 50% of the chain, defineb = 0.5
.
-
pymcmcstat.chain.ChainStatistics.
integrated_autocorrelation_time
(chain)[source]¶ Estimates the integrated autocorrelation time using Sokal’s adaptive truncated periodogram estimator.
-
pymcmcstat.chain.ChainStatistics.
power_spectral_density_using_hanning_window
(x, nfft=None, nw=None)[source]¶ Power spectral density using Hanning window.
-
pymcmcstat.chain.ChainStatistics.
print_chain_statistics
(names, meanii, stdii, mcerr, tau, p)[source]¶ Print chain statistics to terminal window.
- Args:
Example display:
--------------------- name : mean std MC_err tau geweke $p_{0}$ : 1.9680 0.0319 0.0013 36.3279 0.9979 $p_{1}$ : 3.0818 0.0803 0.0035 37.1669 0.9961 ---------------------