This function is used by optim
to find the best fit for
individual trials by minimizing the sum of areas between the response rate
and the target rate. Do not call this function directly.
ind_trials_obj_fun(params, r_times, trial_duration)
a numeric value representing the sum of areas between the response rate and the target rate.
A vector of parameters to be optimized.
Vector of response times
Duration of the trial