2.2.1.26. sdepy.process.tdiff

process.tdiff(dt_exp=0, fwd=True)[source]

Process increments along the timeline, optionally weighted by time increments.

Parameters:
dt_exp : int or float, optional

Exponent applied to time increment weights. If 0, returns process increments. If 1, approximates a time derivative. If 0.5, approximates realized volatility.

fwd : bool, optional

If True, the differences are forward-looking

Returns:
q : process

If p is a process shaped (N,) + p.vshape + (p.paths,), with timeline t, p.tdiff(dt_exp, fwd) returns a process q, shaped (N-1,) + p.vshape + (p.paths,) with values

q[i] = (p[i+1] - p[i])/(t[i+1] - t[i])**dt_exp

If fwd evaluates to True, q[i] is assigned to time point t[i] (q stores at t[i] the increments of p looking forwards) or to t[i+1] otherwise (increments looking backwards).

See also

tder
tint

Notes

if p is a process instance realizing a solution of the SDE dp(t) = sigma(t)*dw(t) across several paths, then

p.tdiff(dt_exp=0.5).pstd()

is a 1-path process that estimates sigma(t).