MATH 4310 · Computational Bioinformatics

Biological Dynamics and Noisy Measurements

Lesson 23 · 2027-04-19 · Week 15

Core question

Does a noisy gene-expression time course reflect a fluctuating biological state, an imperfect measurement, or both?

Reporter time courses from single cells

Lesson 21 followed a fluorescent reporter after a signal switched on its production. A time-lapse microscope images growing bacteria every few minutes, and software outlines each cell and records its mean fluorescence, which tracks the reporter’s concentration. After background subtraction and calibration, each record holds a cell identifier, an image time \(t_k\), and a reading \(y_k\). These are the first readings for one of four simulated cells.

Cell Image time \(t_k\) Reading \(y_k\)
c1 0.00 0.103
c1 0.25 0.841
c1 0.50 0.847
c1 0.75 1.024
c1 1.00 1.075
Python Simulate four reporter time courses
import numpy as np
import pandas as pd


def simulate_reporter(
    beta: float, alpha: float, h: float, n_steps: int,
    x0: float, q: float, r: float, c: float = 1.0,
) -> tuple[np.ndarray, np.ndarray]:
    """Simulate hidden concentrations x_k and recorded readings y_k."""
    x = np.zeros(n_steps + 1)
    x[0] = x0
    for k in range(n_steps):
        drift = h * (beta - alpha * x[k])  # deterministic Euler step
        disturbance = np.random.normal(0, np.sqrt(q))  # w_k, enters the cell
        x[k + 1] = x[k] + drift + disturbance
    errors = np.random.normal(0, np.sqrt(r), size=n_steps + 1)  # v_k
    y = c * x + errors
    return x, y


np.random.seed(23)
h = 0.25
times = h * np.arange(33)
cells = {}
for name in ["c1", "c2", "c3", "c4"]:
    cells[name] = simulate_reporter(2.0, 1.0, h, 32, x0=0.0, q=0.00875, r=0.02)
records = pd.DataFrame({"cell": "c1", "time": times, "reading": cells["c1"][1]})
print(records.head(5).round(3).to_string(index=False))

In Figure 23.1, each cell rises toward the steady concentration \(x^*=\beta/\alpha=2\), but none follows the smooth curve. Cell c2 stays above the curve for several images near \(t=5\), while cell c1 has isolated readings, such as the one at \(t=3.5\), that jump away and come straight back. Did c2 briefly make more reporter, or did the camera overestimate it? If cells fluctuate, the spread is a property of gene expression; if the instrument does, it only measures our precision. In a bistable circuit the difference is sharper still: a real fluctuation can push a cell into the other persistent state, while a misread value cannot.

Four panels, cells c1 to c4; black points rise from zero to about two, scattered around a grey dashed curve.

Figure 23.1. Simulated readings for four cells after production switches on, with the noise-free Euler response (dashed). The plot alone does not say whether the cells or the camera produce the scatter.

Definition 23.1 Attributing variation in a reporter trace

Input: an ordered series of readings \((t_k,y_k)\), \(k=0,\ldots,n\), from one cell at spacing \(h\).

Output: estimates of the variance of the cell’s own fluctuations, the variance of the measurement error, and the rate at which fluctuations decay.

We also ask what one trace cannot decide. We keep the rates \(\beta=2\), \(\alpha=1\) and image every \(h=1/4\) time units, so one relaxation time \(1/\alpha\) spans four images.

Two places for noise to enter

The deterministic Euler step \(x_{k+1}=x_k+h(\beta-\alpha x_k)\) approximates the concentration at successive image times. In a real cell, production and removal happen through discrete molecular events, such as a promoter firing or a protein being degraded, and over one interval they need not add up to exactly \(h(\beta-\alpha x_k)\). We collect the difference into a random process disturbance \(w_k\), which changes the cell itself. Separately, photon counting and errors in outlining the cell make the reading differ from the concentration. That difference is the measurement error \(v_k\), which changes only the record.

To say how large each kind of noise is, we use the variance of a random quantity \(U\): its expected squared deviation from its mean, \(\operatorname{Var}(U)=E[(U-E[U])^2]\). For a mean-zero disturbance it is simply \(E[w_k^2]\).

Definition 23.2 Linear state-space model

The hidden concentration \(x_k\) and the reading \(y_k\) at time \(t_k\) satisfy \[ x_{k+1}=x_k+h(\beta-\alpha x_k)+w_k,\qquad y_k=c\,x_k+v_k, \] where \(c>0\) is the reporter gain. The disturbances \(w_0,w_1,\ldots\) and errors \(v_0,v_1,\ldots\) all have mean zero; each \(w_k\) has variance \(q\) and each \(v_k\) has variance \(r\); and all of them are independent of one another and of the initial concentration \(x_0\).

So \(q\) measures how far one interval’s molecular events typically push the concentration off the deterministic step, and \(r\) how far one reading typically lands from \(c\,x_k\). We use calibrated units, \(c=1\), until the final section.

The model has the shape of the hidden Markov models of Lessons 10 to 12. Its dependencies are \[ \begin{array}{ccccccc} x_0 & \xrightarrow{\;+\,w_0\;} & x_1 & \xrightarrow{\;+\,w_1\;} & x_2 & \xrightarrow{\;+\,w_2\;} & \cdots\\[2pt] \big\downarrow{\scriptstyle +\,v_0} & & \big\downarrow{\scriptstyle +\,v_1} & & \big\downarrow{\scriptstyle +\,v_2} & & \\[2pt] y_0 & & y_1 & & y_2 & & \end{array} \] The horizontal arrows are the HMM’s transitions: given \(x_k\), the next concentration does not depend on earlier ones. The vertical arrows are its emissions: given \(x_k\), the reading \(y_k\) is independent of every other state and reading. The B/I model stepped along DNA through two discrete states; here the index is time, the hidden state is a continuous concentration, and the transition comes from the ODE. Estimating the hidden concentrations from the readings has continuous analogues of the HMM computations for Gaussian noise: the Kalman filter uses readings up to the current time, like the forward pass, and the Kalman smoother uses the whole series, like forward-backward. We do not develop them.

One disturbance, two fates

The cleanest comparison applies one disturbance of each kind to a cell at steady state. Write \(e_k=x_k-x^*\) for the deviation from \(x^*=\beta/\alpha\). Because \(\beta=\alpha x^*\), the drift is \(h(\beta-\alpha x_k)=-\alpha h(x_k-x^*)\), and subtracting \(x^*\) from both sides of the state update gives

Equation (23.1)

\[ e_{k+1}=\lambda\,e_k+w_k,\qquad \lambda=1-\alpha h. \]

First the existing deviation shrinks by the factor \(\lambda\), then the new disturbance is added. With \(\alpha=1\) and \(h=1/4\), \(\lambda=3/4\).

Example 23.1 A 0.4-unit disturbance to the cell or to the reading

Start at \(x_0=2\) with all disturbances and errors zero except one.

Process. Let \(w_3=0.4\), so a burst of extra production raises the concentration at \(t_4=1\). Then \(e_4=0.4\), and Equation 23.1 gives \(e_5=0.75(0.4)=0.3\), \(e_6=0.75(0.3)=0.225\), and \(e_7\approx0.169\). The readings are \(2.4,\ 2.3,\ 2.225,\ 2.169,\ldots\), decaying back toward 2.

Measurement. Let \(v_4=0.4\) instead. The concentration stays at 2 throughout, and the readings are \(2,\ 2.4,\ 2,\ 2,\ldots\) around \(t_4\).

At \(t_4\) the two records are identical. They differ afterwards because only \(w_k\) enters the state update (Figure 23.2). The cell forgets a process disturbance at the rate it forgets any perturbation: a fraction \(\lambda\) survives each interval, so after one relaxation time (four images) about \(0.75^4\approx0.32\) remains, close to \(e^{-1}\approx0.37\). The instrument’s error is gone at the next image. In a toggle switch, a process disturbance that crosses the boundary between attraction regions changes the state the cell settles into; an equal measurement error leaves one displaced point.

A: line and blue points jump from 2 to 2.4 at time 1 and decay toward 2. B: flat line at 2, one orange point at 2.4.

Figure 23.2. Hidden concentration (line) and readings (points) after a 0.4-unit disturbance at time 1, applied to the cell (A) or to one reading (B). Both records show 2.4 at time 1, but only the process disturbance persists, shrinking by a factor 3/4 per image.

In a real cell a disturbance arrives at every interval. Unrolling Equation 23.1 from \(e_0\) gives \[ e_k=\lambda^k e_0+\sum_{j=0}^{k-1}\lambda^{\,k-1-j}\,w_j, \] so the current deviation is a sum of all past disturbances, each shrunk according to its age. As new disturbances arrive and old ones decay, the spread of \(x_k\) settles where the two balance.

How much the concentration fluctuates

Under Definition 23.2 with \(0<\alpha h<2\), so that \(|\lambda|<1\), the variance of \(x_k\) converges as \(k\to\infty\) to the stationary variance

Equation (23.2)

\[ \sigma_x^2=\frac{q}{1-\lambda^2}. \]

If \(x_0\) already has mean \(x^*\) and variance \(\sigma_x^2\), every \(x_k\) does.

Proof sketch

Two facts about averages do the work: the expectation of a sum is the sum of the expectations, and for independent quantities the average of a product is the product of the averages. The deviation \(e_k\) is built from \(e_0\) and \(w_0,\ldots,w_{k-1}\), so it is independent of the new disturbance \(w_k\), and \(E[e_kw_k]=E[e_k]E[w_k]=0\). Squaring Equation 23.1 and averaging term by term, \[ E[e_{k+1}^2]=\lambda^2E[e_k^2]+2\lambda\,E[e_kw_k]+E[w_k^2]=\lambda^2E[e_k^2]+q. \] The value \(V=q/(1-\lambda^2)\) satisfies \(V=\lambda^2V+q\). Subtracting it shows that the distance from \(V\) shrinks by \(\lambda^2\) per step, while the mean deviation shrinks by \(\lambda\): \[ E[e_{k+1}^2]-V=\lambda^2\bigl(E[e_k^2]-V\bigr),\qquad E[e_{k+1}]=\lambda\,E[e_k]. \] Hence \(\operatorname{Var}(x_k)=E[e_k^2]-E[e_k]^2\to V\).

For our parameters \(1-\lambda^2=7/16\), so \(\sigma_x^2=16q/7\approx2.29\,q\): several intervals’ disturbances are present at any moment. Measurement error does not accumulate; with \(q=0\) the readings have variance \(r\). With both sources, \(y_k-x^*=e_k+v_k\), and the cross term vanishes as in the proof, so at stationarity \[ \operatorname{Var}(y_k)=\sigma_x^2+r. \] The formula also shows the removal rate controlling fluctuations. Disturbances in disjoint sub-intervals of an interval come from separate molecular events and are independent, so their variances add and \(q\) is proportional to the interval’s length, \(q=Dh\). For short intervals \(1-\lambda^2\approx2\alpha h\), so \(\sigma_x^2\approx D/(2\alpha)\) regardless of how often we image. Faster removal forgets disturbances sooner and keeps the concentration closer to \(x^*\).

Telling the two sources apart

Equation 23.2 lets us make the two sources equally large. With \(r=0.04\) in a measurement-only cell and \(q=(7/16)(0.04)=0.0175\) in a process-only cell, both sets of readings have variance \(0.04\) around \(x^*=2\) (Figure 23.3, panels A and B). Their histograms would match, but process-only readings stay above or below 2 for several images in a row, while measurement-only readings jump independently. To measure this, we ask how strongly a reading predicts one taken \(\ell\) images later.

The covariance of two random quantities, \(\operatorname{Cov}(U,V)=E[(U-E[U])(V-E[V])]\), is positive when they tend to deviate from their means in the same direction, and it is zero when they are independent. For a series whose mean and variance do not change with \(k\), the autocorrelation at lag \(\ell\) is \[ \rho(\ell)=\frac{\operatorname{Cov}(y_k,\,y_{k+\ell})}{\operatorname{Var}(y_k)}. \] It equals 1 at lag zero. From one series with average \(\bar y\), we estimate it by replacing expectations with averages over the series: \[ \hat\rho(\ell)=\frac{\sum_{k=0}^{n-\ell}(y_k-\bar y)(y_{k+\ell}-\bar y)}{\sum_{k=0}^{n}(y_k-\bar y)^2}. \]

Theorem 23.1 Autocorrelation of a noisy reporter

Under Definition 23.2 with \(c=1\) and the concentration at stationarity, for every lag \(\ell\ge1\) \[ \rho(\ell)=\frac{\sigma_x^2}{\sigma_x^2+r}\,\lambda^{\ell}. \]

Proof sketch

Unroll Equation 23.1 for \(\ell\) steps: \[ e_{k+\ell}=\lambda^{\ell}e_k+\sum_{j=k}^{k+\ell-1}\lambda^{\,k+\ell-1-j}\,w_j . \] Because \(y_k-x^*=e_k+v_k\), the covariance of two readings multiplies out into covariances of pairs of terms. Independent pairs contribute zero, which removes \(e_k\) paired with a later disturbance and every pair containing a measurement error. One pair survives: \[ \operatorname{Cov}(y_k,\,y_{k+\ell})=\operatorname{Cov}\bigl(e_k,\ \lambda^{\ell}e_k\bigr)=\lambda^{\ell}\sigma_x^2 . \] Dividing by \(\operatorname{Var}(y_k)=\sigma_x^2+r\) gives the result.

With measurement error only, \(\rho(\ell)=0\) at every positive lag. With process noise only, \(\rho(\ell)=\lambda^\ell\approx e^{-\alpha\,\ell h}\): the correlation fades at the removal rate \(\alpha\), the clock that sets the deterministic response time. With both, the curve drops sharply from lag zero to lag one, then decays geometrically, and extending the geometric part back to lag zero estimates the share of reading variance that belongs to the cell. With \(\sigma_x^2=r=0.02\), for example, \(\rho(1)=0.5\times0.75=0.375\) and \(\rho(2)\approx0.281\).

Algorithm Estimate autocorrelations from one series

Input: equally spaced readings \(y_0,\ldots,y_n\) from one cell, with at least two different values, and a largest lag \(0\le L\le n\).

Output: sample autocorrelations \(\hat\rho(0),\ldots,\hat\rho(L)\), in order of lag.

  1. \(\bar y\leftarrow \frac{1}{n+1}\sum_{k=0}^{n}y_k\). // find the series mean
  2. For \(k=0,\ldots,n\), set \(d_k\leftarrow y_k-\bar y\). // subtract the mean
  3. Set the common denominator \(S_0\leftarrow\sum_{k=0}^{n}d_k^2\), the sum of products at lag zero.
  4. For each lag \(\ell=0,\ldots,L\):
    1. \(S\leftarrow0\). // reset the lag sum
    2. For \(k=0,\ldots,n-\ell\), set \(S\leftarrow S+d_kd_{k+\ell}\). The upper bound keeps both readings in range.
    3. \(\hat\rho(\ell)\leftarrow S/S_0\). // normalize by lag zero
  5. Return \((\hat\rho(0),\ldots,\hat\rho(L))\). // report one value per lag

Estimate \(\hat\rho(\ell)\) from about 2,000 simulated readings in each case, with reading variance \(0.04\). The combined case uses the same noise variances as Figure 23.1. For example, at lag 1 the estimates can be compared with the values from Theorem 23.1.

Source of variation Estimated \(\hat\rho(1)\) Theoretical \(\rho(1)\)
Measurement only -0.009 0
Process only 0.737 0.750
Both 0.375 0.375
Python Estimate autocorrelation in three simulated traces
def autocorrelation(y: np.ndarray, max_lag: int) -> np.ndarray:
    """Estimate rho(lag) for lags 0..max_lag from one series."""
    deviations = y - y.mean()
    denominator = np.sum(deviations ** 2)
    values = np.zeros(max_lag + 1)
    for lag in range(max_lag + 1):
        # pair each deviation with the one `lag` images later
        products = deviations[:len(y) - lag] * deviations[lag:]
        values[lag] = np.sum(products) / denominator
    return values


np.random.seed(4)
scenarios = {"measurement only": (0.0, 0.04),
             "process only": (0.0175, 0.0),
             "both": (0.00875, 0.02)}
lam = 1 - 1.0 * h  # lambda = 1 - alpha h
series = {}
for label, (q, r) in scenarios.items():
    series[label] = simulate_reporter(2.0, 1.0, h, 2000, x0=2.0, q=q, r=r)
    sigma2 = q / (1 - lam ** 2)
    theory = sigma2 / (sigma2 + r) * lam ** np.arange(1, 5)
    estimate = autocorrelation(series[label][1], 4)[1:]
    print(f"{label:17s}", np.round(estimate, 3), np.round(theory, 3))

At lag 1, every estimate in the table is within about 0.013 of the formula. Panel C of Figure 23.3 shows the comparison at longer lags. The autocorrelation curves separate even though the traces in panels A and B look equally noisy.

Left, two trace panels: orange points scattered around a flat line; blue points on a wandering line. Right: autocorrelation against lag; orange falls to zero at lag 1, blue decays geometrically, green drops to about 0.38 then decays.

Figure 23.3. Readings (points) and hidden concentrations (lines) with measurement error only (A) or process noise only (B), at equal reading variance. C: autocorrelations of these simulations and of one with both sources (points), with the formula (lines). Only process noise makes readings correlated, shrinking by 3/4 per image.

Key idea

Measurement error is forgotten at the next image; a process disturbance becomes part of the cell and fades at the removal rate \(\alpha\), making successive readings correlated.

What one trajectory supports

Under the model’s assumptions, Theorem 23.1 turns one long trajectory into two estimates. The ratio \(\hat\rho(\ell+1)/\hat\rho(\ell)\) estimates \(\lambda\), hence \(\alpha=(1-\lambda)/h\), and the extrapolated lag-zero height estimates the cell’s share of the variance. Deviations stay correlated for about \(1/\alpha\), so a trace lasting \(T\) time units holds only about \(\alpha T\) roughly independent stretches, and a trace of a few relaxation times gives uncertain autocorrelations however many images it contains. Imaging fixed cells or fluorescent beads, whose concentration cannot change, estimates \(r\) directly.

Several claims remain out of reach of one trajectory. Photobleaching or focus drift produces correlated measurement errors that the autocorrelation cannot distinguish from process noise. One cell cannot reveal whether other cells share its production rate \(\beta\). And one excursion is not evidence of a state change: a reading far from \(x^*\) may be a measurement error that the next image contradicts, or a process excursion that will decay. Only a deviation that persists well beyond the relaxation time supports the claim that the cell has settled somewhere new.

Intrinsic and extrinsic biological variability

Process noise has biological causes, and a two-reporter experiment separated two kinds.1 Its E. coli strains carried two copies of the same promoter, one driving a cyan and one a yellow fluorescent protein, in one cellular environment. Intrinsic noise, the randomness of each gene’s own transcription and translation, affects the copies independently. Extrinsic noise, from variation in other cellular components such as ribosome numbers, moves both copies together. Both kinds contributed substantially to the overall variation.

Going deeper a two-reporter simulation

A toy version uses our model twice per cell: cell \(j\) has a production rate \(\beta_j\) shared by both reporters (extrinsic), and each reporter has its own disturbances (intrinsic). At a snapshot, \[ A_j=S_j+I^A_j,\qquad B_j=S_j+I^B_j, \] where \(S_j=\beta_j/\alpha\) is the steady level both copies share and \(I^A_j,I^B_j\) are independent deviations with mean zero and the stationary variance \(\operatorname{Var}(I)\) of Equation 23.2. The cross terms vanish as in the proof, so \[ \operatorname{Cov}(A,B)=\operatorname{Var}(S),\qquad \tfrac12E\bigl[(A-B)^2\bigr]=\tfrac12E\bigl[(I^A-I^B)^2\bigr]=\operatorname{Var}(I). \] The shared term cancels in the difference, so extrinsic variation spreads cells along the diagonal \(A=B\) and intrinsic variation spreads them across it (Figure 23.4). In panel A, the sample covariance is 0.0037 and half the mean squared difference is 0.0355, close to the simulated variances 0.004 and 0.04. In panel B, those estimates are 0.0351 and 0.0044 for variances 0.04 and 0.004. The published analysis divides the same two quantities by the product of the reporters’ mean levels and reports squared coefficients of variation1 so that noise is comparable across expression levels.

Python Simulate paired reporters and estimate the two noise variances
np.random.seed(6)
settings = [("A  Mostly intrinsic", 0.004, 0.04),
            ("B  Mostly extrinsic", 0.04, 0.004)]
reporter_pairs = {}
for title, var_s, var_i in settings:
    shared = 2.0 + np.random.normal(0, np.sqrt(var_s), size=300)  # S_j
    a = shared + np.random.normal(0, np.sqrt(var_i), size=300)  # S_j + I_j^A
    b = shared + np.random.normal(0, np.sqrt(var_i), size=300)  # S_j + I_j^B
    covariance = np.cov(a, b)[0, 1]
    half_msd = 0.5 * np.mean((a - b) ** 2)
    print(f"{title}: Cov(A,B) = {covariance:.4f} (Var S = {var_s}),",
          f"half mean (A-B)^2 = {half_msd:.4f} (Var I = {var_i})")
    reporter_pairs[title] = (a, b)

Two scatter plots of reporter A against B with a grey diagonal; A is a round cloud at (2, 2), B a thin ellipse along the diagonal.

Figure 23.4. Two identically regulated reporters in 300 simulated cells, when intrinsic (A) or extrinsic (B) variation dominates. Shared causes stretch the cloud along the diagonal; independent causes widen it across.

Intrinsic versus extrinsic is a different question from process versus measurement: both are process noise, changes in the cell that the instrument then reports. The two distinctions still interact, because independent measurement error in each color channel enters \(A-B\) and inflates the apparent intrinsic noise by \(r\) (Exercise 23.5). The two-reporter experiment therefore needs a calibrated \(r\) before its spread across the diagonal can be read as biology.

Where the model breaks

Additive disturbances are an approximation. At low molecule counts the size of fluctuations depends on the count itself, and additive noise can even push a modeled concentration below zero. Uneven splitting of molecules at division adds a jump at division times rather than a steady stream of small disturbances. A real reporter also has a gain and background, \(y_k=c\,x_k+b+v_k\). With \(c\) unknown, doubling \(c\) while halving every concentration leaves the readings unchanged, so absolute concentrations cannot be recovered from readings alone. Autocorrelations, the removal rate, and the cell’s share of the variance are unchanged by this rescaling.

The three dynamics lessons built a model, found its persistent states, and asked what noisy readings can and cannot reveal about a hidden state. Each parameter in those models was a rate with a meaning. Lesson 24 turns to the opposite kind of model, a flexible function whose many parameters are fitted to examples, and reuses Euler’s step to fit it.

Exercises

Exercise 23.1. Repeat Example 23.1 with \(\alpha=1\) and \(h=1/2\). Compute the readings for four images after a process disturbance of 0.4 and after a measurement error of 0.4, and say how many images it takes for the process deviation to fall below 0.05.

Exercise 23.2. For \(\alpha=1\), \(h=1/2\), and \(q=0.03\), compute \(\sigma_x^2\). Then, with \(q=Dh\), show that \(\sigma_x^2\to D/(2\alpha)\) as \(h\to0\), and explain biologically why faster removal reduces the stationary variance.

Exercise 23.3. A cell imaged every \(h=1/4\) time units for a long time gives readings with variance \(0.05\) and estimated autocorrelations \(\hat\rho(1)=0.45\), \(\hat\rho(2)=0.34\), \(\hat\rho(3)=0.25\). Assuming Definition 23.2 with \(c=1\), estimate \(\lambda\), the removal rate \(\alpha\), \(\sigma_x^2\), and \(r\). Which noise source dominates?

Exercise 23.4. A cell is imaged \(m\) times so quickly that \(x_k\) is fixed, giving readings \(x_k+v_k^{(i)}\) with independent errors of variance \(r\). Show that their average has measurement variance \(r/m\) while its deviation \(e_k\) is unchanged, and explain why these technical replicates say nothing about process noise.

Exercise 23.5. In the two-reporter model, add independent measurement errors with variance \(r\) to each channel: \(A_j=S_j+I^A_j+v^A_j\) and \(B_j=S_j+I^B_j+v^B_j\). Show that \(\operatorname{Cov}(A,B)\) is unchanged while \(\tfrac12E[(A-B)^2]\) increases by \(r\).

References 1 source
1.Elowitz, M. B., A. J. Levine, E. D. Siggia, and P. S. Swain. 2002. Stochastic gene expression in a single cell. Science 297: 1183–1186. doihttps://doi.org/10.1126/science.1070919↑ 1 2