Exploring behaviors of stochastic differential equation models of biological systems using change of measures

Stochastic Differential Equations (SDE) are often used to model the stochastic dynamics of biological systems. Unfortunately, rare but biologically interesting behaviors (e.g., oncogenesis) can be difficult to observe in stochastic models. Consequently, the analysis of behaviors of SDE models using numerical simulations can be challenging. We introduce a method for solving the following problem: given a SDE model and a high-level behavioral specification about the dynamics of the model, algorithmically decide whether the model satisfies the specification. While there are a number of techniques for addressing this problem for discrete-state stochastic models, the analysis of SDE and other continuous-state models has received less attention. Our proposed solution uses a combination of Bayesian sequential hypothesis testing, non-identically distributed samples, and Girsanov's theorem for change of measures to examine rare behaviors. We use our algorithm to analyze two SDE models of tumor dynamics. Our use of non-identically distributed samples sampling contributes to the state of the art in statistical verification and model checking of stochastic models by providing an effective means for exposing rare events in SDEs, while retaining the ability to compute bounds on the probability that those events occur.


Background
The dynamics of biological systems are largely driven by stochastic processes and subject to random external perturbations. The consequences of such random processes are often investigated through the development and analysis of stochastic models (e.g., [1][2][3][4]). Unfortunately, the validation and analysis of stochastic models can be very challenging [5,6], especially when the model is intended to investigate rare, but biologically significant behaviors (e.g., oncogenesis). The goal of this paper is to introduce an algorithm for examining such rare behaviors in Stochastic Differential Equation (SDE) models. The algorithm takes as input the SDE model, M , and a high-level description of a dynamical behavior, j (e.g., a formula in temporal logic). It then computes a statistically rigorous bound on the probability that the given model exhibits the stated behavior using a combination of biased sampling and Bayesian Statistical Model Checking [7,8].
Existing methods for validating and analyzing stochastic models often require extensive Monte Carlo sampling of independent trajectories to verify that the model is consistent with known data, and to characterize the model's expected behavior under various initial conditions. Sampling strategies are either unbiased or biased. Unbiased sampling strategies draw trajectories according to the probability distribution implied by the model, and are thus not well-suited to investigating rare behaviors. For example, if the actual probability that the model will exhibit a given behavior is 10 -10 , then the expected number of samples need to see such behaviors is about 10 10 (See Figure 1). Biased sampling strategies, in contrast, can be used to increase the probability of observing rare events, at the expense of distorting the underlying probability distribution/measure. If the change of measure is well-characterized (as in importance sampling), these distortions can be corrected when computing properties of the distribution.
Our method uses a combination of biased sampling and sequential hypothesis testing [9,10] to estimate the probability that the model satisfies the property. Briefly, the algorithm randomly perturbs the computational model prior to generating each sample in order to expose rare but interesting behaviors. These perturbations cause a change of measure. We note that in the context of SDEs, a change of measure is itself a stochastic process and so importance sampling, which assumes that the change of measure with respect to the biased distribution is known, cannot be used. Our technique does not require us to know the exact magnitudes of the changes of measure, nor the Radon-Nikodym derivatives [11]. Instead, it ensures that that the geometric average of these derivatives is bounded. This is a much weaker assumption than is required by importance sampling, but we will show that it is sufficient for the purposes of obtaining bounds via sequential hypothesis testing.

Related work
Our method performs statistical model checking using hypothesis testing [12,13], which has been used previously to analyze in a variety of domains (e.g., [14][15][16][17][18][19]19]), including computational biology (e.g., [7,8,[20][21][22]). There are two key differences between the method in this paper and existing methods. First, existing methods generate independently and identically distributed (i.i.d.) samples. Our method, in contrast, generates independent but non-identically distributed (non-i.i.d.) samples. It does so to expose rare behaviors. Second, whereas most existing methods for statistical model checking use classical statistics, our method employs Bayesian statistics [23,24]. We have previously shown that Bayesian statistics confers advantages in the context of statistical verification in terms of efficiency and flexibility [7,8,19,25].

Methods
Our method draws on concepts from several different fields. We begin by briefly surveying the semantics of stochastic differential equations, a language for formally specifying dynamic behaviors, Girsanov's theorem on change of measures, and results on consistency and concentration of Bayesian posteriors.

Stochastic differential equation models
A stochastic differential equation (SDE) [26,27] is a differential equation in which some of the terms evolve according to Brownian Motion [28]. A typical SDE is of the following form: where X is a system variable, b is a Riemann integrable function, v is an Itō integrable function, and W is Brownian Motion. The Brownian Motion W is a continuous-time stochastic process satisfying the following three conditions: 3. W t has independent normally distributed increments: • W t -W s and W t' -W s' are independent if 0 ≤ s <t <s' <t'.
denotes the normal distribution with mean 0 and variance ts. Note that the symbol~is used to indicate "is distributed as".
Consider the time between 0 and t as divided into m discrete steps 0, t 1 , t 2 ... t m = t. The solution to a stochastic differential equation is the limit of the following discrete difference equation, as m goes to infinity: In what follows, M will refer to a system of stochastic differential equations. We note that a system of stochastic differential equations comes equipped with an inherent probability space and a natural probability measure μ. Our algorithm repeatedly and randomly perturbs the probability measure of the Brownian motion in the model M which, in turn, changes the underlying measure in an effort to expose rare behaviors. These changes can be characterized using Girsanov's Theorem.
Girsanov's theorem for perturbing stochastic differential equation models Given a process {θ t | 0 ≤ t ≤ T} satisfying the Novikov condition [29], such as an SDE, the following exponential martingale Z t defines the change from measure P to new measureP : Here, Z t is the Radon-Nikodym derivative ofP with respect to P for t <T. The Brownian motionŴ t under P is given by:Ŵ t = W t + t 0 θ u du . The non-stochastic component of the stochastic differential equation is not affected by change of measures. Thus, a change of measure for SDEs is a stochastic process (unlike importance sampling for explicit probability distributions).

Specifying dynamic behaviors
Next, we define a formalism for encoding high-level behavioral specification that our algorithm will test against M .
Definition 1 (Adapted Finitely Monitorable). Let s be a finite-length trace from the stochastic differential equation M . A specification j is said to be adapted finitely monitorable (AFM) if it is possible to decide whether s satisfies j, denoted j ⊨ j.
Definition 2 (Probabilistic Adapted Finitely Monitorable). A specification j is said to be probabilistic adapted finitely monitorable (PAFM) if it is possible to (deterministically or probabilistically) decide whether M satisfies j with probability at least θ, denoted M P ≥θ (φ).
Some common examples of PAFM specifications include Probabilistic Bounded Linear Temporal Logic (PBLTL) (e.g., see [19]) and Continuous Specification Logic. Note that temporal logic is only one means for constructing specifications; other formalisms can also be used, like Statecharts [33,34].

Semantics of bounded linear temporal logic (BLTL)
We define the semantics of BLTL with respect to the paths of M . Let s = (s 0 , Δ 0 ), (s 1 , Δ 1 ),... be a sampled execution of the model along states s 0 , s 1 ,... with dura- We denote the path starting at state i by s i (in particular, s 0 denotes the original execution s). The value of the state variable x in s at the state i is denoted by V (s, i, x). The semantics of BLTL is defined as follows:

Statistical model validation
Our algorithm performs statistical model checking using Bayesian sequential hypothesis testing [23] on non-i.i.d. samples. The statistical model checking problem is to decide whether a model M satisfies a probabilistic adapted finitely monitorable formula j with probability at least θ. That is, whether M P ≥θ (φ) where θ (0, 1).

Sequential hypothesis testing
Let r be the (unknown but fixed) probability of the model satisfying j. We can now re-state the statistical model checking problem as deciding between the two composite hypotheses: H 0 : r ≽ θ and H 1 : r < θ. Here, the null hypothesis H 0 indicates that M satisfies the AFM formula j with probability at least θ, while the alternate hypothesis H 1 denotes that M satisfies the AFM formula j with probability less than θ.
Definition 3 (Type I and II errors). A Type I error is an error where the hypothesis test asserts that the null hypothesis H 0 is false, when in fact H 0 is true. Conversely, a Type II error is an error where the hypothesis test asserts that the null hypothesis H 0 is true, when in fact H 0 is false.
The basic idea behind any statistical model checking algorithm based on sequential hypothesis testing is to iteratively sample traces from the stochastic process. Each trace is then evaluated with a trace verifier [32], which determines whether the trace satisfies the specification i.e. s i ⊨ j. This is always feasible because the specifications used are adapted and finitely monitorable. Two accumulators keep track of the total number of traces sampled, and the number of satisfying traces, respectively. The procedure continues until there is enough information to reject either H 0 or H 1 .

Bayesian sequential hypothesis testing
Recall that for any finite trace s i of the system and an Adapted Finitely Monitorable (AFM) formula j, we can decide whether s i satisfies j. Therefore, we can define a random variable X i denoting the outcome of s i ⊨ j. Thus, X i is a Bernoulli random variable with probability mass function f ( Bayesian statistics requires that prior probability distributions be specified for the unknown quantity, which is r in our case. Thus we will model the unknown quantity as a random variable u with prior density g(u). The prior probability distribution is usually based on our previous experiences and beliefs about the system. Noninformative or objective prior probability distribution [35] can be used when nothing is known about the probability of the system satisfying the AFM formula.
Suppose we have a sequence of independent random variables X 1 ,..., X n defined as above, and let d = (x 1 ,..., x n ) denote a sample of those variables.
Definition 4. The Bayes factor B of sample d and The Bayes factor may be used as a measure of relative confidence in H 0 vs. H 1 , as proposed by Jeffreys [36]. The Bayes factor is the ratio of two likelihoods: We note that the Bayes factor depends on both the data d and on the prior g, so it may be considered a measure of confidence in H 0 vs. H 1 provided by the data x 1 ,..., x n , and "weighted" by the prior g.

Non-i.i.d. Bayesian sequential hypothesis testing
Traditional methods for hypothesis testing, including those outlined in the previous two subsection*s, assume that the samples are drawn i.i.d.. In this section* we show that non-i.i.d. samples can also be used, provided that certain conditions hold. In particular, if one can bound the change in measure associated with the non-identical sampling, one can can also bound the Type I and Type II errors under a change of measure. Our algorithm bounds the change of measure, and thus the error.
We begin by reviewing some fundamental concepts from Bayesian statistics including KL divergence, KL support, affinity, and δ-separation, and then restate an important result on the concentration of Bayesian posteriors [35,37].
Definition 7 (KL Support). A point θ 0 is said to be in the KL support of a prior Π if and only if for all ε >0, Π (K ε (θ 0 )) >0.
Definition 8 (Affinity). The affinity Aff(f, g) between any two densities is defined as Aff(f , g) = fgdμ . Definition 9 (Strong δ-Separation). Let A ⊂ [0, 1] and δ >0. The set A and the point θ 0 are said to be strongly δ-separated if and only if for any proper probability dis- Given these definitions, it can be shown that the Bayesian posterior concentrates exponentially under certain technical conditions [35,37].

Bounding errors under a change of measure
Next, we develop the machinery needed to compute bounds on the Type-I/Type-II errors for a testing strategy based on non-i.i.d. samples.
A stochastic differential equation model M is naturally associated with a probability measure μ. Our non-i. i.d. sampling strategy can be thought of as the assignment of a set of probability measures μ 1 , μ 2 ,... to M . Each unique sample s i is associated with an implied probability measure μ i and is generated from M under μ i in an i.i.d. manner. Our proofs require that all the implied probability measures are equivalent. That is, an event is possible (resp. impossible) under a probability measure if and only if it is possible (resp. impossible) under the original probability measure μ.
We use the following result regarding change of measures. Suppose a given behavior, say j, holds on the original model with an (unknown) probability r.
Here, X i is a Bernoulli random variable denoting the event that i th sample satisfies the given behavior j. Note that the X i s must be independent of one another. Now, we can rewrite the above expression as: Note that the term p μ i (X i |u) denotes the probability of observing the event X i under the modified probability measure μ i if the unknown probability r were u. In order to ensure the independence assumption, the new probability measures μ i are chosen independently of one another. The ratio is the implied Radon-Nikodym derivative for the change of measure between two equivalent probability measures. Suppose, the testing strategy has made n observations X 1 , X 2 ,... X n . Then, A sampling algorithm can compute p μ i (X i |u) by drawing independent samples from a stochastic differential equation model under the new "modified" probability measure. We note that it is not easy to compute the change of measure p μ i (X i |u) p μ (X i |u) algebraically or numerically. However, our algorithm does not need to compute this quantity explicitly. It simply establishes bounds on it.
Consider the following expression that is computable without knowing the implied Radon-Nikodym derivative or change of measure explicitly.
Now, we can rewrite the above expression as: Our result will exploit the fact that we do not allow our testing or sampling procedures to have arbitrary implied Radon-Nikodym derivatives. This is reasonable as no statistical guarantees should be available for an intelligently designed but adversarial test procedure that (say) tries to avoid sampling from the given behavior. Suppose that the implied Radon-Nikodym derivative always lies between a constant c and another constant 1/c. That is, the change of measure does not distort the probabilities of observable events by more than a factor of c. Then, we observe that: Thus, by allowing the sampling algorithm to change measures by at most c, we have changed the posterior probability of observing a behavior by at most c 2 .
Example: Suppose, the testing strategy has made n observations X 1 , X 2 ,... X n . Then, Similarly, To do this, we first need to show that the posterior probability distribution will concentrate on a particular value as we see more an more samples from the model. To consider the conditions under which our algorithm will terminate after observing n samples, note that the factor introduced due to the change of measure c 2n can outweigh the gain made by the concentration of the probability measure e -nb . This is not surprising because our construction thus far does not force the test not to bias against a sample in an intelligent way. That is, a maliciously designed testing procedure could simply avoid the error prone regions of the design. To address this, we define the notion of a fair testing strategy that does not engage in such malicious sampling.
Definition 10. A testing strategy is h-fair (h ≥ 1) if and only if the geometric average of the implied Radon-Nikodym derivatives over a number of samples is within a constant factor h of unity, i.e., Note that a fair test strategy does not need to sample from the underlying distribution in an i.i.d. manner. However, it must guarantee that the probability of observing the given behavior in a large number of observations is not altered substantially by the non-i.i.d. sampling. Intuitively, we want to make sure that we bias for each sample as many times as we bias against it. Our main result shows that such a long term neutrality is sufficient to generate statistical guarantees on an otherwise non-i.i.d. testing procedure.
Definition 11. An h-fair test is said to be eventually fair if and only if 1 ≤ h 4 <e b , where b is the constant in the exponential posterior concentration theorem.
The notion of a eventually fair test corresponds to a testing strategy that is not malicious or adversarial, and is making an honest attempt to sample from all the events in the long run.

Algorithm
Finally, we present our Statistical Verification algorithm (See Figure 2) in terms of a generic non-i.i.d. testing procedure sampling with random "implied" change of measures. Our algorithm is relatively simple and generalizes our previous Bayesian Statistical verification algorithm [8] to non-i.i.d. samples using change of measures. The algorithm draws non-i.i.d. samples from the stochastic differential equation under randomly chosen probability measures. The algorithm ensures that the implied change of measure is bounded so as to make the testing approach fair. The variable n denotes the number of samples obtained so far and x denoted the number of samples that satisfy the AFM specification j. Based upon the samples observed, we compute the Bayes Factor under the new probability measures. We know that the Bayes Factor so computed is within a factor of the original Bayes Factor under the natural probability measure. Hence, the algorithm divides the Bayes Factor by the factor h 2n if the Bayes Factor is larger than one. If the Bayes Factor is less than one, the algorithm multiplies the Bayes Factor by the factor h 2n .

Results and discussion
We applied our algorithm to two SDE models of tumor dynamics from the literature. The first model is a single dimensional stochastic differential equation for the influence of chemotherapy on cancer cells, and the second model is a pair of SDEs that describe an immunogenic tumor.

Lefever and Garay model
Lefever and Garay [38] studied the growth of tumors under immune surveillance and chemotherapy using the following stochastic differential equation: Here, x is the amount of tumor cells, A 0 cos(ωt) denotes the influence of a periodic chemotherapy treatment, r 0 is the linear per capita birth rate of cancer cells, K is the carrying capacity of the environment, and b represents the influence of the immune cells. Note that W t is the standard Brownian Motion, and default model parameters were those used in [38].. We demonstrate our algorithm on a simple property of the model. Namely, starting with a tumor consisting of a billion cells, is there at least a 1% chance that the tumor could increase to one hundred billion cells under under immune surveillance and chemotherapy. The following BLTL specification captures the behavioral specification: Pr ≥0.01 (F 10 (x> 10 11 ))   We note that there are circumstances when our algorithm may require more samples than one based on i.i. d. sampling. This will happen when the property being tested has relatively high probability. For example, we tested the property that the probability of eradicating the tumor is at most 1%. The i.i.d. algorithm required 1374 samples to deny this possibility while the non-i.i.d. algorithm required 1526 samples. Thus, our algorithm is best used to examine rare behaviors.

Nonlinear immunogenic tumor model
The second model we analyze studies immunogenic tumor growth [39,40]. Unlike the previous model, the immunogenic tumor model explicitly tracks the dynamics of the immune cells (variable x) in response to the tumor cells (variable y). The SDEs are as follows: The parameters x 1 an y 1 denote the stochastic equilibrium point of the model. Briefly, the model assumes that the amount of noise increases with the distance to the equilibrium point.
For this model, we considered the following property: starting from 0.1 units each of tumor and immune cells, is there at least a 1% chance that the number of tumor cells could increase to 3.3 units. The property can be encoded into the following BLTL specification: Default model parameters were those used in [39]. Figure 4 contrasts the number of samples needed to decide whether the model satisfies the property using i.i.d. and non-i.i.d.. The same trends are observed as in the previous model. That is, our algorithm requires fewer samples than i.i.d. hypothesis testing, and that the difference between these methods increases with the Bayes factor.
We also considered the property that the number of tumor cells increases to 4.0 units. We evaluated whether this property is true with probability at least 0.000005 under a Bayes Factor of 100, 000. The i.i.d. sampling algorithm did not produce an answer even after observing 10, 000 samples. The non-i.i.d. model validation algorithm answered affirmatively after observing 6, 736 samples. Once again, the real impact of the proposed algorithm lies in uncovering rare behaviors and bounding their probability of occurrence.

Discussion
Our results confirm that non-i.i.d. sampling reduces the number of samples required in the context of hypothesis testingwhen the property under consideration is rare. Moreover, the benefits of non-i.i.d. sampling increase with the rarity of the property, as confirmed by the divergence of the lines in Figures 2 and 3. We note, however, that if the property isn't rare then a non-i.i.d. sampling strategy will actually require a larger number of samples than an i.i.d. strategy. Thus, our algorithm is only appropriate for investigating rare behaviors.

Conclusions
We have introduced the first algorithm for verifying properties of stochastic differential equations using sequential hypothesis testing. Our technique combines Bayesian statistical model checking and non-i.i.d. sampling and provides guarantees in terms of termination, and the number of samples needed to achieve those bounds. The method is most suitable when the behavior of interest is the exception and not the norm.
The present paper only considers SDEs with independent Brownian noise. We believe that these results can be extended to handle SDEs with certain kinds of correlated noise. Another interesting direction for future work is the extension of these method to stochastic partial differential equations, which are used to model spatially inhomogeneous processes. Such analysis methods could be used, for example, to investigate properties concerning spatial properties of tumors, the propagation of electrical waves in cardiac tissue, or more generally, to the diffusion processes observed in nature.