func_biGaussian: Calculate a Bi-Gaussian Probability Density or Peak

Description Usage Arguments Value Examples

View source: R/PeakFunctions_func_biGaussian.R

Description

The left side gaussian is calculated with sigma 1 along Y up to the value < mu. The remaining right side of the gaussian is calculated with sigma2

Usage

1
func_biGaussian(x, mu, sigma1, sigma2, probDensity = TRUE, k)

Arguments

x

a vector of x-coordinates from which the corrisponding y-coordinates are calculated

mu

the center of the peak

sigma1

the standard deviation of the left side gaussian component

sigma2

the standard deviation of the right side gaussian component

probDensity

Should the function return a probability density 'TRUE' or a bigaussian peak 'FALSE' with amplitude k? default is 'TRUE'.

k

Amplitude of the peak. Only used when 'probDensity == FALSE'

Value

a vector of y-coordinates the same length as x with names "1" and "2" corrisponding to the two gaussian components used to generate the curve

Examples

1
2
3
4
5
6
7
8
#Probability density of bigaussian
xVec <- seq(from = 1, to = 100, by = 0.1)
pdist <- func_biGaussian(x = xVec, mu = 10, sigma1 = 1, sigma2 = 2, probDensity = TRUE)
plot(x = xVec, y = pdist, col = names(pdist))

#bigaussian peak
gpeak <- func_biGaussian(x = xVec, mu = 10, sigma1 = 1, sigma2 = 2, probDensity = FALSE, k = 10)
plot(x = xVec, y = gpeak, col = names(gpeak))

pmbrophy/SummitR documentation built on May 20, 2020, 12:36 a.m.