simulate_tracks

Simulate fBm trajectories.

This module contains functions used to simulate fractional Brownian motion (fBm) trajectories. Each dimension is generated with the fBm kernel (Lundahl et al. 1986) using a diffusion and alpha value. The tracks are made of a mixture of N states following the probabilities to transition.

simulate_tracks.generate_fbm_tracks(parms)

Creates multiple fBm trajectories with a mixture of states which will be used for training the neural network.

Parameters:

params – Stored parameters containing instructions to generate fBm trajectories.

Returns:

The dataframe storing all generated fBm trajectories with keys: track_id, frame, x, y and state

Return type:

pd.DataFrame

simulate_tracks.get_fbm(total_frame, alpha, diff)

Generates a 1D fBm using the formula from Lundahl et al. 1986.

Parameters:
  • total_frame (int) – The total number of frames to generate

  • alpha (float) – The alpha value for the simulation.

  • diff (float) – The diffusion value for the simulation.

Returns:

The 1-dimensional fBm generated track.

Return type:

np.array

simulate_tracks.run_track_simulation(parms)

Run the simulation by first generating fBm trajectories and then computing all features.

Parameters:

params – Stored parameters containing instructions to generate fBm trajectories.

Returns:

The dataframe storing all generated fBm trajectories and computed features. Dataframe also saved as a csv file.

Return type:

pd.DataFrame