Non-linear alignment using Correlation Optimized warping (COW). This is cow but with argument structure like other ..._align functions.

# Default S3 method
cow_align(
  x,
  y = NULL,
  by = NULL,
  seg,
  slack,
  print.report = FALSE,
  r.power = FALSE,
  pad.method = 1,
  ...
)

Source

Based on matlab code at http://www.models.life.ku.dk/dtw_cow.

Arguments

x

First vector or a data.frame containing vector to use as reference when COW aligning y data.

y

Second vector or data.frame containing vector to COW warp align with x.

by

If x or y are data.frames, the names of data columns to aligned.

seg

Segment size for warping.

slack

Segment size expansion/compression range.

print.report

(logical) print segment report.

r.power

(logical or numeric) correlation power (1-4).

pad.method

Handling method if x and y are different lengths: 1 (default) Start with start-points aligned; 2 Start with mid-point aligned.

...

Other arguments, typically applied by generic alignment methods or ignored.

Value

By default, cor_align returns x and y as an aligned data.frame. It also provides a lag correlation profile (plot) and alignment report. The extra function, output, can be used to modify this behavior, see also alignment.

Note

This function is based on previous matlab (see Source), but some formal arguments and parameters have been changed to make function more consistent with other alignment functions.

References

Correlation optimized warping was developed as a preprocessing method for chromatographic Data:

Niels-Peter Vest Nielsen, Jens Micheal Carstensen and Jorn Smedegaard, 1998, Aligning of single and multiple wavelength chromatographic profiles for chemometric data analysis using correlation optimised warping. J. Chrom. A 805(1998), 17-35

Giorgio Tomasi, Frans van den Berg and Claus Andersson, 2004, Correlation optimized warping and dynamic time warping as preprocessing methods for chromatographic Data, Journal of Chemometrics 18 (2004), 231-241.

Author

Daniel Quiroz Moreno with contributions by Karl Ropkins.