A CHARACTERISATION OF, AND HYPOTHESIS TEST FOR, CONTINUOUS LOCAL MARTINGALES

We give characterisations for Brownian motion and continuous local martingales, using the crossing tree, which is a sample-path decomposition based on ﬁrst-passages at nested scales. These results are based on ideas used in the construction of Brownian motion on the Sierpinski gasket (Barlow & Perkins 1988). Using our characterisation we propose a test for the continuous martingale hypothesis, that is, that a given process is a continuous local martingale. The crossing tree gives a natural break-down of a sample path at different spatial scales, which we use to investigate the scale at which a process looks like a continuous local martingale. Simulation experiments indicate that our test is more powerful than an alternative approach which uses the sample quadratic variation.


Introduction
It is well known that a process X , with X (0) = 0, is a continuous local martingale iff we can write X as = B • θ , where B is a Brownian motion and θ a continuous non-decreasing process, defined on the same filtration. That is, a continuous local martingale is a continuous time-change of Brownian motion. Moreover θ as = 〈X , X 〉, where 〈X , X 〉 denotes the quadratic variation process. (Note that in what follows our Brownian motions will always start at 0.) The 'only if' part of this result is due to Dambis [7] and Dubins & Schwarz [9] (see Revuz & Yor [22] Theorems V.1.6 and V.1.7). The 'if' part can be found in, for example, Revuz & Yor [22] Theorem V.1.5. Time-changed Brownian motions have been proposed as models where so-called 'volatility clustering' or 'intermittency' is observed, in particular in finance but notably also in turbulence and telecommunications. Models that incorporate a continuous time-change of Brownian motion (possibly after taking logs and removing drift) include, for example, stochastic volatility models (Hull & White [12]), fractal activity time geometric Brownian motion (Heyde [11]) and infinitely di-

Characterisations of BM and CLM using the crossing tree
In this section we describe the crossing tree then show that it can be used to give characterisations of Brownian motion (BM) and continuous local martingales (CLM). Fix δ > 0. Our definitions depend inherently on δ, but as it remains fixed throughout we will not include it in our notation. Let X be a continuous process, then for all l ∈ Z we define crossing times (more precisely first passage times) by putting T l 0 = 0 and T l j = inf{t > T l j−1 : |X (t) − X (T l j−1 )| = 2 l δ} k(∞, l) = sup{k : T l k < ∞}.
By a level l crossing (equivalently size δ2 l crossing) of the process X we mean a section of the sample path between two successive crossing times T l j−1 and T l j plus the starting time and position of the crossing, T l j−1 and X (T l j−1 ). Let C l j be the j-th crossing of size δ2 l . There is a natural tree structure to the crossings, as each crossing of size δ2 l can be decomposed into a sequence of 'subcrossings' of size δ2 l−1 . We identify vertices of the tree with crossings and link each level l crossing with its level l − 1 subcrossings. This is illustrated in Figure 1. Define the crossing length W l k = T l k − T l k−1 ; orientation α l k = sgn(X (T l k+1 ) − X (T l k )); and the number of subcrossings Z l k . crossing tree (points give start of crossing) crossing size Figure 1: The crossing tree associated with a continuous sample path. Here δ = 1. In the left frame, for l = 3 and 4, we have joined the points (T l j , X (T l j )); we see that the single level 4 crossing can be decomposed into a sequence of four level 3 crossings. In the right frame we have plotted the points (T l j , δ2 l ) for all l, j ≥ 0, then, identifying crossing C l j with its starting time T l j−1 , we joined each point to the points corresponding to its subcrossings.
Subcrossing orientations come in pairs, either +−, −+, ++ or −−, corresponding respectively to excursions up and down and direct crossings up and down. The subcrossings of a crossing can be broken down into some variable number of excursions, followed by a single direct crossing, where the orientation of the direct crossing is the same as the orientation of the crossing. Let V l j = 0 if the j-th level l excursion is up (+−) and V l j = 1 if it is down (−+). Let k V (∞, l) be the number of level l excursions. If k(∞, l) < ∞ then k V (∞, l) = k(∞, l)/2 − k(∞, l + 1), otherwise k V (∞, l) = ∞. Note that the crossing tree is not related to the excursion tree of Le Gall [17].
Proof. This characterisation of Brownian motion, in terms of its crossings, is based on the construction of Brownian motion on a nested fractal given by Barlow & Perkins [5] (see also Barlow [4]). The idea of looking at Brownian motion at crossing times goes back to Knight [15] (see also Knight [16] §1.3). Given a Brownian motion B, it is clear that k(∞, l) = ∞ for all l a.s., since Brownian motion visits every point infinitely often with probability 1. Also, it follows from the strong Markov property that for each l, the W l k are i.i.d. It is well known that the crossing duration has mean δ 2 4 l and finite variance. From the self-similarity of Brownian motion we have that W l k /(δ 2 4 l ) d = W m j /(δ 2 4 m ) for all l, m, j, k, so BM1 holds.
It also follows from the strong Markov property that the Z l k are all independent. Moreover since Brownian motion is statistically self-similar, they are identically distributed. The distribution of Z l k is just that of the time taken for a simple symmetric random walk X on Z to hit ±2, starting at 0, which we now calculate. Let S k , k = −1, 0, 1, be the number of steps taken by X before hitting ±2, starting at k. Put f k (t) = Et S k , then conditioning on the first step we get f , and by symmetry f −1 = f 1 . Solving for f 0 we get f 0 (t) = t 2 /(2 − t 2 ), which is exactly the probability generating function of the Z l k , and so BM2 holds.
To see that BM3 holds, consider an up-crossing: the orientations of its subcrossings are the same as the steps taken by a simple symmetric random walk X on Z, starting at 0 and conditioned to hit 2 before −2. Given this, we see that BM3 follows from the strong Markov property, and the fact that P(X (1) = 1 | X (0) = 0, X (2) = 0) = P(X (1) = −1 | X (0) = 0, X (2) = 0) = 1/2. Now suppose that we are given a continuous process B, with an infinite number of crossings at all levels, and satisfying conditions BM0-BM3. Put X l (k) = B(T l k ), and for l < m let N l,m be the first time X l hits X m (1) (so N l,l+1 = Z l+1 1 ). Conditions BM2 and BM3 specify the distribution of {X l (0), . . . , X l (N l,l+1 ) | X l+1 (0), X l+1 (1)}, and thus by induction the distribution of {X l (0), . . . , X l (N l,m ) | X m (0), X m (1)}, for any l < m. (In the terminology of [5], the random walks X l , l ∈ Z, are nested.) The arguments above show that we get precisely the same laws for the subcrossing numbers and orientations if instead of X l we take the simple symmetric random walk on δ2 l Z, started at 0 and run it until it hits ±δ2 m . That is, {X l (0), . . . , X l (N l,m ) | X m (0), X m (1)} is a simple symmetric random walk on δ2 l Z, started at 0 and conditioned to hit X m (1) before −X m (1). Now, from BM2 and BM3 we have that for any m ∈ Z, Similarly Thus, removing the conditioning on X m (1), X l (k) is indistinguishable from a simple symmetric random walk for k = 0, . . . , N l,m . But N l,m ≥ 2 m−l , so sending m → ∞ we see that X l is just a simple symmetric random walk on δ2 l Z.
By the strong law of large numbers, the law of the iterated logarithm, and BM1, 1 which completes the proof. 2. The definition of the crossing tree does not require X (0) = 0 and, as defined, the crossing tree considers the process when it hits new points on the lattice X (0) + δ2 l Z, for all levels l ∈ Z. We can just as easily consider lattices a + δ2 l Z, by the simple modification of putting T l 0 = inf{t ≥ 0 : X (t) ∈ a + δ2 l Z}. Similarly, in addition to allowing B(0) = 0, our characterisation of Brownian motion can be generalised to allow for lattices centred at an arbitrary point a. The proof is essentially the same, but does require more care with the nested random walks X l , as per [5] Theorem 2.14.
Clearly the V l j and Z l k are invariant under a continuous time-change, so a continuous local martingale must satisfy BM2 and BM3. We show below that these properties characterise a continuous local martingale, up to a shift at time 0. We will need the following lemma.
n=0 be a supercritical Galton-Watson branching process, with P(0) = 1, where L 0 1 = lim n→∞ µ −n P(n) and L n k d = L 0 1 is the analogous normed limit of the process descending from individual k in generation n.
Proof. The result follows directly from O'Brien [19] Theorem 1, noting that since EL 0 1 . It can also be proved using extreme values statistics for Galton-Watson trees (Pakes [20]).
Proof. The 'only if' part is clear, since Z l k and V l j are unaffected by a continuous time-change. We now show the 'if' part. Properties CLM0-CLM2 are enough for us to construct a so-called Embedded Branching Process (EBP) process Y : [0, ∞) → R, with continuous sample paths, Y (0) = 0, and subcrossing family sizes and excursion orientations exactly the same as those of X . We give the construction here, in a form suited to the current setting, but note that a more general form of the construction can be found in Decrouez & Jones [8]. The method we use is due originally to Knight [15] and Barlow & Perkins [5]. We first construct the first level 0 crossing of Y , from 0 to X (T 0 1 ). We need to define a number of ancillary processes. For m ≤ 0 let Y m be a discrete process with steps of size 2 m and duration 4 m . and Z m k . Each sequence of Z m k sub-crossings consists of (Z m k − 2)/2 excursions followed by a direct crossing. If the parent crossing is up, then the sub-crossings end up-up, otherwise they end down-down.
The interpolated Y m has continuous sample paths. We will show that with probability 1, as m → −∞ the sample paths of Y m converge uniformly on any finite interval, whence the limiting sample paths are a.s. continuous.
noting that Y r (T Thus for any q ≤ u, with probability 1 − δ we have and in three steps Y n can move at most distance 3 · 2 n . Applying this to (3) proves (2), taking n small enough that 6 · 2 n ≤ ε. Thus as ε and δ are arbitrary, Y n converges to some (necessarily continuous) Y uniformly on all closed intervals By construction we have Y (T l k ) = X (T l k ). Thus defining θ (T l k ) = T l k we get, for t = T l k , Y (θ (t)) = X (t). By assumption T l ∞ := lim k→∞ T l k = ∞, thus for any t ∈ [0, ∞) we can find a sequence {k(t, l)} −∞ l=∞ such that for all l, t ∈ [T l k(t,l)−1 , T l k(t,l) ). We use this to extend θ to [0, ∞), by putting The result now follows provided that θ is continuous. Suppose that θ has a jump at t. Since This contradicts Lemma 3, and so θ has no jumps, with probability 1. Finally, by construction we have that Y (θ (t)) and θ (t) are t measurable, where { t } is the filtration generated by X .

Remark 5.
1. It is possible to have k(∞, l) = ∞ for all l even if X is only defined on a finite interval. That is, we can have T ∞ := lim l→−∞ T l ∞ < ∞. If the process does explode in this way, then our construction of Y and θ still works, though of course our representation of X (t) as time-changed Brownian motion only holds for t ∈ [0, T ∞ ).

If k(∞, l) < ∞ for some (and thus a.s. all) l, then for a continuous local martingale we have
that CLM1 holds for k = 1, . . . , k(∞, l) and CLM2 holds for j = 1, . . . , k V (∞, l). We can still define T ∞ = lim l→−∞ T l k(∞,l) (a non-decreasing sequence), and we see that X is necessarily a process stopped at this time. To obtain a converse in this situation we need to replace CLM2 by the stronger statement that, for each l, the orientations α l k are i.i.d. with equal probabilities of up and down. The reason for this is that we can no longer use the argument of (1) to infer the orientation distribution from the excursion distribution. Given the orientations it is still possible to construct the Brownian motion Y , but only up to T ∞ = θ (T ∞ ). However, since X is stopped at T ∞ , this is enough to show that X is still a continuous time change of Brownian motion.

The continuous martingale hypothesis
The characterisation of Corollary 4 suggests a method for testing the continuous martingale hypothesis. Given a process X and a choice of δ, the subcrossing numbers Z l k and excursions V l j are easily obtained. We need to check that they are independent and follow the distributions specified by CLM1 and CLM2. In practice a continuous process X is never completely observed. Typically we get observations at either regularly spaced times or whenever the process moves a fixed distance (for example tickby-tick financial data). We deal with this by choosing δ so that, with high probability, we observe all the level 0 (size δ) crossings. We then consider crossings at levels 0, 1, 2, etc., as large as the data allows. Of course, the number of observed crossings decreases as the level increases. Note that we observe the V l j at levels 0, 1, 2, . . ., but the Z l k are only observed at levels 1, 2, . . .. are independent from one level to the next, so we could combine them to obtain larger samples. However, there is an advantage to testing each level separately. For modelling purposes often the question we ask is not, "is this process a continuous local martingale?", but, "at what scales (if any) does the process look like a continuous local martingale?" For example, for high frequency financial data it is generally believed that at small time scales (minutes) log-prices can exhibit micro-structure, such as antipersistence, but at large time scales (days) they look like a continuous local martingale (after removing any trend). Furthermore, for a large class of diffusion processes, as the time scale on which you observe the diffusion decreases, the diffusion component will increasingly dominate the drift component, so that it becomes to look like a continuous local martingale. (We discuss this in the appendix.) The crossing tree gives a natural break-down of a process at different spatial scales. We can convert these to approximate temporal scales by considering the expected or average crossing duration for a given level.

Testing the distribution and independence of the Z l k
We use a χ 2 -test to compare the empirical distribution of the {Z l k } N (l) k=1 against the distribution given in CLM1, that is 2 + 2 Geometric(1/2). For small values of N (l) we used Monte-Carlo estimation to obtain the distribution of the test statistic. To test the independence of the {Z l k } N (l) k=1 we compared the empirical joint distribution of (Z l k , Z l k+1 ) with its known distribution under the null, again using a χ 2 test. The joint distribution test can reject either from bi-variate dependence or a departure from the hypothesised marginal geometric distribution. Using a variety of simulated diffusion processes, we applied the test to  a randomly permuted copy, and consistently found a much greater rejection rate for the nonpermuted process, suggesting that that the test is more sensitive to deviations from the null due to dependence rather than distribution.

Testing the distribution and independence of the V l k
Under the continuous martingale hypothesis, for each l the sequence {V l k } k is an i.i.d. Bernoulli(1/2) sequence. The marginal distribution can be tested using k V l k , which has a Binomial(N (l), 0.5) distribution under the null. Independence can be tested using the runs test (Wald & Wolfowitz [25]).

Numerical results
Simulation experiments were used to check the Type I error and estimate the power of our tests against various diffusion alternatives. For brevity we only present here a single alternative, where the process X is an Ornstein-Uhlenbeck process. For full details of the simulation tests we performed see the working paper (Jones & Rolls [13]). All of our experiments showed that tests based on the V l k had very little power, especially when compared to tests based on the Z l k . Accordingly we have not presented any test results based on the V l k here. In the appendix we show that CLM2 holds for any continuous time-change of Brownian motion with drift, which suggests that the V l k are insensitive to changes in the drift of a diffusion.
To check the Type I error we simulated the crossings of Brownian motion. As Brownian motion is self-similar the scale has no effect, and we arbitrarily take δ = 1. Samples consisting of 1,250 level-0 crossings were used. Using a significance level of 5%, the Z l k were tested for distribution and independence at levels 1, 2 and 3. Mean rejection rates were estimated using 1,000 independent sample paths, and are presented in the left-hand panel of Figure 2. The Type I error is in around 5% in each case, as expected.
To get an idea of the power of these tests we considered as an alternative the Ornstein-Uhlenbeck process, given by d with diffusion parameter σ = 1 and drift parameter α = 10 (here W is a standard Brownian motion). Using a crossing size of δ = 0.062945 we simulated 1,000 independent datasets, each with 5,000 level-0 crossings and implemented our test. These parameters were used for comparison with Vasudev [24], who used datasets with 5,000 equally spaced observations on the time interval (0,20], imagining twenty years worth of daily data. Our choice of δ is such that the expected time to make 5,000 crossings is 20, which seems the most reasonable choice to allow direct comparisons between the methods. (The value of δ was found numerically.) The observed rejection rate from the two tests applied to the Z l k , l = 1, 2, 3, are given in the righthand panel of Figure 2. For both of our tests the power increases with the level, even though the sample size decreases with the level. So at level 3, about 50% of the datasets are rejected by the distribution (dist.) test and 97% are rejected by the independence (joint dist.) test. The increase in power across levels occurs because at small scales the diffusion dominates the drift, and the process looks like (continuous time-changed) Brownian motion. This observation is in fact applicable to a wide class of diffusions, as we show in the appendix. For comparison, we also implemented a test using the sample quadratic variation (Peters & de Vilder [21], Andersen et al. [2], Vasudev [24]). (See Jones and Rolls [13] for additional details of our implementation.) The idea of the test is, for a process X (t) = B(θ (t)), to estimate the quadratic variation θ and then test if the increments of X •θ −1 appear to be a random sample from a N (0, σ 2 ) distribution. In our case we test using the Kolmgorov-Smirnov (KS) and the Cramér-von Mises (CVM) tests. This approach requires one to choose a length ∆t for the time increments to be tested. Vasudev [24] searches for the increment length that makes the increments of X •θ −1 appear most like they are from a normal distribution, and the power is unreasonably reduced. Peters & de Vilder [21] and Andersen et al. [2] address this issue by choosing an (arbitrary) increment length and then arguing why it is reasonable. Instead, we test over a range of increment lengths for which we know the Type 1 error is reasonable. We have found empirically that the Type 1 error is high if the increment length is too short, and also that even within a reasonable range of increment lengths the power can vary substantially. We report results for the increment length most favourable to the test, that is, with the highest power. We leave unanswered the question of how to select the increment length a priori, but feel this is a drawback to using the estimated quadratic variation. We applied the tests to 1,000 datasets, each having 5,000 evenly spaced observations on the time interval (0,20]. Using tests with a 5% significance level, 87.5% of the datasets were rejected by the CVM test, and 70.4% were rejected using the KS test. (Not surprisingly, Vasudev reports lower rejection rates for identical parameters: 52% for CVM, and 31% for KS.) Our joint distribution test is clearly more powerful in this setting. For an additional comparison (not shown for brevity), we performed similar simulations using 1,000 datasets, but with α = 1. We used a crossing size δ = 0.63220, so that the expected time to make 5,000 crossings is 20. Since the mean reversal is less apparent than for α = 10 the rejection rates are smaller, with 7.4% of the datasets rejected by the distribution test and 7.6% rejected by the independence test. Rejection rates using the quadratic variation test were 0.4% (KS) and 0.2% (CVM), which are considerably smaller. So the tests using Z l k again show more power.
In Rolls and Jones [23] the authors report on the application of the crossing-tree test to five high frequency foreign exchange rate datasets.

A Small scale diffusive behaviour
We take a closer look at the orientation of subcrossings, and show that, to some extent, at small scales diffusions look like continuous local martingales. If X is a continuous regular diffusion on some interval, given by where W is standard Brownian motion, B > 0 and A are locally bounded Borel functions, then X has a scale function s, defined on the interior of the range of X by for some arbitrary x 0 (see for example [22] pp. 278-290).
. Given the scale function we can easily simulate the sequence of level-0 crossing points {X (T 0 k )} k using the fact that, for x ∈ δZ and (x − δ, x + δ) in the interior of the range of X , For Brownian motion we just get p δ (x) = 1/2 while for the OU process (4) we get p δ (x) = That is, which clearly holds if p δ (x) is constant and non-degenerate. If p δ (x) does not depend on x, then from the strong Markov property the crossing orientations {α 0 k } k and thus the excursions must be independent.
An immediate consequence of this result is that CLM2 holds for any continuous time-change of Brownian motion with drift. The next lemma shows that for a large class of diffusions, CLM1 and CLM2 hold approximately at small scales. That is, locally at small scales, these diffusions look like continuous local martingales. For this result we need to consider the effect of changing δ, and so we will write Z n k (δ) for the k-th level-n subcrossing number and V n k (δ) for the k-th level-n excursion type, when level-0 crossings are of size δ. Lemma 7. Suppose X is a continuous regular diffusion of the form (5), with X (0) = x 0 and a scale function s continuously differentiable in a neighbourhood of x 0 . Then for any fixed n and sequence δ k → 0, we have that {Z 1 j (δ k )} n j=1 converges in distribution to i.i.d. 2 + 2 Geometric(1/2) r.v.s, and {V 0 j (δ k )} n j=1 converges in distribution to i.i.d. Bernoulli(1/2) r.v.s, as k → ∞.