create_spike_matrix_term: Spike matrix creation

View source: R/model_setup_helpers.R

create_spike_matrix_termR Documentation

Spike matrix creation

Description

Create basis part of the model matrix as described by Wood (2017). Essentially, this means creating a matrix with a column for each pulse location and to assign a pupil basis (convolved with that location) to each column.

Usage

create_spike_matrix_term(
  expanded_time,
  expand_by,
  time,
  pulse_locations,
  fact,
  n,
  t_max,
  f
)

Arguments

expanded_time

A numeric vector containing positive time values in ms, expanded by a certain amount of ms

expand_by

Expansion time in ms passed to papss::pupil_solve(expand_by=) divided by sample length in ms

time

A numeric vector containing positive time values in ms

pulse_locations

A numeric vector containing index values of pulse loc.

fact

The factor column from the data-frame passed to papss::pupil_solve()

n

Parameter defined by Hoeks & Levelt (number of laters)

t_max

Parameter defined by Hoeks & Levelt (response maximum in ms)

f

Parameter defined by Wierda et al. (scaling factor)

Details

See: Wood, S. N. (2017). Generalized Additive Models: An Introduction with R, Second Edition (2nd ed.). Chapman and Hall/CRC.


JoKra1/papss documentation built on June 15, 2022, 8:57 a.m.