Skip to content

Commit

Permalink
fixed random sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyworsfold committed Oct 4, 2023
1 parent 6004d11 commit eef9e3a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/univariate/continuous/wrappedcauchy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ function WrappedCauchy(r::Real; check_args::Bool=true)
return WrappedCauchy(zero(r), r; check_args=false)
end

@distr_support WrappedCauchy -oftype(d.r, π) oftype(d.r, π)
@distr_support WrappedCauchy -oftype(d.μ, π) oftype(d.μ, π)


params(d::WrappedCauchy) = (d.μ, d.r)
Expand Down Expand Up @@ -97,8 +97,7 @@ end
#### Sampling

function rand(rng::AbstractRNG, d::WrappedCauchy)
return mod2pi(d.μ + log(d.r) * tan* (rand(rng) - 0.5))) - π

return mod2pi(d.μ + π + log(d.r) * tan* (rand(rng) - 0.5))) - π
end

#### Fitting
Expand Down

0 comments on commit eef9e3a

Please sign in to comment.