DEN_SHARED_NNLS_model_setup: Model template based on Denison et al.(2020)'s model

View source: R/model_setup_helpers.R

DEN_SHARED_NNLS_model_setupR Documentation

Model template based on Denison et al.(2020)'s model

Description

Creates trainings matrix and penalties for a fully penalized version of a model inspired by the models investigated by Denison et al. (2020). Among the parameters introduced by Denison et al. (2020) was an intercept/offset term. Apart from estimating this term per factor level, separate sets of coefficients are estimated per factor level with the h_basis terms (as was done by Wierda et al., 2012). All those coefficients are again constrained to be non-negative. The intercept terms are not constrained.

This model differs from the one by Wierda et al. (2012) and Denison et al. (2020) in that it penalizes the coefficients corresponding to the h_basis terms. Specifically, it enforces a single penalty term shared by all factor levels (e.g., this is similar to the 'fs' basis in mgcv, Wood, 2017). The form of the penalty expressed on all of the basis functions is a simple identity matrix. We here also penalize all intercept terms, again with a single penalty.

Usage

DEN_SHARED_NNLS_model_setup(
  expanded_time,
  expand_by,
  time,
  fact,
  pulse_locations,
  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

fact

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

pulse_locations

A numeric vector containing index values of pulse loc.

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: Denison, R. N., Parker, J. A., & Carrasco, M. (2020). Modeling pupil responses to rapid sequential events. Behavior Research Methods, 52(5), 1991–2007. https://doi.org/10.3758/s13428-020-01368-6

See: Wierda, S. M., van Rijn, H., Taatgen, N. A., & Martens, S. (2012). Pupil dilation deconvolution reveals the dynamics of attention at high temporal resolution. Proceedings of the National Academy of Sciences of the United States of America, 109(22), 8456–8460.

For penalty setup 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.