func_lorentzian: Calculate Cauchy (Lorentz) probability density function or a...

Description Usage Arguments Value Examples

View source: R/PeakFunctions_func_lorentzian.R

Description

Calculate Cauchy (Lorentz) probability density function or a Lorentzian Peak

Usage

1
func_lorentzian(x, x0, gamma, probDensity = TRUE, k)

Arguments

x

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

x0

location parameter specifying the location of the peak of the distribution

gamma

scale parameter specifying the half-width at half-maximum (HWHM)

probDensity

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

k

amplitude of the peak at location x0

Value

a vector of y-coordinates the same length as x

Examples

1
2
3
4
5
6
7
#Probability density function
xVec <- seq(from = 1, to = 100, by = 0.1)
pdist <- func_lorentzian(x = xVec, x0 = 50, gamma = 1, probDensity = TRUE)
plot(x = xVec, y = pdist)
#Make a peak
lpeak <- func_lorentzian(x = xVec, x0 = 50, gamma = 1, probDensity = FALSE, k = 10)
plot(x = xVec, y = lpeak)

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