Learn R Programming

detrendr (version 0.1.0)

best_tau: Find the best tau parameter for exponential smoothing detrending.

Description

Use Nolan's algorithm to find the ideal tau parameter for exponential smoothing detrending.

Usage

best_tau(img, cutoff = 0.05, seed = NULL, parallel = FALSE)

Arguments

img

A 3-dimensional array of integers representing the image series. img[i, j, k] is the pixel at x = i, y = j in frame k of the image series.

cutoff

When exponential smoothing, neglect weights which are less than cutoff * central weight. It is fine to leave this parameter at the default level.

seed

A seed for the random number generation needed in this function. If you do not set a seed, one will be chosen randomly.

parallel

Do you want this function to run on multiple cores? If not, use parallel = FALSE (the default). To use n cores, use parallel = n or to use all available cores use parallel = TRUE.

Value

If no detrend is necessary, this function returns NA. If a detrend is required, this function returns a natural number which is the ideal tau parameter for exponential smoothing detrending.

References

Rory Nolan, Luis A. J. Alvarez, Jonathan Elegheert, Maro Iliopoulou, G. Maria Jakobsdottir, Marina Rodriguez-Mu<U+00F1>oz, A. Radu Aricescu, Sergi Padilla-Parra; nandb<U+2014>number and brightness in R with a novel automatic detrending algorithm, Bioinformatics, https://doi.org/10.1093/bioinformatics/btx434.

Examples

Run this code
# NOT RUN {
## These examples are not run on CRAN because they take too long.
## You should still try them for yourself.
img <- read_tif(system.file('extdata', 'bleached.tif', package = 'detrendr'),
                n_ch = 1)
best_tau(img, seed = 0, parallel = 2)
# }

Run the code above in your browser using DataLab