# Integral with respect to a martingale

In my survival analysis course we use integrals that integrate with respect to some finite variation process. One of which is the counting process, which is straight forward to understand since you just sum over jump times. But I have no clue what it means to integrate with respect to a martingale? So something like(Lebesgue-Stieltjes notation):

$$\int_0^Tf(t)dM(t)$$

If $X:\Omega\times\mathbb{R}\rightarrow\mathbb{R}$ is a stochastic process which is a semimartingale (that is one can write X as the sum of a local martingale starting at zero and a process of finite variation; so every martingale starting at zero is a semimartingale), the stochastic integral $$\int_0^Tf(t)dX(t)$$ (sometimes also written as $(f\dot\ X)_T$) is first defined for simple predictable processes $f$ of the form $f=1_{\{(\omega,t)|r<t\leq s\}}$ ($r,s\in\mathbb{R}$ and $r<s$) as $$\int_0^Tf(t)dX(t)=f(\min(s,T))-f(\min(r,T))$$ for $T\geq 0$ and the mapping $f\mapsto f\dot\ X$ from the simple predictable processes as domain will be extended to the set of predictable processes s.t. that $$(\omega,t)\mapsto (f\dot\ X)_t(\omega)$$ is adapted, $f\mapsto f\dot\ X$ is linear and if $f_n$ converges to $f$ pointwise and the $f_n$ are bounded, then $(f_n\dot\ X)_t\rightarrow (f\dot\ X)_t$ for $t\geq 0$.
If $X$ is a process of finite variation (hence it is a semimartingale), then the stochastic integral $(f\dot\ X)_T$ is just the Lebesgue–Stieltjes-integral.
Under certain conditions, if $(X_t)_{t\geq 0}$ is a martingale, then also $((f\dot\ X)_T)_{T\geq 0}=(\int_0^Tf(t)X_t)_{T\geq 0}$ is a martingale.