perform_bayesian_inference

autoeis.core.perform_bayesian_inference(circuits: DataFrame | Iterable[str] | str, freq: ndarray[float], Z: ndarray[complex], p0: Iterable[float] | Mapping[str, float] | Iterable[Iterable[float]] | Iterable[Mapping[str, float]] | None = None, priors: Mapping[str, Distribution] | None = None, num_warmup: int = 2500, num_samples: int = 1000, num_chains: int = 1, seed: int | Array | None = None, progress_bar: bool = True, refine_p0: bool = False) list[tuple[MCMC, int]]

Performs Bayesian inference on the circuits based on impedance data.

Parameters:
  • circuits (pd.DataFrame | Iterable[str] | str) – Dataframe containing circuits or list of circuit strings.

  • freq (np.ndarray[float]) – Frequency data corresponding to the impedance data.

  • Z (np.ndarray[complex]) – Impedance data as a complex array.

  • p0 (Iterable[float] | Mapping[str, float] | Iterable[Iterable[float]] | Iterable[Mapping[str, float]], optional) – Initial guess for the circuit parameters (default is None).

  • priors (Mapping[str, Distribution], optional) – Priors for the circuit parameters (default is None).

  • num_warmup (int, optional) – Number of warmup samples for the MCMC (default is 2500).

  • num_samples (int, optional) – Number of samples for the MCMC (default is 1000).

  • num_chains (int, optional) – Number of MCMC chains (default is 1).

  • seed (int, optional) – Random seed for reproducibility (default is None).

  • progress_bar (bool, optional) – If True, a progress bar will be displayed (default is True).

  • refine_p0 (bool, optional) – If True, the initial guess for the circuit parameters will be refined using the circuit fitter (default is False).

Returns:

List of MCMC objects and exit codes (0 if successful, -1 if failed).

Return type:

list[tuple[numpyro.infer.mcmc.MCMC, int]]