Description Usage Arguments Value Examples
View source: R/PeakFunctions_func_biGaussian.R
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
1 | func_biGaussian(x, mu, sigma1, sigma2, probDensity = TRUE, k)
|
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' |
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
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.