CompartmentTree.computeGSingleChanFromImpedance(channel_name, z_mat, e_eq, freqs, sv=None, weight=1.0, all_channel_names=None, other_channel_names=None, action='store')[source]

Fit the conductances of a single channel from the given impedance matrices, or store the feature matrix and target vector for later use (see action).

  • channel_name (str) – The name of the ion channel whose conductances are to be fitted

  • z_mat (np.ndarray (ndim=3)) – The impedance matrix to which the ion channel is fitted. Shape is (F, N, N) with N the number of compartments and F the number of frequencies at which the matrix is evaluated

  • e_eq (float) – The equilibirum potential at which the impedance matrix was computed

  • freqs (np.array) – The frequencies at which z_mat is computed (shape is (F,))

  • sv (dict or nested dict of float or np.array, or None (default)) – The state variable expansion point. If simple dict, assumes it is the expansion point of the channel that is fitted. If nested dict, the expansion points of multiple channels can be specified. None implies the asymptotic point derived from the equilibrium potential

  • weight (float) – The relative weight of the feature matrices in this part of the fit

  • all_channel_names (list of str or None) – The names of all channels whose conductances will be fitted in a single linear least squares fit

  • other_channel_names (list of str or None (default)) – List of channels present in z_mat, but whose conductances are already fitted. If None and ‘L’ is not in all_channel_names, sets other_channel_names to ‘L’

  • action ('fit', 'store' or 'return') – If ‘fit’, fits the conductances for this feature matrix and target vector for directly; only based on z_mat; nothing is stored. If ‘store’, stores the feature matrix and target vector to fit later on. Relative weight in fit will be determined by weight. If ‘return’, returns the feature matrix and target vector. Nothing is stored