odatse.scripts.plt_model_evidence module#
- odatse.scripts.plt_model_evidence.auto_range(beta, log_pdb, focus_factor=0.5)[source]#
Automatically calculate plot range focusing on the maximum model evidence region
- Parameters:
beta (np.ndarray) – Array of inverse temperature values
log_pdb (np.ndarray) – Array of log model evidence values
focus_factor (float) – Focus tightness factor (0 to 1). Smaller values result in tighter focus
- Returns:
Tuple containing (beta_min, beta_max, y_min, y_max)
- Return type:
tuple
- odatse.scripts.plt_model_evidence.calc_log_pdb(beta: ndarray, logz: ndarray, n_mu: ndarray, w_mu: ndarray, V: float) ndarray[source]#
Calculate the logarithm of the model evidence P(D;eta).
- Parameters:
beta (np.ndarray) – Array of inverse temperature values.
logz (np.ndarray) – Array of log evidence values.
n_mu (np.ndarray) – Number of data points for each spot.
w_mu (np.ndarray) – Relative weights for each spot.
V (float) – Normalization factor of prior probability distribution.
- Returns:
Array of log model evidence values.
- Return type:
np.ndarray
- odatse.scripts.plt_model_evidence.load_data(filename: str) tuple[source]#
Load beta and log evidence values from a data file.
- Parameters:
filename (str) – Path to the data file containing beta and log evidence values.
- Returns:
A tuple containing two numpy arrays: - beta: inverse temperature values - logz: log evidence values
- Return type:
tuple
- odatse.scripts.plt_model_evidence.main()[source]#
Main function to parse arguments and calculate model evidence.
Processes command line arguments, loads data files, calculates model evidence, and generates output files and plots.
- odatse.scripts.plt_model_evidence.plot_log_pdb(filename: str, beta: ndarray, log_pdb: ndarray, std: ndarray = None, auto_focus=False, focus_factor=0.5) None[source]#
Plot the model evidence as a function of beta.
- Parameters:
filename (str) – Path to save the plot. If None, the plot is displayed instead.
beta (np.ndarray) – Array of inverse temperature values.
log_pdb (np.ndarray) – Array of log model evidence values.
std (np.ndarray, optional) – Array of standard-deviation values for log model evidence. If provided, error bars are shown.
auto_focus (bool) – Whether to use automatic focus feature
focus_factor (float) – Auto-focus tightness (0 to 1)
- Return type:
None
- odatse.scripts.plt_model_evidence.print_log_pdb(filename: str, *data) None[source]#
Write model evidence data to a file.
- Parameters:
filename (str) – Path to the output file. If None, no file is written.
*data (tuple) – Variable length argument list containing: - beta: inverse temperature values - log_pdb: log model evidence values - std (optional): standard deviation of log model evidence values
- Return type:
None