Skip to content

Commit

Permalink
Merge pull request #1185 from dschmitz89/cauchy_docs
Browse files Browse the repository at this point in the history
DOC: fix Cauchy CDF formula
  • Loading branch information
mborland authored Aug 23, 2024
2 parents 8d92f8f + 9862296 commit 66b362a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/distributions/cauchy.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ So recall that for `x < 0`:

Substituting into the above we get:

[expression p = -atan(1/x) ; x < 0]
[expression p = -atan(1/x) / [pi] ; x < 0]

So the procedure is to calculate the cdf for -fabs(x)
using the above formula. Note that to factor in the location and scale
Expand Down
2 changes: 1 addition & 1 deletion doc/html/math_toolkit/dist_ref/dists/cauchy_dist.html
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ <h5>
Substituting into the above we get:
</p>
<div class="blockquote"><blockquote class="blockquote"><p>
<span class="serif_italic">p = -atan(1/x) ; x &lt; 0</span>
<span class="serif_italic">p = -atan(1/x) ; x &lt; 0</span>
</p></blockquote></div>
<p>
So the procedure is to calculate the cdf for -fabs(x) using the
Expand Down
2 changes: 1 addition & 1 deletion include/boost/math/distributions/cauchy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ BOOST_MATH_GPU_ENABLED RealType cdf_imp(const cauchy_distribution<RealType, Poli
//
// Substituting into the above we get:
//
// CDF = -atan(1/x) ; x < 0
// CDF = -atan(1/x)/pi ; x < 0
//
// So the procedure is to calculate the cdf for -fabs(x)
// using the above formula, and then subtract from 1 when required
Expand Down

0 comments on commit 66b362a

Please sign in to comment.