Description Usage Value Functions See Also Examples
Helper functions meant to be used in conjunction with
mbte_fit
.
1 2 3 4 5 |
A fitting-quosure
will be returned.
tr_linear
: Determine a linear trend using
lm
.
tr_exponential
: The presence of an exponenetial trend is
determined by applying a log-transformation to the signal-values and
fitting them via lm
. A vector of the correct length
with NA
's will be returned if some values of the signal are zero or
negative.
tr_logistic
: Fit a sigmoid model using
nls2
. This fitting helper requires the 'nls2'-package
(the "port"-algorithm with 500 iterations is used). The signal-tibble to
fit must have at least five rows (see mbte_fit
). Otherwise
NA
's are returned.
The formula used for fitting is
value ~ A / (1 + exp(B * (C - time))) + D
. NOTE: warnings are
suppressed.
filtered_signals
(dataset used in examples)
1 2 3 4 5 6 7 8 9 10 11 12 13 | data(filtered_signals)
# Use fitting helpers to fit signals
#
# NOTE: The unquoting operator (`!!`) is used, since fitting helpers return
# quosures.
fits1 <- mbte_fit(filtered_signals, lin = !!tr_linear())
fits1
# Equivalent without using fitting-helpers (columns for time and value of
# signal have to be provided explicitly)
fits2 <- mbte_fit(filtered_signals, lin = lm(value ~ t, .signal))
fits2
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.