View source: R/functions_ABC.R
mode_locfit | R Documentation |
This function computes and outputs the the mode of a locfit object.
mode_locfit(locx, xlim, precision = 1000)
locx |
is a locfit object. |
xlim |
is a vector with two entries.The first entry is the minimum of the distribution and the second entry is the maximum value of the distribution. |
precision |
value indicating the number of entries evaluated. The larger the value the higher the precision. The default value is 1000. |
The stats::predict()
function is used to predict the y-axis values of the
locfit object and the mode is defined as the value where that prediction is
maximized.
a numeric value of the mode of the input locfit object.
# create a random distribution
x <- rnorm(n = 1000, mean = 2, sd = 25)
# perform a local regression
loc <- locfit::locfit(~x)
# compute the mode of the locfit object
mode_locfit(locx = loc, xlim = c(min(x), max(x)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.