Skip to main content
`Ctrl`+`K`

# Stochastics

Class to manage random operations of GPS tracks

tracklib.algo.Stochastics.khi2cdf(dof, prob=0.05)

  TODO

tracklib.algo.Stochastics.khi2test(X, SIGMA, prob=0.05)

  TODO

class tracklib.algo.Stochastics.NoiseProcess(amps=None, kernels=None, distribution=1)

  TODO

  __init__(amps=None, kernels=None, distribution=1)

    TODO

  __str__()

    TODO

  noise(track, N=1, mode='linear', force=False)

    TODO

  plot()

    TODO

tracklib.algo.Stochastics.seed(integer)

  TODO

tracklib.algo.Stochastics.gaussian_process(self, timestamps, kernel, factor=1.0, sigma=0.0, cp_var=False)

  Track interpolation and smoothing with Gaussian Process (GP)

  Parameters

    - timestamps – points where interpolation must be computed. May be a list of timestamps, a track or a number of seconds

    - kernel –

      a symetric function k(xi-xj) describing the statistical similarity between the coordinates X,Y,Z taken in two points :

      \[ \begin{align}\begin{aligned}k(t2-t1) = Cov(X(t1), X(t2))\\k(t2-t1) = Cov(X(t1), X(t2))\\k(t2-t1) = Cov(Z(t1), Z(t2))\end{aligned}\end{align} \]

    - factor – unit factor of variance if the kernel must be scaled

    - sigma – observation noise standard deviation (in coords units)

    - cp_var – compute covariance matrix and store pointwise sigmas

  Returns

    interpolated/smoothed track (without AF)

tracklib.algo.Stochastics.randomColor()

  TODO

tracklib.algo.Stochastics.noise(track, sigma=[1], kernel=[<tracklib.core.Kernel.DiracKernel object>], distribution=1, mode='linear', force=False, cycle=False)

  Track noising with Cholesky factorization of gaussian process covariance matrix:

  \[h(x2-x1)=\exp-\left(\frac{x2-x1}{scope}\right)^2\]

  If \(X\) is a gaussian white noise, \(Cov(LX) = L^t*L\) => if \(L\) is a Cholesky factorization of a semi-postive-definite matrix \(S\), \(then Cov(LX) = L^T*L = S\) and \(Y=LX\) has \(S\) as covariance matrix.

  Parameters

    - track – the track to be smoothed (input track is not modified)

    - sigma – noise amplitude(s) (in observation coordinate units)

    - kernel – noise autocovariance function(s) :param mode: ‘linear’ (default), ‘circular’ or ‘euclidian’ :param force: force definite-positive matrix with removal of negative eigen values

tracklib.algo.Stochastics.randomizer(input, f, sigma=[7], kernel=[<tracklib.core.Kernel.GaussianKernel object>], N=10)

  Randomizing traces for sensitivity analysis on output f

  Parameters

    - input – a track, or list of tracks to be randomized

    - f – a function taking a list of tracks as input

    - sigma – noise amplitude (in observation coordinate units)

    - N – number of simulations to generate (default is 100)

    - scope_s – spatial autocorrelation scope (measured along track curvilinear abscissa in observation coordinate units)