Abstract
We study the joint moments of occupation times on the legs of a diffusion spider. Specifically, we give a recursive formula for the Laplace transform of the joint moments, which extends earlier results for a one-dimensional diffusion. For a Bessel spider, of which the Brownian spider is a special case, our approach yields an explicit formula for the joint moments of the occupation times.
    Keywords:
                                                                    diffusions on graphs;                    Walsh’s Brownian motion;                    Green’s function;                    resolvent;                    Kac’s moment formula;                    additive functional;                    moment generating function        MSC:
                60J60; 60J55; 60J65; 05A10
            1. Introduction
When trying to understand and quantify the behavior of a stochastic process, we are often faced with analyzing various functionals of the process. Such functionals include first passage times to subsets of the state space, maximum (minimum) value up to random/fixed times, and occupation times in subsets. The first question is, of course, whether it is possible to find the distribution of the functional. Unfortunately, this is often not possible, or the expression is too complicated to have any practical value. In some cases, the Laplace transform of the distribution is more tractable for further studies than the distribution itself. In addition, the moments of the distribution often determine the distribution uniquely via a series expansion. Hence, being able to calculate the moments is a good contribution in many respects. In this paper, we study the moments of occupation time functionals for a family of stochastic processes that we call diffusion spiders. We proceed now to explain intuitively what lies behind this notion, to give references to earlier works, and to indicate some applications.
The process known as Walsh Brownian motion was introduced by J.B. Walsh in 1978 as an extension of the skew Brownian motion. The Walsh Brownian motion lives in , best expressed using polar coordinates. When away from the origin, the angular coordinate stays constant (so the process moves along a line), while the radial distance follows a positive excursion from 0 of a standard Brownian motion. Intuitively and roughly speaking, every time the process reaches the origin, a new angle is randomly selected according to some distribution on . This process was brilliantly described by Walsh in the following way []:
It is a diffusion which, when away from the origin, is a Brownian motion along a ray, but which has what might be called a roundhouse singularity at the origin: when the process enters it, it, like Stephen Leacock’s hero, immediately rides off in all directions at once.
The construction of the Walsh Brownian motion was described in more detail by Barlow, Pitman, and Yor []. We also refer to Salisbury [] and Yano [].
If the angle is selected according to a discrete distribution, then there are at most countably many rays on which the diffusion lives. The state space of the process then corresponds to a star graph with edges of infinite length, and we call such a graph a spider. Thus, the Walsh Brownian motion can in this case be seen as an early example of a diffusion on a graph, and this process is called a Brownian spider. An example of a spider with five legs is given in Figure 1.
      
    
    Figure 1.
      The graph of a diffusion spider with five legs.
  
To make the diffusion more general, we can relax the requirement that the radial distance follows a Brownian motion and replace it with excursions from 0 of any regular reflected non-negative recurrent one-dimensional diffusion. In this paper, such a process is simply called a diffusion spider, which can also be seen as an abbreviation for “diffusion process on a spider”. The focus of this paper is on the occupation times on the legs of a diffusion spider, that is, the amount of time that the process is located on the different legs up to a given (fixed or random) time. If the underlying diffusion is not recurrent, we could in principle still study occupation times on the legs of the spider, but the problem loses much of its interest if the process at some point is located on a single leg without ever returning to the origin. For this reason, we only consider recurrent diffusions here.
Diffusions on graphs have been subjected to intensive research at least since the pioneering work by Freidlin and Wentzell []. We refer to Weber [] for earlier references, but also for a study in the direction of our paper. In addition to [,,] concerning diffusions on spiders, we recall, in particular, the papers by Papanicolaou, Papageorgiou, and Lepipas [], Vakeroudis and Yor [], Fitzsimmons and Kuter [], Yano [], Csáki, Csörgő, Földes and Révész [,], Ernst [], Karatzas and Yan [], Bayraktar and Zhang [], Lempa, Mordecki and Salminen [], and Bednarz, Ernst and Osękowski [].
For results on occupation times and other earlier references, see [] where the joint law of the occupation times on legs of a diffusion spider (there called a “multiray diffusion”) is analyzed via a double Laplace transform formula generalizing the results in [] for a spider with excursions following a Bessel process. We also refer to [] for a formula for the density of the joint law. Refs. [,] consider the occupation times for a Brownian spider, and [] focus on limit theorems for local and occupation times for the Brownian spider. One could consider other stochastic processes on a spider as well, such as random walks [,] or continuous-time random walks. We leave the treatment of these interesting topics for eventual future work; however, in this paper, we focus on diffusion spiders, since the methods we apply for finding moment formulas do not lend themselves to a similar treatment of discrete or jump processes. A brief overview of the work by Révész et al. on random walks of spiders and Brownian spiders is given in [].
As mentioned above, a skew diffusion can be seen as a special case of a diffusion spider. Namely, a one-dimensional diffusion which is skew at 0 corresponds to a spider with two legs (the positive and negative half-lines), which moves like its ordinary counterpart away from zero, but whenever it hits 0, it has a certain (skewed) probability of continuing to the positive side next. Due to this close relation, some applications of diffusion spiders can be anticipated by looking at applications of skew diffusions. The skew Brownian motion, in particular, has been used in models for a large number of phenomena, such as population dynamics over a boundary, ecosystems in rivers, pollutants diffusing in rock layers, shock acceleration of charged particles, and brain imaging; references are given by Lejay [] and Ramirez et al. []. See Appuhamillage et al. [] for results on the joint distribution of occupation and local times and applications in the dispersion of a solute concentration across an interface. Exact simulations of skew Brownian motion are discussed by Lejay and Pichot [], statistical aspects by Lejay, Mordecki, and Torres [], and applications in financial mathematics by Alvarez and Salminen [], Rosello [], and Hussain et al. []. Furthermore, we refer to Dassios and Zhang [] for results on hitting times of Brownian spiders and, in particular, applications in the banking business. Finally, for an application of the Brownian spider in queueing theory, see Atar and Cohen [].
This paper is structured as follows: In the next section, some key results from the theory of linear diffusions are presented, which are crucial in order to introduce and understand the notion of a diffusion spider briefly given in this section. We recall the explicit form of the Green function (resolvent density) derived in []. From this expression, we can immediately deduce some regularity properties of the Green function that are important in the subsequent analysis. The basic mathematical tool of the paper is an extension of Kac’s moment formula discussed in Section 3. The first main result, i.e., a recursive formula for the joint moments of the occupation times on the legs of a diffusion spider, is given in Theorem 3, Section 4. This can be seen as an extension of our previous results for one-dimensional diffusions in []. In Section 4, we also present a new formula for the joint Laplace transform of the occupation times, see Theorem 4, and connect this to earlier results by Barlow et al. [] and Yano []. In Section 5, some examples are discussed, and we solve (see Theorem 5) the recursive equation for the joint moments for a Bessel spider—of which the Brownian spider is a special case. This is our third main result. At the end of Section 5, we also briefly return to the original Walsh Brownian motion. The proofs of the main results are given in the  Appendix A, Appendix B, Appendix C, Appendix D and Appendix E at the end of the paper.
2. Preliminaries
2.1. Linear Diffusions
To make the paper more self-contained, we first recall the basic facts from the theory of linear diffusions needed to introduce the concept of a diffusion spider. Let  be a linear diffusion living on . Let  denote the probability measure associated with X when initiated at . For  introduce the first the hitting time via
      
        
      
      
      
      
    
		It is assumed that X is regular and recurrent. Hence, for all  and  it holds that
      
        
      
      
      
      
    
		Moreover, we suppose that 0 is a reflecting boundary and  is a natural boundary (for the boundary classification for linear diffusions, see [,]). The -distribution of  is characterized for  via the Laplace transform
      
        
      
      
      
      
    
        where  refers to the expectation operator associated with X and  () is a positive, continuous and decreasing (increasing) solution of the generalized differential equation
      
        
      
      
      
      
    
		Here, S and m denote the scale function (strictly increasing and continuous) and the speed measure, respectively, associated with X. Under our assumptions, m is a positive measure. To fix ideas, we also assume that m does not have atoms and that  and  are differentiable with respect to S. Recall that  and  are unique solutions—up to multiplicative constants—of Equation (2) with the stated properties and satisfying the associated boundary conditions. Notice also that , when operating in an appropriate function space, constitutes the infinitesimal generator of X. We also introduce the diffusion  with the same speed and scale as X but for which 0 is a killing boundary. For  there exist functions  and  describing the distribution of  for  similarly as is conducted in (1) for X.
Recall that
      
        
      
      
      
      
    
        where the notation is shortened by omitting the subindex . Moreover, we normalize, as in [],
      
        
      
      
      
      
    
		As is well known, X has a transition density p with respect to m, i.e., for a Borel subset A of ,
      
        
      
      
      
      
    
        and the Green function (resolvent density) is given by
      
        
      
      
      
      
    
        with the Wronskian
      
        
      
      
      
      
    
For later use, recall that a diffusion X with starting point  is called self-similar if for any  there exists  such that
      
        
      
      
      
      
    
		Perhaps the most well-known example of a self-similar diffusion is a standard Brownian motion starting in 0, for which the above identity holds with .
2.2. Diffusion Spider
Let  be a star graph with one vertex at the origin of  and R edges of infinite length meeting in the vertex (see Figure 1 for an example). Here, such a graph is called a spider. The edges  of the graph are known as the “rays” or—as hereafter called—the “legs” of the spider. The ordered pair  describes the point on  located on leg  () at the distance  to the origin. We take the origin to be common to all legs, i.e.,
      
        
      
      
      
      
    
        so for simplicity we just write  for the origin.
Let X be the linear diffusion introduced above. On the graph  we consider a stochastic process  using the notation
      
        
      
      
      
      
    
        where  indicates the leg on which  is located at time t and  is the distance of  to the origin at time t measured along the leg . On each leg , the process  behaves like the diffusion X until it hits . The process  is called a (homogeneous) diffusion spider. We could allow different diffusions on the different legs (the inhomogeneous case), but do not perform so in this paper. As part of the definition of the process, there are positive real numbers , , such that . When  hits , it continues, roughly speaking, with probability  onto leg . We do not here discuss the rigorous construction of the process, which can be performed, e.g., applying excursion theory; for this and other approaches, see the references given in the introduction. Notations  and  are used for the probability measure and expectation, respectively, when the diffusion spider starts at point , that is, on leg number i and at a distance x from the origin. As mentioned above, we write  and  without specifying a leg when the starting point is the origin.
For the diffusion spider , we introduce its Green kernel (also called the resolvent kernel) via
      
        
      
      
      
      
    
        where ,  and  is a bounded measurable function. Moreover, define
      
        
      
      
      
      
    
		We call  and  the speed measure and the scale function, respectively, of . Clearly, on every leg  of the diffusion spider,
      
        
      
      
      
      
    
		Let  be the first hitting time of  for the diffusion spider . Since on every leg of the diffusion spider we have, loosely speaking, the same one-dimensional diffusion, for every  and ,
      
        
      
      
      
      
    
The following theorem, proved in [], states an explicit expression for the resolvent density of .
Theorem 1.  
The Green kernel of the diffusion spider  has a density  with respect to the speed measure , which is given for  and  by
      
        
      
      
      
      
    where
      
        
      
      
      
      
    and
      
        
      
      
      
      
    
From the properties of the functions  and , we immediately have the following result.
Corollary 1.  
3. Kac’s Moment Formula
The tool that we will use to obtain the recursive expression for the joint moments is an extended variant of the Kac moment formula. Let Y be a regular diffusion taking values on an interval E. In spite of some conflict with our earlier notation, here we also let m, p, and  () denote the speed measure, the transition density and the expectation operator, respectively, associated with Y. Moreover, let  be a measurable and bounded function and define for  the additive functional
      
        
      
      
      
      
    
	  The moment formula by M. Kac for integral functionals, see [], i.e.,
      
        
      
      
      
      
    
      is here extended into the following formula for the expected value of a product of powers of different functionals.
Proposition 1.  
Let  be measurable and bounded functions on E. For ,  and ,
      
        
      
      
      
      
    
Proof.  
See Appendix A.
The Formula in (12) is instrumental in the derivation of the results in Theorems 3 and 4 presented in Section 4.2.
4. Main Results
Let  be a diffusion spider with  legs meeting in the point , and let
      
        
      
      
      
      
    
      be the occupation time on leg number i up to time t. Note that if the underlying diffusion X is self-similar, it follows for any i and any fixed  that
      
        
      
      
      
      
    
      meaning that for any such diffusion spider, we can equally well consider the occupation time up to time 1 instead of a general (fixed) time t.
Figure 2 shows the radial distance from  as a function of time in a sample path of a Brownian spider with five legs. The excursions from  are colored to specify which leg the process is located on.
      
    
    Figure 2.
      Sample path of the radial distance in a Brownian spider with five legs up to time 1. The five different colors indicate on which leg of the spider the process is located at any given time.
  
In this section we present formulas for recursively finding the moments of occupation times on the legs of a diffusion spider. In the first and shorter subsection we recapitulate the result for moments of a single occupation time, which is presented in our earlier paper []. In the second subsection this result is extended to joint moments of multiple occupation times.
4.1. Moments of the Occupation Time on a Single Leg
As pointed out in Section 6.4 of [], the occupation time on a single leg  of a (homogeneous) diffusion spider has the same law as the occupation time on the positive half-line of a one-dimensional skew diffusion process with the state space  and with the skewness parameter given by . Namely, the spider is mapped onto  so that the leg  corresponds to the positive half-line , while all other legs are grouped together into a single second leg with parameter , which then is taken to be the negative half-line . When considering the occupation time on the leg ; therefore, we can equally well consider the occupation time on  of a one-dimensional diffusion.
The following results are shown in the previous paper [], although here it is slightly modified to comply with the notation for diffusion spiders introduced in Section 2. In particular, note the differences mentioned in Remark 1.
Theorem 2.  
The Laplace transform of the first moment of  is given by
      
        
      
      
      
      
    and for the higher moments, , recursively by
      
        
      
      
      
      
    where  denotes the Laplace transform with respect to t of the function in curly brackets, λ is the Laplace parameter, and
      
        
      
      
      
      
    Furthermore, if X is self-similar, then for any ,
      
        
      
      
      
      
    and, in particular,  does not depend on λ for any  and .
The proof is given in [] (Theorem 2) with some minor notational differences.
Remark 1.  
Note the following:
- (1)
 - (2)
 - There is a sign change in the factor as defined in (15) compared to the corresponding expression in [].
 - (3)
 
4.2. Joint Moments
The result in the previous section (from []) is here extended to a recursive formula for the Laplace transforms of the joint moments of the occupation times on multiple legs of a diffusion spider. For self-similar spiders we have a recursive formula directly for the joint moments, as in the case of the occupation time on one leg, cf. (16) in Theorem 2.
Theorem 3.  
Proof.  
See Appendix B.
Remark 2.  
Despite the similarity, Theorem 2 does not follow by letting  in Theorem 3. On the right-hand sides of equations (14) and (16) are not only the respective parts corresponding to (17) and (18) with , but also some additional terms. This difference seems to originate from the fact that up to the first hitting time of , the occupation time on the starting leg is equal to the elapsed time (and, hence, positive), while the occupation time on any other leg is zero. Therefore, any product of occupation times on more than one leg is also zero up to time , as can be seen in (A2), and even though we let the starting point tend to  when deriving the aforementioned theorems, there remains still a component which is nonzero in the case of a single leg but zero for the joint moments. With this in mind, Theorem 3 should not be seen as a replacement of Theorem 2 but as a complement to it.
The result in Theorem 3 tells us that if we know the Green kernel of the diffusion spider , we can recursively compute any joint moments of the occupation times on a number of legs. Recall also from (7) that for  
      
        
      
      
      
      
    
        i.e., we have all the ingredients needed to calculate the factors  using the integral expression in (15).
The generalized version of Kac’s moment formula in Proposition 1 is now used to derive a moment generating function of the occupation times on the legs of a diffusion spider up to an exponential time T.
Theorem 4.  
Let T be exponentially distributed with mean , , and independent of . Then, for any ,
      
        
      
      
      
      
    
Proof.  
See Appendix C.
Formula (21) in the next corollary is due to Yano [] (Theorem 3.5); see also Theorem 4 in Barlow, Pitman, and Yor [], where the formula is presented for Bessel spiders (more on them in Section 5.1). We prove here that (20) is equivalent to our formula (19). For a Bessel spider,  is as given in (22), and notice that this formula shows that the inverse of the local time at 0 of the underlying reflecting Bessel process is a stable subordinator.
Corollary 2.  
Proof.  
See Appendix D.
5. Examples
In this section we highlight our results by analyzing a few different diffusion spiders, first and foremost Bessel spiders. For the Brownian spider, which is an important special case of Bessel spiders, it is possible to pursue the formulas further, and this evaluation is presented in a subsection of its own. Finally, we make some comments concerning occupation times for Walsh Brownian motion.
5.1. Bessel Spider
A Bessel process of dimension n and parameter , where n is a positive integer, corresponds to the Euclidean norm of an n-dimensional Brownian motion. The n-dimensional Bessel process has the generator
      
        
      
      
      
      
    
        which makes sense not only for integers n but any real values and, hence, any real parameter . We define the Bessel spider as a diffusion spider that behaves like a Bessel process with parameter  (i.e., dimension ) on each leg and has the corresponding excursion probabilities , , such that . The restriction on  to  is so that the process is recurrent and hits 0; see [] (p. 77). We now let  be a Bessel spider with  legs and apply the result in Theorem 3.
The Bessel spider has the self-similar property, which means that the recurrence equation in (18) applies. Recall that this recurrence hinges on the factors  given in (15). For the purpose of finding , that is, where the point y is on a particular leg , we follow the procedure leading to Theorem 1. For the reflected Bessel diffusion on , we have from [] (p. 137) that
      
        
      
      
      
      
    
        where  is a modified Bessel function of the second kind. Then
      
        
      
      
      
      
    
        and, hence,
      
        
      
      
      
      
    
		Note that  is the same for all i. Similarly, the hitting time  when starting in  corresponds precisely to the hitting time of zero in the reflected Bessel process. The values of  are calculated as in [] (Proof of Theorem 3), but note that a different normalization is used for m and S in that paper. This way, we get for any  that
      
        
      
      
      
      
    
        where  are unsigned Stirling numbers of the first kind. In the rest of this section, we will drop  and only write , as its value does not depend on .
As explained in Section 4.1, when only considering the occupation time on a single leg , we can directly use the earlier obtained results for skew two-sided Bessel processes. Hence, by [] (Theorem 4), the nth moment of the occupation time on  up to time 1 is given by
      
        
      
      
      
      
    
        where  are Stirling numbers of the second kind.
Using the recurrence equation in Theorem 3, the result in (24) is here extended to an explicit formula for the joint moments of the occupation times on multiple legs in a Bessel spider with  legs. With the numbering of legs being arbitrary, it should be clear that the formula—although written for the first r legs of the spider—holds when considering the occupation times on any number r of the R legs. Contrary to the recursive formula in Theorem 3 (see Remark 2), this formula also holds when .
Theorem 5.  
For any  and ,
      
        
      
      
      
      
    where ,  and .
A proof of the theorem is given in Appendix E. For a particularly simple instance of the theorem above, consider the joint first moment of the occupation times on r legs in the Bessel spider.
Corollary 3.  
For any ,
      
        
      
      
      
      
    
Proof.  
Immediate from (25) with .    □
The first few moments of the occupation times up to time t on one or two legs of a Bessel spider are given in Table 1. Recall that since the Bessel spider is self-similar, the (joint) moments of the occupation times on the legs up to a fixed time t satisfy
      
        
      
      
      
      
    
		Using this, the moments are found directly from Theorem 5. The variance, covariance, and correlation coefficients are also included in the table. Note, as expected, that the correlation coefficient is always negative and does not depend on the time t or the Bessel parameter . If the spider has only two legs, so that , the process is always located on either of the legs and the correlation coefficient of the occupation times on the legs is then equal to .
       
    
    Table 1.
    Some moments and descriptive statistics for the occupation times on the legs of a Bessel spider.
  
5.2. Brownian Spider
The special case of a Bessel spider with the parameter  is the Brownian spider mentioned in the introduction, also known as Walsh Brownian motion on a finite number of legs. In this case, the result in Theorem 5 has the following, somewhat simpler expression.
Theorem 6.  
Let  be a Brownian spider and let  be the occupation time on leg  up to time 1. For any  and ,
      
        
      
      
      
      
    where  and .
Proof.  
The result follows from (25) and the identity
      
        
      
      
      
      
    
          where  is a (signed) Bessel number of the first kind. For proofs of this identity and some related ones, see [,].    □
5.3. Walsh Brownian Motion
Finally, we briefly return to the Walsh Brownian motion in its original form. As the state space can be the entire  and is not restricted to a spider graph with a fixed number of legs, in this section we follow Walsh’s terminology and talk about “rays” rather than “legs”, although it should be clear that the meaning is the same. Here, the diffusion behaves like a Brownian motion on each ray, and when it reaches the origin, the direction  of the next ray is selected according to some given distribution on . As we have already studied the case when this distribution is discrete, i.e., the number of rays is at most countable, we now consider a continuous distribution.
The diffusion will, almost surely, choose a new direction every time it reaches , so that it visits no ray more than once. Furthermore, the probability of visiting a particular ray (i.e., a ray whose angle is a fixed value) is zero. For this reason, it is not meaningful to consider the occupation times on specific rays in this case. Rather, we can consider the occupation times within sectors of the  plane. Let  be fixed angles and let  consist of all points with angle in , so that  is partitioned into R non-overlapping sectors . If  denotes the angle of the ray on which the diffusion X is located at time t, then
      
        
      
      
      
      
    
        is the occupation time of the diffusion within sector  up to time t. This is illustrated in Figure 3, which contains a plot of a simulated Walsh Brownian motion. Each line corresponds to an excursion along a ray from the origin, and the length of each line is proportional to the maximal height of that excursion. The  plane has been divided into five separate sectors of equal size, each with its own color, and we may consider the occupation time of the process in these sectors.
      
    
    Figure 3.
      Plot of excursions from the origin of a simulated Walsh Brownian motion.
  
With respect to the occupation time on a sector, the outcome is the same as if all rays within the sector were combined and mapped onto a single ray. Therefore, the occupation times of a Walsh Brownian motion in the sectors  correspond precisely to the occupation times on the R legs of a Brownian spider. Thus, the result in Theorem 6 applies for the occupation times on sectors of a Walsh Brownian motion, with  being equal to the probability of selecting an angle within sector  when at the origin. Naturally, if the diffusion behaves like a Bessel process with parameter  on each ray (this could, perhaps, be called a “Walsh Bessel process”), then Theorem 5 applies instead.
Author Contributions
Conceptualization, P.S.; methodology, P.S. and D.S.; formal analysis, P.S. and D.S.; writing—original draft preparation, D.S.; writing—review and editing, P.S and D.S. All authors have read and agreed to the published version of the manuscript.
Funding
This research was in part funded through personal grants to D.S. from the Magnus Ehrnrooth Foundation and the Swedish Cultural Foundation in Finland.
Institutional Review Board Statement
Not applicable.
Data Availability Statement
No new data were created or analyzed in this study. Data sharing is not applicable to this article.
Conflicts of Interest
The authors declare no conflicts of interest.
Appendix A
Proof of Proposition 1.  
We prove the statement for , as the proof is analogous for any . Restating the equation above with , what we want to prove is that
      
        
      
      
      
      
    
		  Expanding the powers of  and  on the left hand side, we get
      
        
      
      
      
      
    
          where we have used the symmetry of the integrand in the second step and the strong Markov property in the final step. After a change of the order of the integration, justified by Fubini’s theorem, the desired result follows.    □
Remark A1.  
In the proof above, it is assumed that all values  are strictly positive integers. However, (12) may hold even if some (but not all) of these values are zero. Note that the factor  in the terms on the right hand side ensures that any term with  will not contribute, as long as the integral in that term is convergent. Suppose that for any starting point  of the underlying diffusion for which , it almost surely holds that  when , and  when . Then, the denominator  inside the expected value is nonzero except possibly when , in which case all factors in the numerator (and there is at least one) tend to zero as well, and at least as "fast". The first condition holds, for instance, if  is non-negative everywhere and continuous in y, as the diffusion Y is assumed to be regular. Observe that one choice of functions  that satisfies both these conditions is to take the indicator functions on the legs of a spider, i.e., , which is the case of interest in this paper. Technically, the point  should be excluded from the indicator functions for the conditions to hold also when  is the starting point, but assuming that  is not a sticky point (as we perform in this paper), that will not make a difference.
Appendix B
Proof of Theorem 3.  
We first remark that the expression on the right hand side of (17) is well defined since  for all  and . The procedure below closely follows the proof of Theorem 2 in [], with the main difference being that instead of the original Kac’s moment formula we use the generalized version given in Proposition 1. Proving the result for  should be sufficient, since the method is the same for any higher values of r (you only need to include more terms of similar form).
With , the claimed identity (17) can be written as
      
        
      
      
      
      
    
		  Note that the numbering of the diffusion spider legs is arbitrary, so any two legs could be considered, even though they are here numbered 1 and 2.
Assume first that the diffusion starts on one of the legs at a distance x from the origin. Without the loss of generality, we will write that it starts on the first leg . Before the diffusion hits  for the first time, the occupation time on the starting leg  equals the entire elapsed time, while the occupation time on any other leg stays zero. Thus, applying the strong Markov property at the first hitting time of , we have
      
        
      
      
      
      
    
          while for any other leg,
      
        
      
      
      
      
    
          where  is the usual shift operator and the use of the composition ∘ should here be understood as
      
        
      
      
      
      
    
		  From this we obtain, for any ,
      
        
      
      
      
      
    
          and
      
        
      
      
      
      
    
          where  denotes the -density of . Taking the Laplace transform with respect to t, we first recall that
      
        
      
      
      
      
    
          and
      
        
      
      
      
      
    
          so that we obtain, using the formula for the Laplace transform of a convolution,
      
        
      
      
      
      
    
		  On the right hand side of the equation, the starting point  is only part of the expression involving the hitting time , while the Laplace transform of the joint moments instead has the starting point . The equation above is now used together with Kac’s moment formula to obtain a recursive formula for (the Laplace transform of) the joint moments of the occupation times on the different legs. Proposition 1 yields
      
        
      
      
      
      
    
          and inserting the expression in (A3) on both sides gives
      
        
      
      
      
      
    
		  Note that the second integral is taken over points  that lie on the second leg , which is why in that case the expression in (A3) is inserted with the roles of  and  interchanged. We now let  on both sides of the equation above. For this, recall from [] (Lemma 1) that
      
        
      
      
      
      
    
          and by Corollary 1 we may take the limit inside the integrals to obtain
      
        
      
      
      
      
    
          where also the summation index is changed. This is equivalent to (A1) when introducing  as defined in (15), and this proves the first part of the theorem.
For a self-similar spider,
      
        
      
      
      
      
    
          and, in this case,
      
        
      
      
      
      
    
		  Hence, for self-similar spiders, the expression in (A1) simplifies to
      
        
      
      
      
      
    
		  This proves the second part of the theorem for , and the proof is easily extended for higher r.    □
Appendix C
Proof of Theorem 4.  
If the diffusion spider starts in the point , that is, on a particular leg , then up to the time  the occupation time on the leg  is equal to the time elapsed, while the occupation time on any other leg is zero. Hence, for any ,
      
        
      
      
      
      
    
		  To prove the theorem, we first consider the left hand side of (19) with a general starting point  instead of  and split the analysis into the two events whether the diffusion spider hits  before the exponential time T or not. This gives the two parts
      
        
      
      
      
      
    
          and
      
        
      
      
      
      
    
          where in the second part we have used the strong Markov property to restart the process when it first hits , as well as the memoryless property of the exponential distribution. Combining both parts gives
      
        
      
      
      
      
    
		  The significance of this expression is that on the right hand side the dependency on the starting position  is contained only in a function of the first hitting time , while the moment generating function of the occupation times has the starting point  instead.
As the left hand side of (A5) can be written
      
        
      
      
      
      
    
          we will, for the moment, consider the expression with a fixed time t rather than the exponential time T. Expanding as a sum of joint moments, we obtain
      
        
      
      
      
      
    
		  The generalized Kac’s moment Formula (12) with the functions  (and formulated for the spider) becomes
      
        
      
      
      
      
    
          where  denotes the transition density of the spider. Next, Equation (A8) is inserted in (A7), bearing in mind that by Remark A1 this can be performed even when some of the values  are zero. The exception is the term for , since at least one of the  has to be strictly positive, so this term (which evaluates to 1) is separated from the rest of the sum. This yields
      
        
      
      
      
      
    
		  Note that the summation indices N and  have both been shifted by one in the third step and that in the last step (A7) has been applied again. From (A6) and the above, we obtain
      
        
      
      
      
      
    
		  We now insert (A5) into the right hand side of (A9) and let  on both sides. This gives
      
        
      
      
      
      
    
          which, when solved for the left hand side expression, results in the claimed formula (19).    □
Appendix D
Appendix E
Proof of Theorem 5.  
The known Equation (24) coincides with (25) where , showing that the theorem holds in that particular case. As in the proof of Theorem 3, we here prove the statement for , say the two legs  and  in the Bessel spider. This will be enough to demonstrate the procedure, which can then readily be repeated for a larger value of r with more tedious but hardly more difficult work.
To begin with, we repeat the statement in (25) for :
      
        
      
      
      
      
    
		  We prove this statement by induction using the recurrence in (18) and the known moment formula (24) for the occupation time on a single leg. For the simplest case , we see from (18) that
      
        
      
      
      
      
    
          since  and . Thus, (A10) holds in this case. Assume now that (A10) holds whenever  or  for some integers . We proceed to show that then (A10) holds also for .
First, we apply the recurrence Equation (18) to obtain
      
        
      
      
      
      
    
		  Here, we have separated the terms with moments of the occupation time on only one leg, for which (24) applies, and the terms with joint moments of the occupation times on both legs, for which we can apply the induction assumption. In the first case, we insert the expressions in (23) and (24) to obtain
      
        
      
      
      
      
    
		  Note that the variable  only takes the value 1 here, but it is nevertheless added so that the expression above resembles the form of (A10) more closely. Next, we turn to the following term in (A11), assuming for the moment that  so that the sum is not empty. Inserting (23) and the induction assumption, we obtain 
      
        
      
      
      
      
    
          where, in the last step, we have changed the order of summation according to the pattern
      
        
      
      
      
      
    
		  To simplify the expression further, we use the two closely related identities
      
        
      
      
      
      
    
          and
      
        
      
      
      
      
    
          the first of which is well known [] and is also utilized in the proof of the latter (see Lemma 2 in []). Applying these identities, we know that the innermost sum in (A13) is equal to
      
        
      
      
      
      
    
		  The expression inside the parenthesis in (A13) becomes
      
        
      
      
      
      
    
          where the second step follows by the identities
      
        
      
      
      
      
    
          see Equation (6.15) in [] and the proof of Theorem 4 in [], respectively. Inserting this into (A13) gives
      
        
      
      
      
      
    
		  When this is combined with (A12), replacing the summation index j with  in the process, the result is
      
        
      
      
      
      
    
		  Note that this coincides with (A12) when , so the temporary assumption  is not necessary for this expression to hold. This is half the right hand side of (A11). We obtain the other half simply by interchanging the roles of a and b in the expression above (renaming the summation indices accordingly). Thus, adding all the terms together, we get
      
        
      
      
      
      
    
          which proves that (A10) indeed holds for . By induction, it holds for any , and the theorem is thereby proved when . As mentioned in the beginning of the proof, the same method can be repeated for increasingly larger values of r as well. However, due to the long expressions we include only the proof given above and trust that the reader can recognize how it generalizes to (25) for higher r.    □
References
- Walsh, J.B. A diffusion with a discontinuous local time. In Temps locaux; Société Mathématique de France: Marseille, France, 1978; Volume 52–53, pp. 37–45. [Google Scholar]
 - Barlow, M.; Pitman, J.; Yor, M. On Walsh’s Brownian motions. In Séminaire de Probabilités, XXIII; Lecture Notes in Mathematics; Springer: Berlin/Heidelberg, Germany, 1989; Volume 1372, pp. 275–293. [Google Scholar] [CrossRef]
 - Salisbury, T.S. Construction of right processes from excursions. Probab. Theory Related Fields 1986, 73, 351–367. [Google Scholar] [CrossRef]
 - Yano, Y. On the joint law of the occupation times for a diffusion process on multiray. J. Theoret. Probab. 2017, 30, 490–509. [Google Scholar] [CrossRef]
 - Freidlin, M.I.; Wentzell, A.D. Diffusion processes on graphs and the averaging principle. Ann. Probab. 1993, 21, 2215–2245. [Google Scholar] [CrossRef]
 - Weber, M. On occupation time functionals for diffusion processes and birth-and-death processes on graphs. Ann. Appl. Probab. 2001, 11, 544–567. [Google Scholar] [CrossRef]
 - Barlow, M.; Pitman, J.; Yor, M. Une extension multidimensionnelle de la loi de l’arc sinus. In Séminaire de Probabilités, XXIII; Lecture Notes in Mathematics; Springer: Berlin/Heidelberg, Germany, 1989; Volume 1372, pp. 294–314. [Google Scholar] [CrossRef]
 - Papanicolaou, V.; Papageorgiou, E.; Lepipas, D. Random motion on simple graphs. Methodol. Comput. Appl. Probab. 2012, 14, 285–297. [Google Scholar] [CrossRef]
 - Vakeroudis, S.; Yor, M. A scaling proof for Walsh’s Brownian motion extended arc-sine law. Electron. Commun. Probab. 2012, 17, 63. [Google Scholar] [CrossRef]
 - Fitzsimmons, P.J.; Kuter, K.E. Harmonic functions on Walsh’s Brownian motion. Stoch. Process. Appl. 2014, 124, 2228–2248. [Google Scholar] [CrossRef]
 - Csáki, E.; Csörgő, M.; Földes, A.; Révész, P. Some limit theorems for heights of random walks on a spider. J. Theoret. Probab. 2016, 29, 1685–1709. [Google Scholar] [CrossRef]
 - Csáki, E.; Csörgő, M.; Földes, A.; Révész, P. Limit theorems for local and occupation times of random walks and Brownian motion on a spider. J. Theoret. Probab. 2019, 32, 330–352. [Google Scholar] [CrossRef]
 - Ernst, P. Exercising control when confronted by a (Brownian) spider. Oper. Res. Lett. 2016, 44, 487–490. [Google Scholar] [CrossRef]
 - Karatzas, I.; Yan, M. Semimartingales on rays, Walsh diffusions, and related problems of control and stopping. Stoch. Process. Appl. 2019, 129, 1921–1963. [Google Scholar] [CrossRef]
 - Bayraktar, E.; Zhang, X. Embedding of Walsh Brownian motion. Stoch. Process. Appl. 2021, 134, 1–28. [Google Scholar] [CrossRef]
 - Lempa, J.; Mordecki, E.; Salminen, P. Diffusion spiders: Green kernel, excessive functions and optimal stopping. Stoch. Process. Appl. 2024, 167, 104229. [Google Scholar] [CrossRef]
 - Bednarz, E.; Ernst, P.A.; Osękowski, A. On the diameter of the stopped spider process. Math. Oper. Res. 2024, 49, 346–365. [Google Scholar] [CrossRef]
 - Csáki, E.; Földes, A. In memoriam Pál Révész (1934–2022). Period. Math. Hungar. 2024, 89, 201–229. [Google Scholar] [CrossRef]
 - Lejay, A. On the constructions of the skew Brownian motion. Probab. Surv. 2006, 3, 413–446. [Google Scholar] [CrossRef]
 - Ramirez, J.M.; Thomann, E.A.; Waymire, E.C. Advection-dispersion across interfaces. Statist. Sci. 2013, 28, 487–509. [Google Scholar] [CrossRef]
 - Appuhamillage, T.; Bokil, V.; Thomann, E.; Waymire, E.; Wood, B. Occupation and local times for skew Brownian motion with applications to dispersion across an interface. Ann. Appl. Probab. 2011, 21, 183–214. [Google Scholar] [CrossRef]
 - Lejay, A.; Pichot, G. Simulating diffusion processes in discontinuous media: Numerical scheme with constant time step. J. Comput. Phys. 2012, 231, 7299–7314. [Google Scholar] [CrossRef]
 - Lejay, A.; Mordecki, E.; Torres, S. Is a Brownian motion skew? Scand. J. Statist. 2014, 41, 346–364. [Google Scholar] [CrossRef]
 - Alvarez, L.; Salminen, P. Timing in the presence of directional predictability: Optimal stopping of skew Brownian motion. Math. Meth. Oper. Res. 2017, 86, 377–400. [Google Scholar] [CrossRef][Green Version]
 - Rossello, D. Arbitrage in skew Brownian motion models. Insur. Math. Econom. 2012, 50, 50–56. [Google Scholar] [CrossRef]
 - Hussain, J.; Soomro, M.A.; Dahri, S.A.; Memon, K.N.; Bano, M.; Awwad, F.A.; Ismail, E.A.A.; Ahmad, H. A study of maximizing skew Brownian motion with applications to option pricing. J. Radiat. Res. Appl. Sci. 2024, 17, 100732. [Google Scholar] [CrossRef]
 - Dassios, M.; Zhang, J. First Hitting Time of Brownian Motion on Simple Graph with Skew Semiaxes. Methodol. Comput. Appl. Probab. 2022, 24, 1805–1831. [Google Scholar] [CrossRef]
 - Atar, R.; Cohen, A. Serve the shortest queue and Walsh Brownian motion. Ann. Appl. Probab. 2019, 29, 613–651. [Google Scholar] [CrossRef]
 - Salminen, P.; Stenlund, D. On occupation times of one-dimensional diffusions. J. Theoret. Probab. 2021, 34, 975–1011. [Google Scholar] [CrossRef]
 - Itô, K.; McKean, H.P., Jr. Diffusion Processes and Their Sample Paths; Springer: Berlin/Heidelberg, Germany, 1974. [Google Scholar]
 - Borodin, A.N.; Salminen, P. Handbook of Brownian Motion—Facts and Formulae, 2nd ed.; Probability and Its Applications; Birkhäuser Verlag: Basel, Switzerland, 2015. [Google Scholar] [CrossRef]
 - Kac, M. On some connections between probability theory and differential and integral equations. In Proceedings of the Second Berkeley Symposium on Mathematical Statistics and Probability, Berkeley/Los Angeles, CA, USA, 31 July–12 August 1950; University of California Press: Berkeley, LA, USA, 1951; pp. 189–215. [Google Scholar]
 - Stenlund, D. On the connection between Stirling numbers and Bessel numbers. Electron. J. Combin. 2022, 29, P1.40. [Google Scholar] [CrossRef]
 - Yang, S.L.; Qiao, Z.K. The Bessel numbers and Bessel matrices. J. Math. Res. Expo. 2011, 31, 627–636. [Google Scholar] [CrossRef]
 - Graham, R.L.; Knuth, D.E.; Patashnik, O. Concrete Mathematics, 2nd ed.; Addison-Wesley Publishing Company: Reading, MA, USA, 1994. [Google Scholar]
 
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.  | 
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).