SSagauss | R Documentation |
Self starter for a type of bell-shaped curve
agauss(x, eta, beta, delta, sigma1, sigma2)
SSagauss(x, eta, beta, delta, sigma1, sigma2)
x |
input vector |
eta |
maximum value of y |
beta |
parameter controlling the lower values |
delta |
break-point separating the first and second half-bell curve |
sigma1 |
scale for the first half |
sigma2 |
scale for the second half |
This function is described in (doi:10.3390/rs12050827).
a numeric vector of the same length as x containing parameter estimates for equation specified
agauss: vector of the same length as x using an asymmetric bell-shaped Gaussian curve
require(ggplot2)
set.seed(1234)
x <- 1:30
y <- agauss(x, 10, 2, 10, 2, 6) + rnorm(length(x), 0, 0.02)
dat <- data.frame(x = x, y = y)
fit <- minpack.lm::nlsLM(y ~ SSagauss(x, eta, beta, delta, sigma1, sigma2), data = dat)
## plot
ggplot(data = dat, aes(x = x, y = y)) +
geom_point() +
geom_line(aes(y = fitted(fit)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.