Batchalign: Difference between revisions

From Eigenvector Research Documentation Wiki
Jump to navigation Jump to search
imported>Scott
(Created page with "===Purpose=== Convert data columns based on matching ref col to target vector. ===Synopsis=== :aligned = batchalign(data,ref_column,target,options) ===Description=== Stretch...")
 
imported>Jeremy
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
===Purpose===
===Purpose===


Convert data columns based on matching ref col to target vector.
Convert data columns based on matching a reference column to a target vector.


===Synopsis===
===Synopsis===
Line 9: Line 9:
===Description===
===Description===


Stretch or contract data columns based on a reference (target) using given 'method'. Savgol options can be used to exaggerate transitions in data prior to cow.
Stretch or contract data columns based on a '''target''' using given '''method'''. Savgol options can be used to exaggerate transitions in data prior to cow.


====Inputs====
====Inputs====
Line 27: Line 27:


* '''method''': [ 'linear' | {'cow'} | 'padwithnan' ] Alignment method.
* '''method''': [ 'linear' | {'cow'} | 'padwithnan' ] Alignment method.
** 'linear' means the data columns are extented/contracted using linear interpolation to have the same number of data points as the target vector.
** 'cow' applies Correlation Optimized Warping to match the reference column to the target vector, then apply the same transformation to the other columns.
** 'padwithnan' uses NaN values to extend columns, or truncates columns, to have the same number of data points as the target vector.


* '''savgolwidth''': Number of points in savgol filter.
* '''savgolwidth''': Number of points in savgol filter.
Line 32: Line 35:
* '''savgolderiv''': [0,1,2...] Order of derivative to take of target and ref_column before doing alignment (default = 0).
* '''savgolderiv''': [0,1,2...] Order of derivative to take of target and ref_column before doing alignment (default = 0).
[[cow|Cow]] only options.
[[cow|Cow]] only options.
* '''cow.segments ''': number of segments.
* '''cow''': structure with the following fields:
* '''cow.slack''': max range of warping.
** '''cow.segments ''': Segment length.
* '''cow.plots''': Governs plotting with COW (0 = no plots).
** '''cow.slack''': max range of warping. 'slack' value must be less than or equal to segments minus 4.
* '''cow.correlationpower''': correlation power.
** '''cow.plots''': Governs plotting with COW (0 = no plots).
* '''cow.forceequalsegs''': Force equal segment lengths in "xt" and "xP".
** '''cow.correlationpower''': correlation power.
* '''cow.fixmaxcorrection''': Fix maximum correction.
** '''cow.forceequalsegs''': Force equal segment lengths in "xt" and "xP".
** '''cow.fixmaxcorrection''': Fix maximum correction.


===See Also===
===See Also===


[[alignmat]],[[cow]], [[matchrows]]
[[alignmat]], [[batchfold]], [[cow]], [[matchrows]]

Latest revision as of 16:15, 9 June 2014

Purpose

Convert data columns based on matching a reference column to a target vector.

Synopsis

aligned = batchalign(data,ref_column,target,options)

Description

Stretch or contract data columns based on a target using given method. Savgol options can be used to exaggerate transitions in data prior to cow.

Inputs

  • data = (nsample, nvar) dataset or double array containing data columns to align.
  • ref_column = scalar indicating the column # of data that we are going to match OR ref_vector which is a vector to use in match.
  • target = (nsample, 1) vector or dataset to which we are trying to match the ref_column or ref_vector.

Outputs

  • aligned: dataset or double array (depending on input data type) containing the aligned data. If it is a dataset of different number of rows from input then the class, axisscale and labels are set according to the closest row in input dataset.

Options

options = a structure array with the following fields:

  • method: [ 'linear' | {'cow'} | 'padwithnan' ] Alignment method.
    • 'linear' means the data columns are extented/contracted using linear interpolation to have the same number of data points as the target vector.
    • 'cow' applies Correlation Optimized Warping to match the reference column to the target vector, then apply the same transformation to the other columns.
    • 'padwithnan' uses NaN values to extend columns, or truncates columns, to have the same number of data points as the target vector.
  • savgolwidth: Number of points in savgol filter.
  • savgolorder: Order of savgol polynomial.
  • savgolderiv: [0,1,2...] Order of derivative to take of target and ref_column before doing alignment (default = 0).

Cow only options.

  • cow: structure with the following fields:
    • cow.segments : Segment length.
    • cow.slack: max range of warping. 'slack' value must be less than or equal to segments minus 4.
    • cow.plots: Governs plotting with COW (0 = no plots).
    • cow.correlationpower: correlation power.
    • cow.forceequalsegs: Force equal segment lengths in "xt" and "xP".
    • cow.fixmaxcorrection: Fix maximum correction.

See Also

alignmat, batchfold, cow, matchrows