Skip to content

Commit

Permalink
Fix some docstrings (#1404)
Browse files Browse the repository at this point in the history
* fix docstrings

* clean up Chernoff
  • Loading branch information
st-- authored Oct 11, 2021
1 parent 1ef4b68 commit 27fb31c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 32 deletions.
8 changes: 4 additions & 4 deletions src/univariate/continuous/beta.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Beta(α,β)
Beta(α, β)
The *Beta distribution* has probability density function
Expand All @@ -15,10 +15,10 @@ independently, then ``X / (X + Y) \\sim \\operatorname{Beta}(\\alpha, \\beta)``.
```julia
Beta() # equivalent to Beta(1, 1)
Beta(a) # equivalent to Beta(a, a)
Beta(a, b) # Beta distribution with shape parameters a and b
Beta(α) # equivalent to Beta(α, α)
Beta(α, β) # Beta distribution with shape parameters α and β
params(d) # Get the parameters, i.e. (a, b)
params(d) # Get the parameters, i.e. (α, β)
```
External links
Expand Down
8 changes: 4 additions & 4 deletions src/univariate/continuous/betaprime.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
BetaPrime(α,β)
BetaPrime(α, β)
The *Beta prime distribution* has probability density function
Expand All @@ -15,10 +15,10 @@ relation ship that if ``X \\sim \\operatorname{Beta}(\\alpha, \\beta)`` then ``\
```julia
BetaPrime() # equivalent to BetaPrime(1, 1)
BetaPrime(a) # equivalent to BetaPrime(a, a)
BetaPrime(a, b) # Beta prime distribution with shape parameters a and b
BetaPrime(α) # equivalent to BetaPrime(α, α)
BetaPrime(α, β) # Beta prime distribution with shape parameters α and β
params(d) # Get the parameters, i.e. (a, b)
params(d) # Get the parameters, i.e. (α, β)
```
External links
Expand Down
10 changes: 5 additions & 5 deletions src/univariate/continuous/cauchy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ f(x; \\mu, \\sigma) = \\frac{1}{\\pi \\sigma \\left(1 + \\left(\\frac{x - \\mu}{
```julia
Cauchy() # Standard Cauchy distribution, i.e. Cauchy(0, 1)
Cauchy(u) # Cauchy distribution with location u and unit scale, i.e. Cauchy(u, 1)
Cauchy(u, b) # Cauchy distribution with location u and scale b
Cauchy(μ) # Cauchy distribution with location μ and unit scale, i.e. Cauchy(μ, 1)
Cauchy(μ, σ) # Cauchy distribution with location μ and scale σ
params(d) # Get the parameters, i.e. (u, b)
location(d) # Get the location parameter, i.e. u
scale(d) # Get the scale parameter, i.e. b
params(d) # Get the parameters, i.e. (μ, σ)
location(d) # Get the location parameter, i.e. μ
scale(d) # Get the scale parameter, i.e. σ
```
External links
Expand Down
18 changes: 2 additions & 16 deletions src/univariate/continuous/chernoff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The *Chernoff distribution* is the distribution of the random variable
```math
\\underset{t \\in (-\\infty,\\infty)}{\\arg\\max} ( G(t) - t^2 ),
```
where ``G`` is standard two--sided Brownian motion.
where ``G`` is standard two-sided Brownian motion.
The distribution arises as the limit distribution of various cube-root-n consistent estimators,
including the isotonic regression estimator of Brunk, the isotonic density estimator of Grenander,
Expand All @@ -27,21 +27,7 @@ computation of pdf and cdf is based on the algorithm described in Groeneboom and
Journal of Computational and Graphical Statistics, 2001.
```julia
Chernoff()
pdf(Chernoff(),x::Real)
cdf(Chernoff(),x::Real)
logpdf(Chernoff(),x::Real)
survivor(Chernoff(),x::Real)
mean(Chernoff())
var(Chernoff())
skewness(Chernoff())
kurtosis(Chernoff())
kurtosis(Chernoff(), excess::Bool)
mode(Chernoff())
entropy(Chernoff())
rand(Chernoff())
rand(rng, Chernoff()
cdf(Chernoff(),-x) #For tail probabilities, use this instead of 1-cdf(Chernoff(),x)
cdf(Chernoff(),-x) # For tail probabilities, use this instead of 1-cdf(Chernoff(),x)
```
"""
struct Chernoff <: ContinuousUnivariateDistribution
Expand Down
6 changes: 3 additions & 3 deletions src/univariate/continuous/symtriangular.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
SymTriangularDist(μ,σ)
SymTriangularDist(μ, σ)
The *Symmetric triangular distribution* with location `μ` and scale `σ` has probability density function
Expand All @@ -9,8 +9,8 @@ f(x; \\mu, \\sigma) = \\frac{1}{\\sigma} \\left( 1 - \\left| \\frac{x - \\mu}{\\
```julia
SymTriangularDist() # Symmetric triangular distribution with zero location and unit scale
SymTriangularDist(u) # Symmetric triangular distribution with location μ and unit scale
SymTriangularDist(u, s) # Symmetric triangular distribution with location μ and scale σ
SymTriangularDist(μ) # Symmetric triangular distribution with location μ and unit scale
SymTriangularDist(μ, s) # Symmetric triangular distribution with location μ and scale σ
params(d) # Get the parameters, i.e. (μ, σ)
location(d) # Get the location parameter, i.e. μ
Expand Down

0 comments on commit 27fb31c

Please sign in to comment.