chanInterp: Spherical spline interpolation

Description Usage Arguments Value

View source: R/chan_pos.R

Description

chanInterp performs spherical spline interpolation. It can impute bad channels (i.e. channels with missing values) or interpolate to artbitrary positions on the scalp.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
chanInterp(
  dat,
  ch_pos,
  interp_pos = NULL,
  maxNA = 0.3,
  m = 4L,
  N = 7L,
  lambda = 1e-10,
  type = c("voltage", "laplacian", "scd"),
  alarm_tolerance = 0.01,
  error_on_alarm = TRUE
)

Arguments

dat

a numeric vector, matrix, data.frame or array with named dimnames

ch_pos

channel (electrode) positions; should be a matrix or data.frame with the following column names (order is not important): "theta", "phi" (spherical coordinates), or "x", "y", "z" (cartesian coordinates)

interp_pos

interpolation positions, if they differ from ch_pos; should be in the same format as ch_pos (default: NULL)

maxNA

numeric value given as ratio (0 < maxNA < 1) or integer (maxNA >= 1 ); it determines the maximum ratio or number of non-missing channels in a time sample. If exceeded, no interpolation occurs in the given time sample.

m

integer value (default: 4); the flexibility of the spline

N

integer value (default: 7); number of terms in the Legendre polynomial. You should probably increase it (even up to 100L) for realistic (i.e. non-spherical) or high-density electrode arrangements.

lambda

numeric value (default: 1e-10); smoothing factor

type

character value, do not use yet

alarm_tolerance

numeric value (default: 1e-2); if the maximal absolute interpolation error at any time sample exceeds this limit, a message is shown or an error is thrown depending on error_on_alarm. If set to NULL, no check is performed.

error_on_alarm

defaults to TRUE, see alarm_tolerance

Value

An object having the same attributes as dat


tdeenes/eegR documentation built on April 19, 2021, 4:17 p.m.