warp: Compute time-warping weights

Description Usage Arguments Details Note See Also

View source: R/warp.R

Description

warp computes time-warping weights which can be used for time-alignment of ERP curves (see align). It is a wrapper around time_warping. See its documentation for references to the time-warping algorithm.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
warp(
  erp,
  align_dim,
  time_dim = "time",
  lambda = 0,
  method = c("mean", "median"),
  smooth_data = FALSE,
  smooth_times = 25L,
  verbose = FALSE,
  time_points = NULL,
  ...
)

Arguments

erp

a numeric matrix or array of ERPs

align_dim

numeric or character index of the dimension which groups the individual time series. If missing, and 'erp' is a matrix, it is the dimension which is not 'time_dim'. See Details.

time_dim

numeric or character index of the time dimension (default: "time")

lambda

numeric scalar which controls the elasticity (default: 0; higher lambda means less elastic curves)

method

warp and calculate to Karcher Mean ("mean", the default) or Karcher Median ("median"). The latter option seems buggy; do not use it in serious analyses.

smooth_data

logical value whether to smooth data using box filter (default: FALSE)

smooth_times

numeric scalar; number of times to apply box filter if 'smooth_data' is TRUE (default: 25L)

verbose

logical value whether iteration messages should be displayed and plots should be produced

time_points

numeric vector of time points at which the ERPs were sampled. If NULL (default), it is derived from the dimnames attribute of time dimension of the ERP array.

...

further arguments passed to fnDims (e.g. parallel)

Details

In the standard case, warp takes a matrix as input which represent multiple time series (where the individual time series are either the columns or the rows of the matrix). However, warp also accepts multidimensional array as input which is treated as a collection of independent time X align_dim matrices (the order of the dimensions is not relevant).
warp returns an array of the same size as erp consisting of the warping weights. The weights can be used for time-alignment of the same or an other ERP array in align.

Note

The defaults of warp are not necessarily identical to the defaults of the underlying time_warping function and are subject to change in the future.

See Also

align for time-aligning transformation and examples, and fnDims for additional parameters


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