continue intro

This commit is contained in:
a.ott 2020-09-08 18:25:09 +02:00
parent b887b23c9f
commit 24e91a5601
3 changed files with 81 additions and 62 deletions

Binary file not shown.

View File

@ -110,26 +110,50 @@ Außerdem erkläre ich, dass die eingereichte Arbeit weder vollständig noch in
%Einleitung + Ergebnisse der Diskussion in kurz
\newpage
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Einleitung
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{Introduction}
\begin{enumerate}
\item sensory input important for all life etc.
\item electric fish
\begin{enumerate}
\item general: habitat,
\item as model animal for ethology
\item electric organ + eod
\item sensory neurons p- and t(?)-type
\end{enumerate}
\item sensory perception
\begin{enumerate}
\item receptor $\rightarrow$ heterogenic population EXAMPLE!
\item further analysis limited by what receptors code for - P-Units encoding
\item p-type neurons code AMs
\end{enumerate}
\item goal be able to simulate heterogenic population to analyze full coding properties $\rightarrow$ many cells at the same time needed $\rightarrow$ only possible in vitro/ with model simulations
\item Possible to draw representative values for model parameters to generate a population ?
\end{enumerate}
\newpage
The environment of an organism holds important information that it needs to survive, react to predators and find food or mates. That means that the ability to sense and process this information is of vital importance for any organism. At the same time the environment also contains a lot of information that is irrelevant to an organism, as such the sensory systems of an organism need to be specialized to extract the information it needs while filtering out the noise and irrelevant information \todo{ref}.
The electric fish \AptLepto (Brown ghost knife fish) generate a sinusoidal electric field with the electric organ in their tail, which they use to find prey, orientation and communication. The different use cases of this electric organ discharge (EOD) come with the necessity to detect small slow amplitude modulations (AMs) in their electric field to detect small prey like insect larvae while also coding for much stronger and faster AMs caused by the EODs of other electric fish in the area. The EOD and changes in it are encoded by electroreceptor organs in the skin. \lepto have two anatomically different kinds of tuberous electrosensory organs: the T and P type units \todo{ref, Zakon 1993}. Both types encode changes are strongly phase locked to the EOD. The T units (time coder) are more strongly locked to the EOD and fire regularly once every EOD period. They encode the phase of the EOD in their spike timing \todo{ref}. The P units (probability coders) on the other hand do not fire every EOD period instead they fire irregularly with a certain probability that depends on the EOD amplitude \todo{ref}. That way they encode information about the EOD amplitude in their firing probability \todo{ref}. An example of the firing behavior of a P unit is shown in figure~\ref{fig:p_unit_example}. An explanation how the different characteristics were computed is below. \todo{description of the full figure?}
%The calculation for the different characteristics is explained below. It shows in A a piece of the intracellular voltage recording in the axon of the P unit. In B the firing probability and the phase locking is visualized as the histogram over the interspike intervals (ISIs) and C \todo{...}
P units show strong adaption behavior to changes in EOD amplitude. After an increase in EOD frequency the firing rate increases strongly and then decays back to a steady state
%\begin{figure}[H]
%\floatbox[{\capbeside\thisfloatsetup{capbesideposition={left,top},capbesidewidth=0.49\textwidth}}]{figure}[\FBwidth]
%{\caption{\label{fig:p_unit_example} Example behavior of a p-unit with a high baseline firing rate. Baseline Firing: A 100\,ms voltage trace of the recording with spikes marked by the black lines. ISI-histogram: The histogram of the ISI with the x-axis in EOD periods, showing the phase locking of the firing. Serial Correlation: The serial correlation of the ISI showing a negative correlation for lags one and two. Step Response: The response of the p-unit to a step increase in EOD amplitude. In \todo{color} the averaged frequency over 10 trials and in \todo{color} smoothed with an running average with a window of 10\,ms. The p-unit strongly reacts to the onset of the stimulus but very quickly adapts to the new stimulus and then shows a steady state response. FI-Curve: The fi-curve visualizes the onset and steady-state response of the neuron for different step sizes (contrasts). In \todo{color} the detected onset responses and the fitted Boltzmann, in %\todo{color} the detected steady-state response and the linear fit.}}
%{\includegraphics[width=0.45\textwidth]{figures/p_unit_example.png}}
%\end{figure}
%
\begin{figure}[H]
{\caption{\label{fig:p_unit_example} Example behavior of a p-unit with a high baseline firing rate. Baseline Firing: A 100\,ms voltage trace of the recording with spikes marked by the black lines. ISI-histogram: The histogram of the ISI with the x-axis in EOD periods, showing the phase locking of the firing. Serial Correlation: The serial correlation of the ISI showing a negative correlation for lags one and two. Step Response: The response of the p-unit to a step increase in EOD amplitude. In \todo{color} the averaged frequency over 10 trials and in \todo{color} smoothed with an running average with a window of 10\,ms. The p-unit strongly reacts to the onset of the stimulus but very quickly adapts to the new stimulus and then shows a steady state response. FI-Curve: The fi-curve visualizes the onset and steady-state response of the neuron for different step sizes (contrasts). In \todo{color} the detected onset responses and the fitted Boltzmann, in \todo{color} the detected steady-state response and the linear fit.}}
{\caption{\label{fig:p_unit_example} Example behavior of a p-unit with a high baseline firing rate and an EODf of 744\,Hz. \textbf{A}: A 100\,ms voltage trace of the baseline recording with spikes marked by the black lines. \textbf{B}: The histogram of the ISI with the x-axis in EOD periods, showing the phase locking of the firing. \textbf{C}: The serial correlation of the ISI showing a negative correlation for lags one and two. \textbf{D}: The response of the p-unit to a step increase in EOD amplitude. In \todo{color} the averaged frequency over 10 trials. The p-unit strongly reacts to the onset of the stimulus but very quickly adapts to the new stimulus and then shows a steady state response. \textbf{E}: The fi-curve visualizes the onset and steady-state response of the neuron for different step sizes (contrasts). In \todo{color} the detected onset responses and the fitted Boltzmann, in \todo{color} the detected steady-state response and the linear fit.}}
{\includegraphics[width=0.9\textwidth]{figures/p_unit_example.png}}
\end{figure}
@ -188,40 +212,13 @@ V_{Stim}(t) = EOD(t)(1 + AM(t))
\begin{figure}[H]
\floatbox[{\capbeside\thisfloatsetup{capbesideposition={left, center}, capbesidewidth=0.45\textwidth}}]{figure}[\FBwidth]
{\caption{\label{fig:stim_examples} Example of the stimulus construction. At the top a recording of the fish's EOD. In the middle: EOD recording multiplied with the AM, with a step from 0 to a contrast of 30\,\% between 0 and 50\,ms (marked in \todo{color}). At the bottom the resulting stimulus trace when the AM is added to the EOD. \todo{Umformulieren}}}
{\caption{\label{fig:stim_examples} Example of the stimulus construction. At the top a recording of the fish's EOD. In the middle: EOD recording multiplied with the AM, with a step between 0 and 50\,ms to a contrast of 30\,\% (marked in \todo{color}). At the bottom the resulting stimulus trace when the AM is added to the EOD. \todo{Umformulieren}}}
{\includegraphics[width=0.45\textwidth]{figures/amGeneration.pdf}}
\end{figure}
All step stimuli consisted of a delay of 0.2\,s followed by a 0.4\,s (n=68) or 1\,s (n=7) long step and a 0.8\,s long recovery time. The contrast range measured was for the most cells 80--120\% of EOD amplitude. Some cells were measured in a larger range up to 20--180\%. In the range at least 7 contrasts were measured with at least 7 trials, but again many cells were measured with more contrasts and trials. The additionally measured contrasts were used for the model if they had at least 3 trials.
%That means for every cell the FI-Curve was measured at at least 7 Points each with at least 7 trials. If more contrasts were measured during the recording the additional information was used as long as there were at least 3 trials available.
%All presentations had 0.2\,s delay at the start and then started the stimulus at time 0. The step stimulus was presented for 0.4\,s (7 cells) or 1\,s(68 cells) and followed by 0.8\,s time for the cell to recover back to baseline.
% Always a 0.2 second delay and 0.8 seconds after stimulus
% Stimulus start at time=0
% step duration 0.4s (7times) and 1s (68 times)
% contrast ranges maximal -0.8-0.8, contrasts tested 8-23
% most common -0.2 - 0.2 with 7 or 9 contrasts
%\begin{figure}[H]
% \centering
% \begin{minipage}{0.49\textwidth}
% \raisebox{70mm}{\large\sffamily A}
% \includegraphics[width=0.95\textwidth]{figures/amGeneration.pdf}
% \end{minipage}\hfill
% \begin{minipage}{0.49\textwidth}
% \raisebox{70mm}{\large\sffamily B}
% \includegraphics[width=\textwidth]{figures/stimuliExamples.pdf}
% \end{minipage}
% \caption{use real EOD data? A) B) \todo{(remove SAM stimulus/ the B full figure)} %\label{fig:stim_examples}}
%\end{figure}
\subsection{Cell Characteristics}
@ -264,16 +261,16 @@ Finally the ISI-histogram was calculated within a range of 0--50\,ms and a bin s
\begin{figure}[H]
\centering
% trim={<left> <lower> <right> <upper>}
\parbox[c][0mm][t]{80mm}{\hspace{-10.5mm}\large\sffamily A\hspace{50.5mm} \large\sffamily B}
%\raisebox{70mm}[10]{\large\sffamily A)}\hspace{50mm}\raisebox[10]{70mm}{\large\sffamily B)}
%\parbox[c][0mm][t]{80mm}{\hspace{-10.5mm}\large\sffamily A\hspace{50.5mm} \large\sffamily B}
%\raisebox{70mm}[10]{\large\sffamily A)}
\includegraphics[trim={10mm 5mm 10mm 5mm}, scale=0.8]{figures/f_point_detection.png}
\caption{\label{fig:f_point_detection} \textbf{A}: The averaged response of a cell to a step in EOD amplitude. The step of the stimulus is marked by the back bar. The detected values for the onset ($f_0$) and steady-state ($f_{\infty}$) response are marked in \todo{color}. $f_0$ is detected as the highest deviation from the mean frequency before the stimulus while $f_{\infty}$ is the average frequency in the 0.1\,s time window, 25\,ms before the end of the stimulus. \textbf{B}: The fi-curve visualizes the onset and steady-state response of the neuron for different stimuli contrasts. In \todo{color} the detected onset responses and the fitted Boltzmann, in \todo{color} the detected steady-state response and the linear fit.}
\end{figure}
The adaption behavior \todo{explain adaption behavior/ ref the introduction} of the cell was characterized by the fi-curve measurements result in the onset ($f_0$) and steady-state ($f_{\infty}$) response. First the ISI frequency trace for each stimulus was calculated. The ISI frequency of a time point t is defined as $1/T_i$ with $T_i$ the ISI the time point t falls into. This gives a frequency trace starting with the first spike and ending at the last spike. For further analysis all trials of a specific contrast were averaged \todo{with the time resolution of the sampling rate} after cutting them to the same length. This results in a trial-averaged step response for each contrast as illustrated in figure \ref{fig:f_point_detection} A.
In this firing frequency trace the onset $f_0$ and steady-state $f_{\infty}$ response were detected. \todo{explain baseline frequency} $f_0$ was defined as the largest deviation from the baseline frequency before the stimulus, within the first 25\,ms after stimulus onset. If there was no deviation farther than the minimum or maximum before the stimulus, then the average frequency in that time window was used. This approximation made the detection of $f_0$ more stable for small contrasts and trials with high variation.
As already mentioned in the introduction, p-units react to a step in EOD amplitude with a strong onset response decaying back to a steady state response (fig.~\ref{fig:f_point_detection}~A). This adaption behavior of the cell was characterized by the f-I curve measurements. First the ISI frequency trace for each stimulus was calculated. The ISI frequency of a time point t is defined as $1/T_i$ with $T_i$ the ISI the time point t falls into. This gives a frequency trace starting with the first spike and ending at the last spike. For further analysis all trials of a specific contrast were averaged over the trials with the resolution of the sampling rate. This results in a trial-averaged step response for each contrast as illustrated in figure \ref{fig:f_point_detection}~A.
In this firing frequency trace the baseline frequency, the onset $f_0$ and steady-state $f_{\infty}$ response were detected. The baseline frequency was measured as the mean of the firing frequency 25\,ms after recording start up to 25\,ms before the stimulus start. $f_0$ was then defined as the largest deviation from the baseline frequency, within the first 25\,ms after stimulus onset. If there was no deviation farther than the minimum or maximum before the stimulus start, then the average frequency in that 25\,ms time window was used. This approximation made the detection of $f_0$ more stable for small contrasts and trials with high variation.
The $f_{\infty}$ response was estimated as the average firing frequency in the 100\,ms time window ending 25\,ms before the end of the stimulus (fig. \ref{fig:f_point_detection} A).
Afterwards a Boltzmann:
\begin{equation}
@ -283,7 +280,7 @@ was fitted to the onset response and a rectified line:
\begin{equation}
f_{\infty}(I) = \lfloor mI+c \rfloor_0
\end{equation}
(with $\lfloor x \rfloor_0$ the rectify operator) was fitted to the steady-state responses (FI-Curve fig. \ref{fig:f_point_detection} B).
(with $\lfloor x \rfloor_0$ the rectify operator) was fitted to the steady-state responses (fig.~\ref{fig:f_point_detection}~B).
@ -293,32 +290,47 @@ f_{\infty}(I) = \lfloor mI+c \rfloor_0
% add info about simulation by euler integration and which time steps!
% show voltage dynamics with resistance :
The above described cell characteristics need to be reproduced by a simple and efficient model to be able to simulate bigger populations in a reasonable time. The simplest commonly used neuron model is the perfect integrate-and-fire (PIF) model. It's voltage can be described in one equation: $\tau_m \frac{dV}{dt} = \frac{I}{R_m}$ with $I$ the stimulus current, $R_m$ the membrane resistance and a voltage threshold $V_\theta$. In this model $I$ is integrated and when this threshold $\theta$ is reached the voltage is reset to zero and a spike is recorded (see fig. \ref{fig:model_comparison} PIF). The model is useful for basic simulations but cannot reproduce the richer behavior of the p-units, as it has neither a memory of previous spikes that could cause the negative serial correlation between successive spikes nor can it show any adaption behavior.
The above described cell characteristics need to be reproduced by a simple and efficient model to be able to simulate bigger populations in a reasonable time. The model used in this thesis follows these equations:
The next slightly more complex model is the leaky integrate-and-fire (LIF) model. As the name suggests it adds a leakage current to the PIF and as follows the equation \ref{eq:basic_voltage_dynamics} (fig. \ref{fig:model_comparison} LIF). The leakage current adds sub threshold behavior to the model but still cannot reproduce the adaption or serial correlation.
\begin{align}
\tau_m \frac{dV}{dt} &= -V+I_{Bias} +\alpha V_{dend} - I_{A} + \sqrt{2D}\frac{\xi}{\sqrt{\Delta t}} \label{eq:full_model_dynamics_voltage} \\
\tau_A \frac{dI_A}{dt} &= -I_A + \Delta_A \sum \delta (t) \label{eq:full_model_dynamics_adaption} \\
\tau_{dend} \frac{dV_{dend}}{dt} &= -V_{dend} + \lfloor V_{stim} \rfloor_0 \label{eq:full_model_dynamics_dendrite}
\end{align}
Equation \ref{eq:full_model_dynamics_voltage} describes the leaky dynamics of the membrane voltage with $\tau_m$ the membrane time constant, $I_{Bias}$ a bias current, $\alpha$ the cell specific gain factor for $V_{dend}$ the input voltage coming from the dendrite. $\sqrt{2D}$ is the strength of the normal distributed noise $\xi$. $I_A$ is an adaption current with the dynamics of equation~\ref{eq:full_model_dynamics_adaption}. $\tau_A$ is the time constant of the adaption, $\Delta_A$ its strength and $\delta (t)$ is the spike train of the cell. Equation~\ref{eq:full_model_dynamics_dendrite} shows the dynamics of the synapse and dendrite with $\tau_{dend}$ the time constant of the dendrite and $\lfloor V_{stim} \rfloor_0$ the rectified stimulus given. Finally the model also includes a refractory period $t_{ref}$, not shown in above equations, that keeps the membrane voltage $V$ at zero for its duration.
To arrive at this model the simplest commonly used neuron model the perfect integrate-and-fire (PIF) model was stepwise extended. The PIF's voltage can be described in one equation: $\tau_m \frac{dV}{dt} = \frac{I}{R_m}$ with $I$ the stimulus current, $R_m$ the membrane resistance and a voltage threshold $V_\theta$. In this model $I$ is integrated and when this threshold $\theta$ is reached the voltage is reset to zero and a spike is recorded (see fig. \ref{fig:model_comparison} PIF). The model is useful for basic simulations but cannot reproduce the richer behavior of the p-units, as it has no memory of previous spikes so it cannot show any adaption behavior and it is also very strongly locked to its limit cycle producing very constant ISI, not allowing the firing flexibility of the p-units.
The next slightly more complex model is the leaky integrate-and-fire (LIF) model:
\begin{equation}
\tau_m \frac{dV}{dt} = -V + IR_m
\label{eq:basic_voltage_dynamics}
\end{equation}
As the name suggests it adds a leakage current to the PIF (fig.~\ref{fig:model_comparison} LIF). The leakage current adds sub threshold behavior to the model and allows for some more flexibility in suprathresold firing but it is still not flexible enough and cannot reproduce the adaption.
To reproduce this behavior the model needs some form of memory of previous spikes. There are two main ways this can be added to the model as an adaptive current or a dynamic threshold. The biophysical mechanism of the adaption in p-units is unknown because the cell bodies are not accessible for intra-cellular recordings. Following the results of \cite{benda2010linear} a negative adaptive current was chosen, because the dynamic threshold causes divisive adaption instead of the subtractive adaption of p-units \citep{benda2005spike}. This results in an leaky integrate-and-fire model with adaption current (LIFAC) (fig. \ref{fig:model_comparison} LIFAC). The added adaptive current follow the dynamics:
To reproduce the adaption behavior the model needs some form of memory of previous spikes. There are two main ways this can be added to the model as an adaptive current or a dynamic threshold. The biophysical mechanism of the adaption in p-units is unknown because the cell bodies are not accessible for intra-cellular recordings. Following the results of \cite{benda2010linear} a negative adaptive current was chosen, because the dynamic threshold causes divisive adaption instead of the subtractive adaption of p-units seen in \cite{benda2005spike}. This results in an leaky integrate-and-fire model with adaption current (LIFAC) (fig.~\ref{fig:model_comparison} LIFAC). The added adaptive current follow the dynamics:
\begin{equation}
\tau_A \frac{dI_A}{dt} = -I_A + \Delta_A \sum \delta (t)
\label{eq:adaption_dynamics}
\end{equation}
It is modeled as an exponential decay with the time constant $\tau_A$ and a strength called $\Delta_A$. $\Delta_A$ is multiplied with the sum of spikes $t_i$ in the spike train ($\delta (t_i)$) of the model cell. For the simulation using the Euler integration this results in an increase of $I_A$ by $\frac{\Delta_A}{\tau_A}$ at every time step where a spike is recorded. \todo{image of model simulation with voltage adaption and spikes using the toy model} The current of the from equation \ref{eq:basic_voltage_dynamics} can thus be split into three currents for the modeling of the neuron:
and gets subtracted from the input current $I$ of of the voltage dynamics eq.~\ref{eq:basic_voltage_dynamics}. It is modeled as an exponential decay with the time constant $\tau_A$ and an adaption strength $\Delta_A$. $\Delta_A$ is multiplied with the sum of spikes $t_i$ in the spike train ($\delta (t_i)$) of the model cell. For the simulation using the Euler integration this results in an increase of $I_A$ by $\frac{\Delta_A}{\tau_A}$ at every time step where a spike is recorded. \todo{image of model simulation with voltage adaption and spikes using the toy model?} The input current $I$ from equation \ref{eq:basic_voltage_dynamics} is a sum of those two currents and an additional bias current $I_{Bias}$ that is needed to adjusts the cells spontaneous spiking:
\begin{equation}
I = \alpha I_{Input} - I_A + I_{Bias}
\label{eq:currents_lifac}
\end{equation}
The stimulus current $I_{Input}$, the bias current $I_{Bias}$ and the already discussed adaption current $I_A$. Note that in this p-unit model all currents are measured in mV because as mentioned above the cell body is not accessible for intra-cellular recordings and as such the membrane resistance $R_m$ is unknown \todo{ref mem res p-units}. $I_{Input}$ is the current of the stimulus, an amplitude modulated sine wave mimicking the frequency EOD. This stimulus is then rectified to model the receptor synapse and low-pass filtered with a time constant of $\tau_{dend}$ to simulate the low-pass filter properties of the dendrite (fig. \ref{fig:stim_development}). Afterwards it is multiplied with $\alpha$ a cell specific gain factor. This gain factor has the unit of cm because the $I_{Input}$ stimulus represents the EOD with a unit of mV/cm. $I_{Bias}$ is the bias current that adjusts the cells spontaneous spiking.
Note that in this p-unit model all currents are measured in mV because, as mentioned above, the cell body is not accessible for intra-cellular recordings and as such the membrane resistance $R_m$ is unknown \todo{ref mem res p-units}. The input current $I_{Input}$ is the current of the stimulus, an amplitude modulated sine wave mimicking the frequency EOD. This stimulus is then rectified to model the receptor synapse and low-pass filtered with a time constant of $\tau_{dend}$ to simulate the low-pass filter properties of the dendrite (fig. \ref{fig:stim_development}) according to:
\begin{equation}
\tau_{dend} \frac{dV_{dend}}{dt} = -V_{dend} + \lfloor I_{Input} \rfloor_0
\end{equation}
Afterwards it is multiplied with $\alpha$ a cell specific gain factor. This gain factor has the unit of cm because the $I_{Input}$ stimulus represents the EOD with a unit of mV/cm.
Finally, noise and an absolute refractory period were added to the model. The noise $\xi$ is drawn from a Gaussian noise distribution and divided by $\sqrt{\Delta t}$ to get a noise which autocorrelation function is independent of the simulation step size $\Delta t$. The implemented form of the absolute refractory period $t_{ref}$ keeps the model voltage at zero for the duration of $t_{ref}$ after a spike.
Finally, noise and an absolute refractory period were added to the model. The noise $\xi$ is drawn from a Gaussian noise distribution and divided by $\sqrt{\Delta t}$ to get a noise which autocorrelation function is independent of the simulation step size $\Delta t$. The implemented form of the absolute refractory period $t_{ref}$ keeps the model voltage at zero for the duration of $t_{ref}$ after a spike. This gives us the full model described in equations \ref{eq:full_model_dynamics_voltage}--\ref{eq:full_model_dynamics_dendrite}.
\begin{figure}[H]
@ -328,13 +340,7 @@ Finally, noise and an absolute refractory period were added to the model. The no
\end{figure}
Together this results in the dynamics seen in equation \ref{eq:full_voltage_dynamics}. Not shown in the equation is the refractory period $t_{ref}$ and the $\tau_{dend}$ \todo{move to the start.}.
\begin{align}
\tau_m \frac{dV}{dt} &= -V+I_{Bias} +\alpha V_d - I_{A} + \sqrt{2D}\frac{\xi}{\sqrt{\Delta t}} \label{eq:full_model_dynamics_voltage} \\
\tau_A \frac{dI_A}{dt} &= -I_A + \Delta_A \sum \delta (t) \label{eq:full_model_dynamics_adaption} \\
\tau_d \frac{dV_d}{dt} &= -V_d + \lfloor V_{stim} \rfloor_0 \label{eq:full_model_dynamics_dendrite}
\end{align}
Together this results in the dynamics seen in equations \ref{eq:full_model_dynamics_voltage}--\ref{eq:full_model_dynamics_dendrite}.
@ -366,22 +372,20 @@ Together this results in the dynamics seen in equation \ref{eq:full_voltage_dyna
\subsection{Fitting of the Model}
%überleitung!
The full model has, as described above, eight parameters that need to be fitted so it can reproduce the behavior of the cell. During the fitting and the analysis all models were integrated with at time step of 0.05\,ms.
The stimuli described in the stimulus protocols section above were recreated for the stimulation of the model during the fitting process. The pure fish EOD was approximated by a simple sine wave of the appropriate frequency, but it was decided to keep the amplitude of the sine wave at one to make the models more comparable. Changes in the amplitude can be compensated for by changing the input scaling factor so there is no qualitative difference.
% describe used errors
% describe Nelder Mead
This leaves the eight parameters to be fitted to the cell. During the fitting and the analysis all models were simulated with at time step of 0.05\,ms.
The stimuli as described in the stimulus protocols section above were recreated for the stimulation of the model during the fitting process. The pure fish EOD was approximated by a simple sin function of the appropriate frequency, but it was decided to keep the amplitude of the sin at one to make the models more comparable. Changes in the amplitude can be compensated in the model by changing the input scaling factor and the time constant of the dendritic low-pass filter, so there is no qualitative difference.
During the fitting the baseline stimulus was simulated 3 times with 30\,s each and the step stimuli were simulated with a delay, step duration and recovery time of each 0.5\,s. The contrasts were the same as in the cell recordings. The step stimuli for the different contrasts were each repeated 8 times. The simulated data was analyzed in the same way as the cells (see above).
During the fitting the baseline stimulus was simulated 3 times with 30\,s each and the step stimuli were simulated with a 0.5\,s delay, 0.5\,s duration and 0.5\,s recovery time. The contrasts were the same as in the cell recording. The step stimuli were repeated 8 times.
With the simulation data the model characteristics were calculated the same way as for the cells (see above).
The error function was constructed from both the baseline characteristics: ISI-histogram, VS, CV, SC and burstiness and the fi-curve: the detections of $f_{inf}$ and $f_0$ responses for each contrast, the slope of the linear fit into the $f_{inf}$ and the frequency trace of one step response.
The error function was constructed from both the baseline characteristics: VS, CV, SC, ISI-histogram and burstiness and the f-I curve: the detections of $f_{inf}$ and $f_0$ responses for each contrast, the slope of the linear fit into the $f_{inf}$ and the frequency trace of one step response.
The error of the VS, CV, SC, and burstiness was calculated as the scaled absolute difference:
\begin{equation}
err_i = |x^M_i - x^C_i| * c_i
\end{equation}
with $x^M_i$ the model value for the characteristic $i$, $x^C_i$ the corresponding cell value and $c_i$ a scaling factor that is the same for all cells but different between characteristics. The scaling factor was used to make all errors a similar size.
with $x^M_i$ the model value for the characteristic $i$, $x^C_i$ the corresponding cell value and $c_i$ a scaling factor that is the same for all cells but different between characteristics. The scaling factor was used to make all errors a similar size. They are listed in table \ref{tab:scaling_factors}.
The error for the slope of the $f_{inf}$ fit was the scaled relative difference:
@ -395,10 +399,25 @@ For the $f_{inf}$ and $f_0$ responses the average scaled difference off all cont
err_i = (\langle (x^M_i - x^C_i)²\rangle) * c_i
\end{equation}
All errors were then weighted and summed up for the full error. The fits were done with the Nelder-Mead algorithm of scipy minimize \citep{gao2012implementing}. All model variables listed above in table \ref{tab:parameter_explanation} were fit at the same time except for $I_{Bias}$. $I_{Bias}$ was determined before each fitting iteration and set to a value giving the correct baseline frequency.
All errors were then summed up for the full error. The fits were done with the Nelder-Mead algorithm of scipy minimize \citep{gao2012implementing}. All model variables listed above in table \ref{tab:parameter_explanation} were fit at the same time except for $I_{Bias}$. $I_{Bias}$ was determined before each fitting iteration and set to a value giving the correct baseline frequency.
\begin{table}[H]
\begin{tabular}{c|c}
behavior & scaling factor \\
\hline
vector strength & 100 \\
coefficient of variation & 20 \\
serial correlation & 10 \\
ISI-histogram & 1/600\\
$f_0$ detections & 0.1 \\
$f_{\infty}$ detections & 1 \\
$f_\infty$ slope & 20 \\
$f_0$ step response & 0.001
\end{tabular}
\caption{\label{tab:scaling_factors} Scaling factors for fitting errors.}
\end{table}
% errors
%[error_vs, error_sc, error_cv, error_hist, error_bursty, error_f_inf, error_f_inf_slope, error_f_zero, error_f_zero_slope_at_straight, error_f0_curve]