We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1c893ce commit 82e64fcCopy full SHA for 82e64fc
src/densities/Semicircle.jl
@@ -20,13 +20,13 @@ Semicircle() = Semicircle(0.0, 2.0)
20
# cumulative distribution function
21
function cdf(X::Semicircle, x::Real)
22
r, a = X.mean, X.radius
23
- insupport(x) ? 0.5 + (x-a)/(pi*r^2) * sqrt(r^2 - (x-a)^2) + 1/pi * asin((x-a)/r) : (x>a ? 1.0 : 0.0)
+ insupport(X, x) ? 0.5 + (x-a)/(pi*r^2) * sqrt(r^2 - (x-a)^2) + 1/pi * asin((x-a)/r) : (x>a ? 1.0 : 0.0)
24
end
25
26
# probability density function
27
function pdf(X::Semicircle, x::Real)
28
29
- insupport(x) ? 2/(pi*r^2) * sqrt(r^2 - (x-a)^2) : 0.0
+ insupport(X, x) ? 2/(pi*r^2) * sqrt(r^2 - (x-a)^2) : 0.0
30
31
32
# predicate is x in the support of the distribution?
0 commit comments