epx | R Documentation |
Derives one or more EPx/LPx values for the supplied effect scenarios, i.e. it calculates the multiplication factors of an exposure profile that cause x% of effect. Scenarios are processed in parallel, if possible.
epx(
scenarios,
level = c(10, 50),
effect_tolerance = 0.001,
factor_cutoff = NA,
min_factor = 1e-30,
max_factor = 1e+30,
verbose = FALSE,
ep_only = FALSE,
long_format = FALSE,
...
)
scenarios |
table or vector of |
level |
effect levels in percent (%), defaults to |
effect_tolerance |
|
factor_cutoff |
optional |
min_factor |
|
max_factor |
|
verbose |
|
ep_only |
|
long_format |
|
... |
additional arguments passed on to |
To estimate EPx values, a binary search on multiplication factors is conducted.
The algorithm can achieve arbitrary precision in terms of effects. The
same approach is implemented in the morse
package in the MFx()
function.
Convergence is often achieved in less than 10 iterations per effect level and
endpoint.
Internally, a knowledge base of all tried factors and resulting effect levels is
kept to speed up convergence if more than one endpoint or effect level was
requested. The algorithm will automatically sweep the range of multiplication
factors as needed but hard cutoff values are implemented to avoid infinite loops;
the algorithm will halt with an error message if tried factors are
smaller than 1e-30
or greater than 1e30
.
The precision of reported EPx values is controlled by the argument
effect_tolerance
and is given as the upper absolute error threshold of
effects that is deemed acceptable. The default value of 0.001
ensures that
a derived EPx will result in an effect of x% ± 0.1. Decreasing the
effect_tolerance
will result in additional model iterations and longer
runtime. Setting an extremely small tolerance value may lead to a breakdown
of the algorithm due to the occurrence of extremely small, quasi-random
numerical errors in simulation results.
The original tibble
with additional columns named after the request effect levels, e.g. L.EP10.
If no tibble was used as argument, then a new one is created. The first column scenario
will contain
the supplied EffectScenario
objects.
minnow_sd %>% epx()
minnow_sd %>% epx(level=c(10,23,42))
# displays infos about tested multiplication factors
minnow_sd %>% epx(verbose=TRUE)
# return results as a table in wide format
minnow_sd %>% epx(long_format=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.