nnmt._solvers._firing_rate_integration

nnmt._solvers._firing_rate_integration(firing_rate_func, firing_rate_params, input_dict, nu_0=None, fixpoint_method='ODE', eps_tol=1e-07, t_max_ODE=1000, maxiter_ODE=1000)[source]

Solves the self-consistent equations for firing rates.

Parameters:
firing_rate_funcfunc

Function to be integrated.

firing_rates_paramsdict

Parameters passed to firing_rates_func

input_dictdict

Dictionary specifying the functions that need to be computed in each iteration step to get the input for the firing rate function. It should specify the names of the respective firing_rate_func arguments as keys and provide a dictionary for each input including the function using the key ‘func’ and the parameters using the key ‘params’:

{'arg1': {'func': func1, 'params': params_dict1}, ...}

All input functions are assumed to take the firing rate as their first argument.

nu_0[None | np.ndarray]

Initial guess for fixed point integration. If None the initial guess is 0 for all populations. Default is None.

fixpoint_methodstr

Method used for finding the fixed point. Currently, the following method are implemented: ODE, LSQTSQ. ODE is a very good choice, which finds stable fixed points even if the initial guess is far from the fixed point. LSQTSQ also finds unstable fixed points but needs a good initial guess. Default is ODE.

ODE :
Solves the initial value problem

dnu / ds = - nu + firing_rate_func(nu)

with initial value nu_0 on the interval [0, t_max_ODE]. The final value at t_max_ODE is used as a new initial value and the initial value problem is solved again. This procedure is iterated until the criterion for a self-consistent solution

max( abs(nu[t_max_ODE-1] - nu[t_max_ODE]) ) < eps_tol

is fulfilled. Raises an error if this does not happen within maxiter_ODE iterations.

LSTSQ :
Determines the minimum of

(nu - firing_rate_func(nu))^2

using least squares. Raises an error if the solution is a local minimum with mean squared differnce above eps_tol.

eps_tolfloat

Maximal incremental stepsize at which to stop the iteration procedure. Default is 1e-7.

t_max_ODEint

Determines the interval [0, t_max_ODE] on which the initial value problem for the method ODE is solved in a single iteration. Default is 1000.

maxiter_ODEint

Determines the maximum number of iterations of the initial value problem for the method ODE. Default is 1000.