| URI: | http://www.uncertml.org/distributions/cauchy |
|---|---|
| UncertML name: | CauchyDistribution |
| Alternative names: | Cauchy-Lorenz distribution, Lorenz distribution, Breit–Wigner distribution |
| Definition: | A random variable $$ x $$ follows a Cauchy distribution if the probability density function (pdf) is of the form shown below. The Cauchy distribution is equivalent to a Student-t distribution with 1 degree of freedom. It is widely used in physics, optics and astronomy. |
| Parameters: |
$$ \theta $$ (location) a real,$$ \gamma $$ ( scale) a positive real. |
| Support: |
$$ x \in \mathcal{R} $$ |
| PDF: |
$$ f(x; \theta, \gamma) = \frac{1}{\pi \gamma} \left[1 + \left( \frac{x - \theta}{\gamma} \right)^2 \right]^{-1} $$ |
| Source: | http://en.wikipedia.org/wiki/Cauchy_distribution |
| Categories: | continuous variables, distribution |
| Further information: | http://mathworld.wolfram.com/CauchyDistribution.html http://en.wikipedia.org/wiki/Cauchy_distribution |
| XML schema: |
<!-- Element -->
<xs:element name="CauchyDistribution" substitutionGroup="un:AbstractDistribution">
<xs:complexType>
<xs:complexContent>
<xs:extension base="un:CauchyDistributionType"/>
</xs:complexContent>
</xs:complexType>
</xs:element>
<!-- Complex type -->
<xs:complexType name="CauchyDistributionType">
<xs:complexContent>
<xs:extension base="un:AbstractDistributionType">
<xs:sequence>
<xs:element name="location" type="un:ContinuousValuesType"/>
<xs:element name="scale" type="un:PositiveRealValuesType"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
|
| XML example: |
<!-- Single value -->
<un:CauchyDistribution xmlns:un="http://www.uncertml.org/2.0">
<un:location>3.14</un:location>
<un:scale>3.14</un:scale>
</un:CauchyDistribution>
<!-- Multiple values -->
<un:CauchyDistribution xmlns:un="http://www.uncertml.org/2.0">
<un:location>3.14 6.28 9.42</un:location>
<un:scale>3.14 6.28 9.42</un:scale>
</un:CauchyDistribution>
|
| JSON example: |
// Single value
{"CauchyDistribution":{"location":[3.14],"scale":[3.14]}}
// Multiple values
{"CauchyDistribution":{"location":[3.14,6.28,9.42],"scale":[3.14,6.28,9.42]}}
|
| API example: |
// Single value declaration
CauchyDistribution cd = new CauchyDistribution(3.14, 3.14);
// Multiple value declaration
CauchyDistribution cd = new CauchyDistribution(new double[] {3.14, 6.28, 9.42}, new double[] {3.14, 6.28, 9.42});
// Parsing from an XML file
XMLParser xml = new XMLParser();
CauchyDistribution cd = (CauchyDistribution)xml.parse(new File("cauchy-distribution.xml"));
// Parsing from a JSON file
JSONParser json = new JSONParser();
CauchyDistribution cd = (CauchyDistribution)json.parse(new File("cauchy-distribution.json"));
// Encoding to an XML file
XMLEncoder xEncoder = new XMLEncoder();
xEncoder.encode(cd, new File("cauchy-distribution.xml"));
// Encoding to a JSON file
JSONEncoder jEncoder = new JSONEncoder();
jEncoder.encode(cd, new File("cauchy-distribution.json"));
|
