rankLocReg.default: Ranking local linear regressions according to linearity

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/functions.R

Description

Ranking local linear regressions.

Usage

1
2
3
## Default S3 method:
rankLocReg(xall, yall, alpha, method = c("z", "eq", "pc"),
  verbose = TRUE)

Arguments

xall

A numeric vector.

yall

A numeric vector.

alpha

Minimum window size, expressed as a proportion of total data. Must be higher than 0 and less-than or equal to 1.

method

Ranking method. See details.

verbose

Logical. Should progress be printed?

Details

rankLocReg is the main function around which LoLinR is built. Given independent and dependent variables for a time series or trace data set, rankLocReg tries to find the 'most linear' ordered subset of the full data set. This is accomplished by fitting all possible local linear regressions with minimum window size alpha, and ranking them according to the combined linearity metric $L$. $L$ quantifies linearity from 1) the skewness of the standardized residuals, 2) the range of the 95 residuals (a modified Breusch-Godfrey $R^2$). These three components of $L$ can be weighted in 3 different ways: unweighted (method="z"), equal weights (method="eq"), and percentile ranks (method="pc"). If method is unspecified, default to z. For highly skewed, or otherwise ill-behaved data we strongly advise examining the relative behaviour of the different weighting methods using plot.rankLocReg.

For data sets with greater tha ~500 observations, we suggest thinning the number of observations using thinData, given that this does not compromise the resolution of the data for the question of interest.

Value

A data frame with important output from all local regressions, ranked by metric L following raking method chosen by argument method.

Author(s)

Colin Olito and Diego Barneche.

See Also

locReg, thinData, plot.rankLocReg.

Examples

1
2
3
4
# load sea urchin respirometry data
data(UrchinData)
# rank L metric by method 'eq'
allRegs  <-  rankLocReg(xall=UrchinData$time, yall=UrchinData$D, alpha=0.3, method="eq", verbose=TRUE)

colin-olito/LoLinR documentation built on May 13, 2019, 9:54 p.m.