evaluate_model: evaluate_model

View source: R/modelling.R

evaluate_modelR Documentation

evaluate_model

Description

A function for evaluating the model against the data.

Usage

evaluate_model(
  d,
  model,
  tr,
  roi_weights = NULL,
  hrf = "spm",
  t = 32,
  p_boynton = c(2.25, 1.25, 2),
  p_spm = c(6, 16, 1, 1, 6, 0),
  f = 100,
  verbose = TRUE
)

Arguments

d

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.

model

A data frame containing information about the model to use and its events (event, start_time and duration).

tr

MRI's repetition time.

roi_weights

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.

hrf

Method to use for HRF generation, can be "boynton" or "spm".

t

The t parameter for Boynton or SPM HRF generation.

p_boynton

Parameters for the Boynton's HRF.

p_spm

Parameters for the SPM HRF.

f

Upsampling factor.

verbose

Whether to print a report of the evaluation results.

Value

Returns a list that contains the model, fits of events for each ROI, convolved events, TR and evaluation scores for each ROI.

Examples

# create the model
m <- data.frame(event = c("encoding", "delay", "response"),
start_time = c(0, 2.5, 12.5), duration = c(2.5, 10, 5))

# evaluate
df <- flanker
res <- evaluate_model(df, m, tr = 2.5)


demsarjure/autohrf documentation built on Feb. 3, 2024, 6:38 a.m.