A helper function for fitting a model to constraints.
fit_to_constraints(
model_id,
d,
model_constraints,
tr,
roi_weights,
allow_overlap,
population,
iter,
mutation_rate,
mutation_factor,
elitism,
hrf,
t,
p_boynton,
p_spm,
f,
autohrf = NULL,
verbose = TRUE
)
Returns the best model given provided constraints.
ID of the model.
A dataframe with the signal data: roi, t and y. ROI is the name of the region, t is the timestamp and y the value of the signal.
A list of model specifications to use for fitting. Each specification is represented as a data frame containing information about it (event, start_time, end_time, min_duration and max_duration).
MRI's repetition time.
A data frame with ROI weights: roi, weight. ROI is the name of the region, weight a number that defines the importance of that roi, the default weight for a ROI is 1. If set to 2 for a particular ROI that ROI will be twice as important.
Whether to allow overlap between events.
The size of the population in the genetic algorithm.
Number of iterations in the genetic algorithm.
The mutation rate in the genetic algorithm.
The mutation factor in the genetic algorithm.
The degree of elitism (promote a percentage of the best solutions) in the genetic algorithm.
Method to use for HRF generation.
The t parameter for Boynton or SPM HRF generation.
Parameters for the Boynton's HRF.
Parameters for the SPM HRF.
Upsampling factor.
Results of a previous autohrf run to continue.
Whether to print progress of the fitting process.