Evaluates the Lorentz (Cauchy) probability density function (PDF) for real-valued argument x.
$$f\left(x ; x_{0}, \gamma\right)=\frac{1}{\pi \gamma}\left[\frac{\gamma^{2}}{\left(x-x_{0}\right)^{2}+\gamma^{2}}\right]$$
where \(x_{0}\) is the location parameter, which specifies the location of the peak of the distribution; and \(\gamma\) is the scale parameter, which specifies the half-width at half-maximum (HWHM), and \(2\gamma\) is the full-width at half-maximum (FWHM). By default, \(x_{0}=0\) and \(\gamma=1\).
Syntax |
Description |
---|---|
f = lorentzpdf(x) |
Returns the Lorentz (Cauchy) probability density function (PDF) for real-valued argument x. By default, \(x_{0}=0\) and \(\gamma=1\). |
f = lorentzpdf(x,\(x_{0}\),\(\gamma\)) |
Returns the Lorentz (Cauchy) probability density function (PDF) for real-valued argument x. \(x_{0}\) is the mean and \(\gamma\) is the HWHM. |
Example
The following example plots the Lorentz distributions PDF for the range [-4, 4], with \(x_{0}\) = 0 and \(\gamma = 1\) by default, and \(x_{0}\) = 0.5 and \(\gamma = 0.5\), respectively.
x = [-4:0.1:4];
y = lorentzpdf(x);
z = lorentzpdf(x, 0.5, 0.5);
plot(x, y, z);
legend("x0=0, gamma=1", "x0=0.5, gamma=0.5");
See Also
List of commands , pearson4pdf, normpdf, fitnormpdf, fitlorentzpdf