Login  |   Contact  |   About Us       Sunday, March 3, 2024

 HOME ›  AREAS OF EXPERTISE  #2 ›   Distribution Function ›  ~ Cauchy Distribution

 "Distribution Functions" Cauchy Distribution Method
 Cauchy Distribution Results x = -3.8, - - - - -> Random Data = 5, - - - - -> Density Distribution = 9 x = -3.4, - - - - -> Random Data = 12, - - - - -> Density Distribution = 11 x = -3, - - - - -> Random Data = 20, - - - - -> Density Distribution = 14 x = -2.6, - - - - -> Random Data = 12, - - - - -> Density Distribution = 18 x = -2.2, - - - - -> Random Data = 32, - - - - -> Density Distribution = 25 x = -1.8, - - - - -> Random Data = 37, - - - - -> Density Distribution = 37 x = -1.4, - - - - -> Random Data = 57, - - - - -> Density Distribution = 58 x = -1, - - - - -> Random Data = 106, - - - - -> Density Distribution = 103 x = -0.6, - - - - -> Random Data = 195, - - - - -> Density Distribution = 211 x = -0.2, - - - - -> Random Data = 444, - - - - -> Density Distribution = 444 x = 0.2, - - - - -> Random Data = 421, - - - - -> Density Distribution = 444 x = 0.6, - - - - -> Random Data = 226, - - - - -> Density Distribution = 211 x = 1, - - - - -> Random Data = 101, - - - - -> Density Distribution = 103 x = 1.4, - - - - -> Random Data = 57, - - - - -> Density Distribution = 58 x = 1.8, - - - - -> Random Data = 39, - - - - -> Density Distribution = 37 x = 2.2, - - - - -> Random Data = 24, - - - - -> Density Distribution = 25 x = 2.6, - - - - -> Random Data = 13, - - - - -> Density Distribution = 18 x = 3, - - - - -> Random Data = 12, - - - - -> Density Distribution = 14 x = 3.4, - - - - -> Random Data = 18, - - - - -> Density Distribution = 11 x = 3.8, - - - - -> Random Data = 4, - - - - -> Density Distribution = 9

 Number of Points: Number of Bins: [ Initial Number of Bins: {20) ] [ Initial Number of Points: {2000} ]

IMPLEMENTATION
Cauchy Distribution Method

The Cauchy distribution, also called the Lorentzian distribution, is a continous distribution describing resonance behavior. This distribution plays an important part in physics and engineering because it is the solution to the differential equation describing forced resonance. In spectroscopy, it describes the line shape of spectral lines which are broadened by many mechanisms, including resonance broadening.

Probability Density Function

The probability density function for the Cauchy distribution can be written in the form:

 f(x;αç) = b / π[b2 + (x - a] 2

here, ç is the location parameter, specifying the location of the resonance peak of the distribution, and b is the scale parameter which specifies the half width at the half maximum.

Cauchy Random Number Generator

It is possible to use the following formula, based on an inverse transformation, to create Cauchy random distribution:

 Cauchy(a,b) = a + b[tan(π u(0,1) - 0.5]

Where u(0,1) is the uniform random distribution defined in the range of [0,1].

Testing the Cauchy Distribution Method

To test the Cauchy Distribution method, a new static method has been added. The TestCauchyDistribution() method has been written and executed. No additional code is shown. The user can change variables as desired.

For the test, two parameters were set:

 number of bins = 20; (nBins) number of points = 2000; (nPoints)

where the parameter (nBins) is the number of bins in the histogram and (nPoints) is the number of random points. A random array is created using the cauchy distribution. A comparison is made between the histogram of random data and the theoretical probability density function of the cauchy distribution. One can see the results from the cauchy random generator are very close to the theoretical cauchy distribution function.

Running this example generates the results shown above.

static void TestCauchyDistribution();
{
for (int i = 0; i < nBins; i++)
{
ListBox1.Items.Add(" x = " + xdata[i] + "," + " - - - - -> Random Data = " + ydata[i] + "," + " - - - - -> Density Distribution = " + Math.Round(ydistribution[i] * normalizeFactor, 0).ToString());
}
}

 Other Implementations...

 Object-Oriented Implementation Graphics and Animation Sample Applications Ore Extraction Optimization Vectors and Matrices Complex Numbers and Functions Ordinary Differential Equations - Euler Method Ordinary Differential Equations 2nd-Order Runge-Kutta Ordinary Differential Equations 4th-Order Runge-Kutta Higher Order Differential Equations Nonlinear Systems Numerical Integration Numerical Differentiation Function Evaluation

 Quotes

Math, Analysis,
expertise..."

EIGENVALUE
SOLUTIONS...

> Rayleigh-Quotient Method

> Cubic Spline Method

 Applied Mathematical Algorithms
 ComplexFunctions NonLinear Differentiation Integration
 About Us KMP Software Engineering is an independent multidisciplinary engineering consulting company specializing in mathematical algorithms.       (About Us) → Areas of Expertise SpecialFunctions VectorsMatrices OptimizationMethods ComplexNumbers Interpolation CurveFitting NonLinearSystems LinearEquations DistributionFunctions NumericalDifferentiation NumericalIntegration DifferentialEquations Smalltalk FiniteBoundary Eigenvalue Graphics UnderstandingMining MiningMastery MineralNews MineralCommodities MineralForum Crystallography Services NumericalModeling WebServices MainframeServices OutsourceServices LINKED IN MINE REVIEW(by G.Pacheco) Brand Login Contact
 Since 2006 All Rights Reserved  © KMP Software Engineering LINKS | PRIVACY POLICY | LEGAL NOTICE