BGlib.gmode.analysis.utils.giv_utils.do_bayesian_inference¶
- BGlib.gmode.analysis.utils.giv_utils.do_bayesian_inference(i_meas, bias, freq, num_x_steps=251, r_extra=110, gam=0.03, e=10.0, sigma=10.0, sigmaC=1.0, num_samples=2000.0, show_plots=False, econ=False)[source]¶
this function accepts a Voltage vector and current vector and returns a Bayesian inferred result for R(V) and capacitance Used for solving the situation I = V/R(V) + CdV/dt to recover R(V) and C, where C is constant. :param i_meas: current values, should be in nA :type i_meas: 1D array or list :param bias: voltage values :type bias: 1D array or list :param freq: frequency of applied waveform :type freq: float :param num_x_steps: Number of steps in x vector (interpolating V) :type num_x_steps: unsigned int (Optional, Default = 251) :param r_extra: Extra resistance in the RC circuit that will provide correct current and resistance values :type r_extra: float (Optional, default = 220 [Ohms]) :param gam: gamma value for reconstruction :type gam: float (Optional, Default = 0.03) :param e: Ask Kody :type e: float (Optional, Default = 10.0) :param sigma: Ask Kody :type sigma: float (Optional, Default = 10.0) :param sigmaC: Ask Kody :type sigmaC: float (Optional, Default = 1.0) :param num_samples: Number of samples. 1E+4 is more than sufficient :type num_samples: unsigned int (Optional, Default = 1E4) :param show_plots: Whether or not to show plots :type show_plots: Boolean (Optional, Default = False) :param econ: Whether or not extra datasets are returned. Turn this on when running on multiple datasets :type econ: Boolean (Optional, Default = False)
- Returns:
results_dict (Dictionary) – Dictionary iterms are ‘x’ : 1D float array. Voltage vector interpolated with num_samples number of points ‘m’ : Ask Kody ‘mR’ : 1D float array. Bayesian inference of the resistance. This is the one you want ‘vR’ : 2D float array. varaiance ? of inferred resistance ‘Irec’ : 1D array or float. Reconstructed current without capacitance ‘Sigma’ : Ask Kody ‘cValue’ : float. Capacitance value ‘m2R’ : Ask Kody ‘SI’ : Ask Kody
Written by Kody J. Law (Matlab) and translated to Python by Rama K. Vasudevan