Tutorials › Competing Risks and Multi-State Models › Stochastic Integration Against Counting Processes

Counting Processes and Martingale Theory · Tutorial 446 of 699

Stochastic Integration Against Counting Processes

Learn how predictable weights turn event counts and cumulative intensities into stochastic integrals, and how to calculate and interpret both forms.

Advanced 12 min read

What You'll Learn

  • Define a stochastic integral against a counting process using predictable integrands.
  • Derive the event-sum formula for a weighted count.
  • Express integration against an absolutely continuous compensator as a cumulative-rate integral.
  • Calculate observed weighted event contributions and their compensator counterparts.
  • Check predictability, finite activity, and integrability conditions.
  • Recognize errors from using future information or confusing realized events with cumulative rates.

Why Integrate Against an Event Process?

A counting process records how many events have occurred by each time. In event-history work, however, the events need not contribute equally to a summary. A predictable weight can select particular times, give greater importance to some events, or represent a covariate known immediately before an event. Integrating that weight against a counting process provides a precise way to add its contributions over the observed events.

The corresponding integral against the compensator answers a different but related question. It accumulates the same predictable weights against the process's conditional event rate, rather than against the events that happened on the observed path. These two forms—the event sum and the cumulative-rate integral—are the central calculations in this tutorial.

Definition: Let \(N(t)\) be a counting process with \(N(0)=0\), and let \(H(t)\) be a predictable process. The stochastic integral of \(H\) against \(N\), over \((0,t]\), is denoted by \(\int_0^t H(s)\,dN(s)\). If \(N\) has event times \(T_1,T_2,\ldots\), then $$ \int_0^t H(s)\,dN(s) = \sum_{k:T_k\le t} H(T_k)\,\Delta N(T_k). $$ For a simple counting process, each event has jump size \(\Delta N(T_k)=1\), so the integral is the sum of \(H(T_k)\) over the events by time \(t\).

Predictability is what makes the weighting rule appropriate for event-history analysis: the weight at an event time must be determined by information available just before that event, rather than by information revealed by the event itself or afterward. A left-continuous, adapted process is a common way to ensure predictability. For such a process, its value at \(T_k\) is the value in force immediately before the event. More generally, \(H(T_k)\) denotes the predictable value used by the stochastic integral.

For a counting process with finitely many events on every bounded time interval, the event-sum definition is intuitive and directly calculable. The more general construction begins with simple predictable processes and extends by suitable approximation. The next derivation shows why the event-sum formula follows from that construction.

From Simple Processes to Event Sums

A simple predictable process is constant on time intervals, with each interval's value already known at its start. For example, on a partition \(0=s_0<s_1<\cdots<s_m\), write \(H(u)=\sum_{j=0}^{m-1}\xi_j\,1_{(s_j,s_{j+1}]}(u)\), where \(\xi_j\) is known at time \(s_j\). The integral on \((0,t]\) is defined by multiplying each interval's value by the number of events in the interval, truncated at \(t\).

$$ \int_0^t H(u)\,dN(u) = \sum_{j=0}^{m-1} \xi_j\left\{N(t\wedge s_{j+1})-N(t\wedge s_j)\right\}. $$

Each difference in braces counts events in \((s_j,s_{j+1}]\) up to time \(t\). Thus an event in that interval receives weight \(\xi_j\), the value fixed at the interval's start. Rewriting the right-hand side by grouping contributions by event gives the sum of the predictable weight at each event. Predictable integrands that are not simple are handled by approximating them with simple predictable processes and taking an appropriate limit; under the usual local boundedness and finite-activity conditions, this agrees with the pathwise event sum.

Event-sum formula: If \(N\) is simple and has finitely many jumps on bounded intervals, then for a predictable integrand \(H\) for which the integral is defined, $$ \int_0^t H(s)\,dN(s)=\sum_{k:T_k\le t}H(T_k). $$ If jumps may have sizes other than one, retain their sizes: the contribution at a jump time \(s\) is \(H(s)\Delta N(s)\).

This is a pathwise identity: it describes the realized integral for the observed event history. It does not claim that a weighted event count equals its model-based expectation. For example, a weight of zero removes an event's contribution, while a negative weight subtracts from the total. The integral need not be an integer or even be nonnegative.

Worked Example: Adding Unequally Weighted Events

Suppose a hypothetical simple counting process has events at times \(0.8\), \(2.4\), and \(3.6\) hours. Use the predictable step process \(H(s)=1\) on \((0,1]\), \(H(s)=2\) on \((1,3]\), and \(H(s)=0.5\) on \((3,4]\). Calculate \(\int_0^4 H(s)\,dN(s)\).

The weight is fixed for each interval before events in that interval are counted. The first event receives weight \(1\), the second receives weight \(2\), and the third receives weight \(0.5\). Therefore, $$ \int_0^4 H(s)\,dN(s) =1(1)+2(1)+0.5(1)=3.5. $$

The result is 3.5 weighted events. It is not the number of events, which is 3, because the events do not all have weight one. The example assumes no other events occur by hour 4 and that the step-process values are available at the start of their respective intervals.

Integration Against a Compensator

Let \(A(t)\) be the compensator of \(N(t)\): the predictable increasing process that accounts for the event process's cumulative conditional rate. When the compensator has an intensity \(\lambda(t)\), its cumulative form is \(A(t)=\int_0^t\lambda(s)\,ds\). Here \(\lambda(s)\) is the predictable event rate, measured in expected events per unit time, conditional on the available history. Integration against \(A\) accumulates the weight against this rate.

Definition: For a predictable \(H\), the integral against a compensator \(A\) is the Stieltjes integral \(\int_0^t H(s)\,dA(s)\). If \(A(t)=\int_0^t\lambda(s)\,ds\), then $$ \int_0^t H(s)\,dA(s) = \int_0^t H(s)\lambda(s)\,ds. $$ If \(A\) has jumps, the integral also includes contributions \(H(s)\Delta A(s)\) at its jump times; the intensity expression applies when \(A\) is absolutely continuous.

For a simple process with value \(\xi_j\) on \((s_j,s_{j+1}]\), integration against the compensator is defined in parallel with integration against \(N\): $$ \int_0^t H(u)\,dA(u) = \sum_j \xi_j\left\{A(t\wedge s_{j+1})-A(t\wedge s_j)\right\}. $$ When \(A\) is absolutely continuous, the increment of \(A\) on each interval is the integral of \(\lambda\) over that interval. This gives the cumulative-rate expression above. Thus the two integrals have matching interval structure, but one counts realized events and the other accumulates conditional rate.

The compensator property also links these calculations: for a nonnegative predictable \(H\), or an integrable predictable \(H\) for which the expectations exist, \(E\{\int_0^t H(s)\,dN(s)\}=E\{\int_0^t H(s)\,dA(s)\}\). This is an expectation identity, not a pathwise equality. On a particular path, the event sum can be larger or smaller than the cumulative-rate integral.

Worked Example: Calculating a Weighted Cumulative Rate

Continue the hypothetical example with the same \(H\), and suppose the predictable intensity is \(\lambda(s)=0.2+0.1s\) events per hour for \(0<s\le4\). Calculate \(\int_0^4 H(s)\,dA(s)\), including units.

On \((0,1]\), the weight is 1. The rate accumulated over this interval is \(\int_0^1(0.2+0.1s)\,ds=0.2+0.05=0.25\) events. The weighted contribution is \(1(0.25)=0.25\).

On \((1,3]\), the weight is 2. The rate accumulated is \(\int_1^3(0.2+0.1s)\,ds=0.2(2)+0.05(9-1)=0.8\) events, giving a weighted contribution of \(2(0.8)=1.6\).

On \((3,4]\), the weight is 0.5. The rate accumulated is \(\int_3^4(0.2+0.1s)\,ds=0.2(1)+0.05(16-9)=0.55\) events, giving a weighted contribution of \(0.5(0.55)=0.275\). Hence $$ \int_0^4H(s)\,dA(s)=0.25+1.6+0.275=2.125. $$

The answer is 2.125 weighted events. The units follow because \(H\) is dimensionless and intensity has units of events per hour, which is integrated over hours. The 3.5 realized weighted events in the earlier calculation and this cumulative-rate value need not match on this path. The compensator property concerns their expectations across repetitions under the stated model, not equality for each observed history.

Predictability and Integrability Conditions

The calculations above rely on assumptions that should be checked before applying the formulas. A useful standard setup is a simple, nonexplosive counting process with \(N(0)=0\), so that there are finitely many unit jumps on every bounded time interval. The integrand \(H\) is predictable, and its pathwise event sum is finite on the time interval of interest. Local boundedness of \(H\) is a common sufficient condition when \(N\) has finitely many events there.

For integration against \(A\), the Stieltjes integral must be defined and finite on the interval. If \(A(t)=\int_0^t\lambda(s)\,ds\), a common sufficient condition is that \(\int_0^t |H(s)|\lambda(s)\,ds\) is finite. To use the expectation identity, stronger integrability may be needed: for example, require the expected absolute integral against \(A\) to be finite. Nonnegative predictable \(H\) permits the identity in the extended nonnegative sense, even if the expectations are infinite.

In applications, at-risk indicators and covariates are frequent integrands. An at-risk indicator must turn off when observation ends, and a time-varying covariate used as a weight must be based on its predictable, pre-event value. These conditions do not establish that a chosen intensity model is scientifically correct; they specify what is required for the integral calculations and compensator interpretation to be valid.

1
Identify the event process.
State what each jump represents, the time interval, and whether jumps have size one.
2
Check the weight.
Confirm that \(H\) is predictable and that its values are determined before events in the intervals they weight.
3
Choose the measure of integration.
Use \(dN\) for realized event contributions, or \(dA\) for compensator contributions; with an intensity, use \(dA(s)=\lambda(s)\,ds\).
4
Compute and label the result.
Sum weights at event times or integrate weight times rate over time. State the time and weight units, and do not treat the two pathwise results as equal.

Common Pitfalls and Practical Checks

  • Using a weight that looks into the future. If an event's occurrence determines the weight assigned to that same event, the weight may not be predictable. Use information available just before the event, or justify a different model and construction.
  • Replacing the event sum with the rate integral. The former uses the observed jumps; the latter uses the compensator. They are not interchangeable on an individual path.
  • Dropping jump sizes. The formula \(\sum H(T_k)\) relies on unit jumps. For a process with a jump of size 3, that jump contributes \(3H(T_k)\).
  • Ignoring interval endpoints. The convention \((s_j,s_{j+1}]\) assigns an event at \(s_{j+1}\) to that interval. Use a consistent convention so boundary events are neither omitted nor counted twice.
  • Reporting a rate integral without checking finiteness. A large or unbounded weight can make \(\int |H|\lambda\,ds\) infinite even on a finite time interval. Check the relevant pathwise or expectation condition.

A practical diagnostic is to compare the event times with the intervals on which \(H\) changes. Every event should receive exactly one weight, and that weight should be supported by information available before the event. Separately, check that the intensity is expressed per unit of the same time scale used in the integration. A rate per day integrated over hours, for example, requires a conversion before the numerical result has the intended units.

The main alternative to stochastic integration is to report an unweighted count, \(N(t)\), or to calculate a cumulative intensity, \(A(t)\), without weights. Those summaries are appropriate when every event should count equally or when the target is the model's accumulated rate. Stochastic integrals extend both summaries by allowing predictable weights, but they do not remove the need to define the target carefully. A weighted event total, a weighted cumulative rate, and an unweighted event count answer different questions.

The central limitation is that these integrals summarize a specified process and weight; they do not by themselves validate the event-rate model, identify a causal effect, or resolve complications such as observation error. Their value is algebraic and conceptual: they make explicit how event-level contributions and conditional rates are accumulated. The later treatment of martingale transforms builds on this integration framework, but here the focus is the construction and calculation of the integrals themselves.

Worked Example: A Predictable Covariate as an Event Weight

Suppose a hypothetical subject has events at \(0.7\), \(1.8\), and \(2.6\) days. A binary covariate \(Z\) is 0 until day 1, is 1 on \((1,2.5]\), and is 0 on \((2.5,3]\). Let \(H=Z\), and suppose the intensity is 0.4 events per day on \((0,1]\), 0.2 on \((1,2.5]\), and 0.1 on \((2.5,3]\). Calculate the two integrals through day 3.

The covariate history is specified by intervals and is known before events in each interval, so it is predictable. The event at 0.7 receives weight 0, the event at 1.8 receives weight 1, and the event at 2.6 receives weight 0. Thus $$ \int_0^3 Z(s)\,dN(s)=0(1)+1(1)+0(1)=1. $$

For the compensator integral, the first interval contributes \(0(0.4)(1)=0\) expected events, the second contributes \(1(0.2)(1.5)=0.3\), and the third contributes \(0(0.1)(0.5)=0\). Therefore, $$ \int_0^3 Z(s)\,dA(s) = \int_0^3 Z(s)\lambda(s)\,ds =0+0.3+0=0.3. $$

The weighted realized count is 1 event, and the weighted cumulative-rate value is 0.3 events. Neither number is an error: the observed path contains one event while the compensator accumulates rate. If the covariate had been defined using information revealed only at the event time, its use as \(H\) would require a predictability check rather than an automatic application of these formulas.

Check Your Understanding

Answer each question, then compare your reasoning with the solutions.

  1. A simple counting process has events at times 1 and 3. If \(H=2\) on \((0,2]\) and \(H=-1\) on \((2,4]\), what is \(\int_0^4H(s)\,dN(s)\)?
  2. If \(A(t)=0.3t\) and \(H(s)=2\) for \(0<s\le5\), calculate \(\int_0^5H(s)\,dA(s)\).
  3. Why is a weight based on a covariate measured after an event generally unsuitable as a predictable integrand for that event?
  4. State the event contribution when a counting process has a jump of size 4 at time \(T\).

Solutions. (1) The event at 1 has weight 2 and the event at 3 has weight \(-1\), so the integral is \(2(1)+(-1)(1)=1\) weighted event. (2) Since \(dA(s)=0.3\,ds\), the integral is \(\int_0^5 2(0.3)\,ds=0.6(5)=3\) weighted events. (3) The post-event covariate may contain information unavailable immediately before the event, so its value need not be predictable; a predictable integrand must use pre-event information. (4) The jump contributes \(H(T)\Delta N(T)=4H(T)\), not merely \(H(T)\).

Clinical Biostats