lv_sens.main

Main: run a sensitivity analysis of the Lotka-Volterra equations.

Functions

compare_gradient_fd(theta, x_data, dt, N, x0)

Compare the adjoint-based gradient with a finite difference approximation.

generate_data(theta, dt, N, x0, noise_std[, ...])

Generate measurement data from a ground truth forward solution.

get_parser()

Return arguments parser.

main()

Main function.

lv_sens.main.compare_gradient_fd(theta: ndarray[Any, dtype[float64]], x_data: ndarray[Any, dtype[float64]], dt: float, N: float, x0: ndarray[Any, dtype[float64]]) None[source]

Compare the adjoint-based gradient with a finite difference approximation.

Parameters:
  • theta – parameters at which to evaluate gradient

  • x_data – data array

  • dt – time step

  • N – number of time steps

  • x0 – initial guess

lv_sens.main.generate_data(theta: ndarray[Any, dtype[float64]], dt: float, N: int, x0: ndarray[Any, dtype[float64]], noise_std: float, plot: bool = False) ndarray[Any, dtype[float64]][source]

Generate measurement data from a ground truth forward solution.

Parameters:
  • theta – parameter for reference solution

  • dt – time step

  • N – number of time steps

  • x0 – initial guess

  • noise_std – noise standard deviation

  • plot – toggle to plot solution and data points

Returns:

data array

lv_sens.main.get_parser() ArgumentParser[source]

Return arguments parser.

lv_sens.main.main() None[source]

Main function.

Parse command line arguments and run the chosen simulation.