simrun
❭ synaptic_strength_fitting
❭ calculate_optimal_g
calculate_optimal_g¶
- simrun.synaptic_strength_fitting.calculate_optimal_g(pdf)¶
Calculate the optimal synaptic conductance such that the EPSP statistics match empirical data.
This function calculates the optimal synaptic conductance by matching empirically observed EPSP statistics (mean, median, maximum) to a linear model. Each statistic provides a different estimate of the optimal
g
. The final optimalg
is then a weighed average of the three statistics, where the weights formean:median:max
are2:2:1
respectively.This function is used in
PSPs
to calculate the optimal synaptic conductance for each celltype.- Parameters:¶
pdf (pd.DataFrame) – A table containing the empirical EPSP statistics (mean, median and maximum), and linear fits for each statistic.
- Returns:¶
None. Updates the original table inplace. Adds the columns
optimal g
,optimal g mean
,optimal g median
, andoptimal g max
.
See also
linear_fit_pdf()
for the linear model that relates the EPSP statistics to the synaptic conductance.Example:
>>> pdf = psp.get_summary_statistics(method='dynamic_baseline') >>> fit = linear_fit_pdf(pdf) >>> fit.head() EPSP mean_offset EPSP mean_slope EPSP med_offset EPSP med_slope EPSP max_offset EPSP max_slope EPSP_std_offset EPSP_std_slope ... >>> measured_data EPSP_mean_measured EPSP_med_measured EPSP_max_measured celltype_1 ... celltype_2 ... >>> pdf = pd.concat([fit, measured_data], axis=1) >>> calculate_optimal_g(pdf) >>> pdf[cell_type 1']['optimal g'] 1.85