SSagauss: self start for an asymmetric Gaussian bell-shaped curve

SSagaussR Documentation

self start for an asymmetric Gaussian bell-shaped curve

Description

Self starter for a type of bell-shaped curve

Usage

agauss(x, eta, beta, delta, sigma1, sigma2)

SSagauss(x, eta, beta, delta, sigma1, sigma2)

Arguments

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

Details

This function is described in (doi:10.3390/rs12050827).

Value

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

Examples


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)))


femiguez/nlraa documentation built on Jan. 26, 2024, 9:31 p.m.