Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

stats::cauchyPDF

Probability density function of the Cauchy distribution

MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.

MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.

Syntax

stats::cauchyPDF(a, b)

Description

stats::cauchyPDF(a, b) returns a procedure representing the probability density function

of the Cauchy distribution with median a and scale parameter b > 0.

The procedure f := stats::cauchyPDF(a, b) can be called in the form f(x) with arithmetical expressions x. The return value of f(x) is either a floating-point number or a symbolic expression:

  • If x is a floating-point number and a and b can be converted to suitable floating-point numbers, then f(x) returns a floating-point number.

  • In all other cases, the symbolic expression b/PI * 1/((x-a)^2 + b^2) is returned.

Numerical values of a and b are only accepted if they are real and b is positive.

Environment Interactions

The function is sensitive to the environment variable DIGITS which determines the numerical working precision.

Examples

Example 1

We calculate the Cauchy density with a = 2 and at various points:

f := stats::cauchyPDF(2, 3/4):
f(-infinity), f(9/10), f(0.9), f(2), f(infinity)

delete f:

Example 2

We use symbolic arguments:

f := stats::cauchyPDF(a, b):
f(x), f(2), f(2.0)

When a and b evaluate to numbers, the function f starts to produce numerical values:

a := PI:
b:= 1/8:
f(2), f(2.0)

delete f, a, b:

Parameters

a

The median: an arithmetical expression representing a real value

b

The scale parameter: an arithmetical expression representing a positive real value

Return Values

procedure.

Was this topic helpful?