## 1. Abstract

The ratiometric fluorescent calcium indicator Fura-2 plays a fundamental role in the investigation of cellular calcium dynamics. Despite of its widespread use in the last 30 years, only one publication [2] proposed a way of obtaining confidence intervals on fitted calcium dynamic model parameters from single ’calcium transients’. Shortcomings of this approach are its requirement for a ’3 wavelengths’ protocol (excitation at 340 and 380 nm as usual plus at 360 nm, the isosbectic point) as well as the need for an autofluorence / background fluorescence model at each wavelength. We propose here a simpler method that eliminates both shortcommings:

a precise estimation of the standard errors of the raw data is obtained first,

the standard error of the ratiometric calcium estimator (a function of the raw data values) is derived using both the propagation of uncertainty and a Monte-Carlo method.

Once meaningful standard errors for calcium estimates are available, standard errors on fitted model parameters follow directly from the use of nonlinear least-squares optimization algorithms.

**Method name** Standard error for the ratiometric calcium estimator

## 3. Method overview

### 3.1. Rational

Since its introduction by [1], the ratiometric indicator Fura-2 has led to a revolution in our understanding of the role of calcium ions (Ca^{2+}) in neuronal and cellular function. This indicator provides a straightforward estimation of the free Ca^{2+} concentration ([Ca^{2+}]) in neurons and cells with a fine spatial and time resolution. The experimentalist must determin a ’region of interest’ (`ROI`) within which the [Ca^{2+}] can be assumed uniform and is scientifically relevant. Fluorescence must be measured following excitation at two different wavelengths: typically around 340 and 380 nm; and, since cells exhibit autofluorescence or ’background fluorescence’ at those wavelengths, the measured fluorescence intensity is made of two sources: the Fura-2 linked fluorescence and the autofluorescence. The measured intensity within the ROI is therefore usually corrected by subtrating from it an estimation of the autofluorescence intensity obtained from simultaneous measurements from a ’background measurement region’ (`BMR`); that is, a nearby region where there is no Fura-2. At a given time the experimentalist will therefore collect a fluorescence intensity measurement from the ROI at 340 and 380 nm; we are going to write `adu340` and `adu380` these measurements, where ’adu’ stands for ’analog to digital unit’ and correspond to the raw output of the fluorescence measurement device, most frequently a charge-coupled device (`CCD`). The experimentalist will also collect intensity measurements from the BMR, measurements that we are going to write `adu340B` and `adu380B`. If `P CCD` pixels make the ROI and `P_B` pixels make the BMR and if the illumination time at 340 nm is T_340, while the illumination time at 380 nm is `T_380` (both times are measured in *s*), the experimentalist starts by estimating the fluorescence intensity per pixel per time unit following an excitation by a light flash of wavelengths *λ* (*λ* = 340 or 380 nm) as:
where an assumption of autofluorescence uniformity is implicitly made. The following ratio is then computed:

This is an important and attractive feature of the method as well as the origin of its name. Since only ratios are subsequently used, geometric factors like the volume of the Fura loaded region under the ROI do not need to be estimated.

The *estimated* [Ca^{2+}] that we will write for short (the sign is used for marking estimated values) is then obtained, following [1, Eq. 5, p. 3447], with:
where *K _{ef} _{f}* (measured in

*µM*),

*R*and

_{min}*R*are calibrated parameters (the last two parameters are ratios and are dimensionless).

_{max}If we now want to rigorously fit [Ca^{2+}] dynamics models to sequences of , we need to get *standard errors*, , on our estimates. This is where the ratiometric method gets ’more involved’, at least if we want standard errors from a single transient as opposed to a mean of many transients. Despite the ubiquity of ratiometric measurements in neuroscience and cell physiology, we are aware of a single paper–by some of us [2]–where the ’standard error question’ was directly addressed. The method proposed in [2] requires a 3 wavelengths protocol: measurements at 340, 380 *and* 360 (the isosbestic wavelength) nm; it drops, so to speak, the above advantage of working with a ratiometric estimator since it fits directly the adu340 and adu380 data (at the cost of estimating some geometry related parameters) and it requires a model of the autofluorescence dynamics if the latter is not stationnary. It therefore requires a slightly more complicated ’3 wavelengths’ recording protocol as well as a more involved fitting procedure. The dataset of the companion paper exhibits a clear but reversible autofluorescence rundown that cannot be ignored since autofluorescence accounts for half of the signal in the ROI. Rather that constructing / tailoring the accurate enough autofluorence models required by the ’direct approach’ of [2] we looked for an alternative method providing standard errors for the ratiometric estimator.

## 4. Ratiometric estimator variance

### 4.1. Fluorescence intensity

As detailed in [1, 2], the fluorescence intensities giving rise to the adu340, adu340B, adu380 and adu380B signals can be written as:
where *F _{λB}* is the autofluorescence intensity per pixel per time unit at wavelength

*λ*,

*K*is the Fura dissociation constant (a calibrated parameter measured in

_{F ura}*µM*), [

*F ura*]

_{total}, is the total (bound plus free) concentration of Fura in the cell (measured in

*µM*) and

*ϕ*is an experiment specific parameter (measured in 1

*/µM/s*) lumping together the quantum efficiency, the neurite volume, etc (see [2] for details). When a ’3 wavelengths protocol’ is used (as was the case in the companion paper), it is easy to implement a self-consistency check based on these equations as explained in Sec. A.

### 4.2. Recorded signals adu340, adu340B, adu380 and adu380B

As detailed and discussed in [7, 2], the signal adu*λ* recorded with a CCD chip whose gain is *G* and whose read-out variance is can be modeled as the realization of a Gaussian random variable ADU*λ* with parameters:
with the obvious adaptation when dealing with the BMR signal: *I _{λ}* is replaced by

*I*and

_{λB}*P*is replaced by

*P*.

_{B}### 4.3. Variance estimates for adu340, adu340B, adu380 and adu380B

So, to have the variance of *ADU _{λ}* we need to know

*I*and for that we need to know [

_{λ}*Ca*

^{2+}] (Eq. 4 and 6) precisely what we want to estimate. But the expected value of

*ADU*is

_{λ}*G I*(Eq. 8), we can therefore use as a first approximation the observed value

_{λ}*adu*of

_{λ}*ADU*as a guess for

_{λ}*G I*, so in Eq. 9 we plug-in

_{λ}*adu*for

_{λ}*G I*, leading to:

_{λ}In other words, we will use the observed *adu _{λ}* as if it were the actual fluorescence intensity times the CCD chip gain,

*ADU*=

_{λ}*G I*, in order to estimate the variance. In doing so we will sometime slightly underestimate the actual variance (when the observed

_{λ}*adu*turns out to be smaller than

_{λ}*ADU*) and sometime slightly overestimate it (when the observed

_{λ}*adu*turns out to be larger than

_{λ}*ADU*). Since we are going to combine many such approximations, we expect–and we will substantiate this claim in Sec. 5–that overall the under-estimations will be compensated for by the over-estimations.

_{λ}### 4.4. Variance estimate for

Now that we have a we can work with-that is, an estimate from the data alone—, we want to get (Eq. 2) and . We can either use the propagation of uncertainty (also referred to as *error propagation*, *compounding of errors* or *delta method*) [6, 8] together with Eq. 2 and 3, or a ’quick’ Monte Carlo approach. We drop any explicit time index in the sequel in order to keep the equations more readable, but it should be clear that such variance estimates have to be obtained for each sampled point.

#### 4.4.1. Propagation of uncertainty

This method requires, in the general case, an assumption of ’small enough’ standard error since it is based on a first order Taylor expansion (see Sec. B for details). It leads first to the following expression for the variance, , of *f _{λ}* in Eq. 1:

The variance of *r* in Eq. 2 is then:
and the variance of in Eq. 3 is:

#### 4.4.2. Monte-Carlo method

Here we draw, *k* quadruple of vectors
from four independent Gaussian distributions of the general form:
where *adu _{λ}* is the observed value and is drawn from a standard normal distribution. We then plug-in these quadruples into Eq. 1 leading to

*k*couples:

These *k* couples are ’plugged-in Eq. 2’ leading to *k r* ^{[j]}:
before plugging in the latter into Eq. 3 to get :

The empirical variance of these simulated observations will be our :

Since the Monte-Carlo method requires milder assumptions (the variances do not have to be small) and is easy to adapt, we tend to favor it, but both methods are working.

### 4.5. Comment

The present approach based on a estimation is slightly less rigorous than the ’direct approach’ of [2] but it is far more flexible since it does not require an independent estimation / measurement of [*Fura*]_{total}. In the companion paper we also chose to consider the calibrated parameters *K _{ef} _{f}*,

*R*and

_{min}*R*as known, while only an estimation (necessarily imprecise since the calibration procedure is subject to errors) is known. But the same batch of Fura was used for all experiments that should then all exhibit the same (systematic) error. Since in the companion paper, we are not trying to get the exact standard error of the calcium dynamics parameters but to show difference between two protocols (’classical whole-cell’ versus beta-escin perforated whole-cell), ignoring the uncertainty on the calibrated parameters makes our estimates less variable and helps making the difference, if it exists, clearer. For a true calcium buffering capacity study, the errors on the calibrated parameters should be accounted for and it would be straightforward to do it with our approach, simply by working out the necessary derivatives if one works with the propagation of uncertainty method, or by drawing also

_{max}*K*,

_{ef}_{f}*R*and

_{min}*R*values from Gaussian distributions centered on their respective estimates with a SD given by the standard errors if one works with the Monte-Carlo approach.

_{max}## 5. Empirical validation

### 5.1. Rational

Equations 4, 5, 6, 7, together with Eq. 8 and 9 can be viewed as a data generation model. This means that if we choose model parameters values as well as an arbitrary [Ca^{2+}] time course, we can simulate measurements (adu) at both wavelengths in the ROI as well as in the BMR. We can then use these simulated adu exactly as we used the actual data, namely get *r* (*t _{i}*) (Eq. 2) and (Eq. 3) as well as the (squared) standard errors (Sec. 4.4).

Now if the are good approximations for the actual but unknown , the distribution of the normalized residuals:
should be very close to a standard normal distribution. *This is precisely what we are going to check*.

### 5.2. Simulated data

We are going to use the first transient of dataset `DA_121219_E1` of the companion paper. The ’static’ parameters–that is the parameters not link to the calcium dynamics–used for the simulation are the actual experimental parameters rounded to the third decimal (Table 1).

The simulated calcium dynamics is a monoexponential decay mimicking the tail of the transient: and the parameter values (Table 2) are just a rounded version of the fitting procedure output (see companion paper).

The simulated data obtained in that way are shown on Fig. 2 (blue traces) together with the actual data (red curves) they are supposed to mimic. At a qualitative level at least, our data generation model is able to produce realistic looking simulations.

### 5.3. Software and simulation details

The methodological details of the measurements to which the analysis presented in the present manuscript was applied are described in the companion paper.

The simulations, computations and figures of the present manuscript were done with Python 3 (https://www.python.org/), numpy (https://numpy.org/), scipy and matplotlib (https://matplotlib.org/). The Python codes and the data required to reproduce the simulations and figures presented in this manuscript can be downloaded from GitLab (https://gitlab.com/c_pouzat/getting-se-on-ratiometric-ca-estimator).

The use of scipy was kept to a bar minimum to maximize code lifeduration (scipy tends to evolve too fast with minimal concern for backward compatibility). The random number generators used were therefore the ones of numpy: the uniform random number generator derives from the Permuted Congruential Generator (64-bit, PCG64) (https://www.pcg-random.org/) [5] while the normal random number generator is an adaptation of the Ziggurat method [3] of Julia (https://docs.julialang.org/en/v1/); unfortunately one has to check the source code of both numpy and Julia to find that out.

### 5.4. Are the standard errors of ratiometric estimator accurate?

Since the two estimation methods, propagation of uncertainty and Monte-Carlo, agree at each time point within 2%, we illustrate in this section the results obtained with the Monte-Carlo method.

We take next the simulated data (blue curves on Fig. 2) together with the simulated background signals (not shown) as if they were actual data and we compute the ratiometric estimator and its standard error as described in Sec. 4.4, using *k* = 10^{4} replicates. Figure 3 shows the standardized residuals as well as the simulated data together with the true [Ca^{2+}], we know it since we used it to simulate the data!

The upper part of Fig. 3 is only a qualitative way of checking that the normalized residuals follow a standard normal distribution. A quantitative assessment is provided by the Shapiro-Wilk W statistic, that is here: 0.987; giving a p-value of 0.128. There is therefore no ground for rejecting the null hypothesis that the normalized residuals are IID draws from a standard normal distribution.

As an additional, visual but less powerful test, we plot the empirical cumulative distribution function (ECDF) of the normalized residuals together with the theoretical (normal) one and with Kolmogorov’s confidence bands (Fig. 4). If the empirical ECDF arises from a normally distributed sample with mean 0 and SD 1, it should be *completely* contained in the 95% confidence band 95% of the time and in the 99% band, 99% of the time (these are *confidence bands* not collections of pointwise confidence intervals).

We conclude from these visual representations and formal tests that our normalized residuals follow the expected standard normal distribution, implying that our proposed method for getting the standard errors of the ratiometric estimator is fundamentally correct.

## 6. Discussion

We have presented a new and simple method for getting standard errors on calcium concentration estimates from ratiometric measurements. This method does not require any more data than what experimentalists using ratiometric dyes like Fura-2 are usually collecting: measurements at 340 and 380 nm both within a region of interest and within a background measurement region. Once the errors bars have been obtained, arbitrary models can be fitted to the calcium transients–by weighted nonlinear least-squares [4]–and meaningful confidence intervals for the parameters of these models will follow as illustrated in the companion paper. The present contribution is therefore best viewed a major simplification of the ’direct approach’ of [2]. In contrast to the latter, the new method does not require a ’3 wavelengths protocol’, it does not require either a precise fit of the autofluorescence dynamics at the three wavelengths and is therefore much easier to implement. Such a 3 wavelengths protocol can nevertheless be useful since it allows experimentalists to perform self-consistency checks and to detect potentially wrong calibration parameter (Sec. A). We provide moreover two independent implementations, one in C and one in Python, they are open source and freely available. The rather verbose Python implementation of the heart of the method (Sec. 4.4) requires 25 lines of code and nothing beyond basic numpy functions. We are therefore confident that this method could help experimental physiologists getting much more quantitative results at a very modest extra cost.

## A. A Self-consistency check

## A.1. Plug-in *aduλ* estimates

If we have data where a ’3 wavelengths protocol’ was implemented (that is, flashes at 340, 360 and 380 nm at each time point were made), we can use a self consistency check of the data generation model defined by Eq. 4, 6, 2 and 3. From the 6 measureed sequences:

{

*adu*340(*t*_{1})*, …, adu*340(*t*)},_{n}{

*adu*340*B*(*t*_{1})*, …, adu*340*B*(*t*)},_{n}{

*adu*360(*t*_{1})*, …, adu*360(*t*)},_{n}{

*adu*360*B*(*t*_{1})*, …, adu*360*B*(*t*)},_{n}{

*adu*380(*t*_{1})*, …, adu*380(*t*)},_{n}{

*adu*380*B*(*t*_{1})*, …, adu*380*B*(*t*)},_{n}

we compute the sequence of ratiometric calcium estimates . If we also have a way of getting such that: where is as estimate of the fluorescence intensity per pixel, per time unit due to Fura (we discuss in the next subsection how to obtain ), we will get:

,

where and are ’plug-in’ estimates of *I*_{340} and *I*_{380} obtained from Eq. 4 and 6 by plugging in :
with

The should then be comparable to the original {(*adu*340(*t _{i}*),

*adu*380(

*t*))}

_{i}_{i=1,…,n}. We have here a self-consistency criterion, not a test since we are using the measured

*aduλ(t*to get .

_{i})## A.2. Estimating

We introduce
and define as the argument minimizing *RSS*(*ϕ*). We just need to solve a nonlinear least-square problem.

## A.3. Illustration

As an illustration we compute the plug-in estimators in two situations both based on the first transient of dataset `DA_121219_E1`. In the first case we use the calibrated values for *R _{min}* and

*R*(left column on Fig. 5). In the second case we use an

_{max}*R*20% smaller than the calibrated value and an

_{min}*R*20% larger (right column on Fig. 5).

_{max}We see that the plug-in estimator does indeed provide a self-consistency check (the plug-in estimator values follow closely the observed values on the left side of Fig. 5) and is sensitive to calibrated parameter deviations from their ’true’ values (the peak / valleys ’plug-in’ deviate from the observed values on the right side of Fig. 5).

## B. Propagation of uncertainty

We outline in this section how to reach Eq. 11, 12 and 13 of Sec. 4.4.1. We first need to remember that is *X* and *Y* are two *independent* random variables with mean and and variance and , then if *Z* = *a* + *bX* + *cY* (*a, b, c* ∈ ℝ) we have:

Eq. 11 is a direct consequence of the last equality. If *X* is (approximately) normally distributed with as well as *Y*, we can write: *X* ≈ *µ _{X}* +

*Z*

_{1}

*σ*and

_{X}*Y*≈

*µ*+

_{Y}*Z*

_{2}

*σ*, where

_{Y}*Z*

_{1}and

*Z*

_{2}are independent and follow a standard normal distribution, . If now

*Z*=

*f*(

*X, Y*) and the partial derivatives of

*f*at (

*µ*) exist then:

_{X}, µ_{Y}This is just a first order Taylor expansion and that is where the ’small enough standard error’ assumption is necessary. *Z* is then (approximately) a linear combination of two independent standard normal random variables and we immediately get:

Eq. 12 follows directly by computing the necessary partial derivatives, while Eq. 13 requires the computation of a single derivative.

## C. Auto-fluorescence dynamics

## C.1. General features

The evolution of the *aduλB* is shown on Fig. 6. We see that the autofluorescence runs down when high frequency flashes are applied during the 3 transients, with a partial recovery between transients.

## C.2. Within transient dynamics

The ’direct method’ of [2] requires the knowledge of the autofluorescence value at each time point during a transient at both 340, 360 and 380 nm, since Eq. 4 and 6 are fitted directly to the recorded adu340 and adu380 and they depend on the total Fura concentration at transient time that is estimated from the difference of the 360 nm measurements in the ROI and the BMR. We therefore take a closer look a the autfluorescence dyanmics during the first transient (Fig. 7).

At that stage we can fit a straight line plus a cosine function whose period is the duration of a transient. That’s a good way to capture the main structure in the transient, but is still does not account for the full signal variability (Fig. 8). As can be seen from the normalized residuals–the residuals divided by the standard deviation–that should be very nearly independent random draws from a standard normal distribution if the model is correct, there are finer structures left (like the double valley on the 380 nm residuals) meaning that those fits won’t pass formal goodness of fit tests. Indeed if we apply Pearson’s *χ*^{2} tests to these stabilized residuals we get:

at 340 nm a residual sum of squares (RSS) 326, leading to a ,

at 360 nm a RSS of 288, leading to a ,

at 380 nm a RSS of 275, leading to a ,

We are then left with three possibilities:

try to refine the ’straight line plus cosine function’ empirical model in order to get acceptable fits,

try to get a better understanding of the autofluorescence dynamics,

find another way to get error bars on our estimates.

Since we wanted to propose an ’as general and easy as possible’ method we chose the third approach in the present manuscript.