Module Sde.Brownian
Brownian paths with their space–time Lévy area.
A path is a virtual tree over [t0, t1] (Foster, Lyons and Oberhauser, 2020; Jelinčič et al., 2024): each query descends depth levels of bisections, each drawing the midpoint's increments and areas from their distribution given the interval's, under a key that is a pure function of the path's key and the node. So a path is one function of time, whatever the queries: marches with different steps see one path. Steps finer than (t1 − t0) / 2^depth see, inside each finest interval, the path's mean given that interval's increment and area, a quadratic, and lose their stated order.
type ('b, 'd) tThe type for Brownian paths of dtype 'b.
val v :
'd Nx.Rng.key ->
(float, 'b) Nx.dtype ->
shape:int array ->
t0:float ->
t1:float ->
depth:int ->
('b, 'd) tv key dtype ~shape ~t0 ~t1 ~depth is a Brownian path of independent standard components of shape shape over [t0, t1], resolved to (t1 − t0) / 2^depth.
Raises Invalid_argument if t0 or t1 is not finite, if t1 <= t0 or t1 − t0 is not finite once the ends are rounded to dtype, if depth is not in [0, 30], or if a dimension of shape is negative.
val increment :
('b, 'd) t ->
(float, 'b, 'd) Nx.t ->
(float, 'b, 'd) Nx.t ->
(float, 'b, 'd) Nx.t * (float, 'b, 'd) Nx.tincrement w s t is W t − W s and the space–time Lévy area over [s, t], H = (1 / (t − s)) ∫_s^t (W r − W s − (r − s) / (t − s) (W t − W s)) dr, each of the path's shape; H is zero when s = t. s and t are scalars. Increments over adjacent intervals compose by Chen's relation. A query costs 2 depth normal draws of the path's shape at each end; a derivative in a time through the path has no meaning.
Raises Invalid_argument through Nx.check if s or t lies outside [t0, t1].
val walk : ('a, 'b, 'd, 'e) Nx.Ptree.Walk.cursor -> ('f, 'd) t -> ('f, 'e) twalk c w walks the path w: its key at key (Nx.Rng.walk), the shape's dimensions reported at shape, the interval's ends at t0 and t1, and the depth reported at depth. Nx.Ptree.v walk describes paths. A path draws from its key, so a compiled function takes it as an argument; a path it captures holds a constant key, and draws the same numbers on every call.