ptwgrid {ptw} | R Documentation |
Calculate RMS or WCC values on a grid
Description
Calculates values of the chosen optimization criterion (RMS or WCC) on a grid defined by the coefficients of the warping function.
Usage
ptwgrid(ref, samp, selected.traces,
coef.mins, coef.maxs, coef.lengths,
optim.crit = c("WCC", "RMS"),
smooth.param = 1e05,
trwdth = 20)
Arguments
ref |
reference. Either a vector (containing one reference signal) or a matrix (one reference per row). If more than one reference is specified, the number of reference signals must equal the number of sample signals |
samp |
sample. A vector (containing one sample signal) or a matrix (one sample per row). If more than one sample is specified, the number of sample signals must equal the number of reference signals |
selected.traces |
optional vector containing the row numbers to
use from |
coef.mins |
a vector containing the respective minimal values of coefficients for the grid. The first number is the minimal zeroth-order coefficient (i.e., a constant shift); further numbers indicate the minimal linear, quadratic, ... stretches |
coef.maxs |
a vector containing the maximal values of coefficients for the grid |
coef.lengths |
a vector of the same length as coef.maxs and coef.mins containing the number of steps in which to vary the respective coefficients between their minimum and maximum value |
optim.crit |
either |
smooth.param |
smoothing parameter for smoothing the reference
and sample when |
.
trwdth |
the width of the triangle in the WCC criterion during the optimization, given as a number of data points. Default: 20 |
Details
In contrast to ptw, only the three situations leading to one warping function are distinguished here:
One sample and one reference;
Several samples, warped to an equal number of references (pair-wise);
Several samples, warped to a single reference.
Which situation is applicable is determined from the dimensions of
ref
and samp
.
Value
An array of dimension length(coef.mins)
and maximal indices
per dimension specified by coef.lengths
Author(s)
Tom Bloemberg, Jan Gerretzen, Ron Wehrens
See Also
Examples
## Not run:
data(gaschrom)
mygrid <- ptwgrid(gaschrom[1,], gaschrom[16,],
coef.mins = c(-10, .9), coef.max = c(10, 1.1),
coef.lengths = c(21, 21))
image(seq(-10, 10, length = 21),
seq(.9, 1.1, length = 21),
mygrid)
## End(Not run)