bestref: Identification of optimal reference

Description Usage Arguments Value Author(s) Examples

View source: R/bestref.R

Description

This function calculates a similarity matrix and returns the sample number that is most similar to all other samples. This is possibly preferable as a reference sample since warping then may be kept to a minimum. Either RMS or WCC may be used as similarity functions.

Usage

1
2
bestref(x, optim.crit = c("WCC", "RMS"),
               trwdth=20, wghts = NULL, smooth.param = 0)

Arguments

x

data matrix or array of signals, specified row-wise. In case of an array, the third dimension should differentiate between the different samples

optim.crit

either "WCC" or "RMS"

trwdth

the width of the triangle in the WCC criterion, given as a number of data points. Default: 20

wghts

Optional weights vector in the WCC criterion; will be calculated from the triangle width if necessary. Sometimes it is more efficient to pre-calculate it and give it as an argument

smooth.param

smoothing parameter for smoothing the signal when optim.crit equals "RMS". If no smoothing is required, set this to 0

Value

A list containing two elements:

best.ref

the index of the best reference(s)

crit.values

the qualities as measured by either RMS or WCC

Author(s)

Jan Gerretzen, Ron Wehrens

Examples

1
2
3
4
5
data(gaschrom)
bestref(gaschrom)
bestref(gaschrom, optim.crit = "WCC", trwdth = 50)
bestref(gaschrom, optim.crit = "RMS")
bestref(gaschrom, optim.crit = "RMS", smooth.param = 1e5)

ptw documentation built on Jan. 19, 2022, 5:07 p.m.