diff --git a/docs/src/multivariate.md b/docs/src/multivariate.md index c4e7c1764..a4a077ef0 100644 --- a/docs/src/multivariate.md +++ b/docs/src/multivariate.md @@ -31,8 +31,8 @@ entropy(::MultivariateDistribution, ::Real) ```@docs insupport(::MultivariateDistribution, ::AbstractArray) -pdf(::MultivariateDistribution, ::AbstractArray) -logpdf(::MultivariateDistribution, ::AbstractArray) +pdf(::Distribution{ArrayLikeVariate{N}}, x::AbstractArray{<:Real,M}) where {N,M} +logpdf(::Distribution{ArrayLikeVariate{N}}, x::AbstractArray{<:Real,M}) where {N,M} loglikelihood(::MultivariateDistribution, ::AbstractVector{<:Real}) ``` **Note:** For multivariate distributions, the pdf value is usually very small or large, and therefore direct evaluation of the pdf may cause numerical problems. It is generally advisable to perform probability computation in log scale. diff --git a/docs/src/univariate.md b/docs/src/univariate.md index 0b2c48c6e..914cab2f0 100644 --- a/docs/src/univariate.md +++ b/docs/src/univariate.md @@ -73,7 +73,7 @@ pdfsquaredL2norm insupport(::UnivariateDistribution, x::Any) pdf(::UnivariateDistribution, ::Real) logpdf(::UnivariateDistribution, ::Real) -loglikelihood(::UnivariateDistribution, ::AbstractArray) +loglikelihood(::UnivariateDistribution, ::Real) cdf(::UnivariateDistribution, ::Real) logcdf(::UnivariateDistribution, ::Real) logdiffcdf(::UnivariateDistribution, ::Real, ::Real) diff --git a/src/univariates.jl b/src/univariates.jl index b60e5a294..5778a8467 100644 --- a/src/univariates.jl +++ b/src/univariates.jl @@ -326,7 +326,13 @@ logpdf(d::UnivariateDistribution, x::Real) # extract value from array of zero dimension logpdf(d::UnivariateDistribution, x::AbstractArray{<:Real,0}) = logpdf(d, first(x)) -# loglikelihood for `Real` +""" + loglikelihood(d::UnivariateDistribution, x::Real) + +Evaluate the logarithm of the likelihood at `x`. + +See also: [`logpdf`](@ref). +""" Base.@propagate_inbounds loglikelihood(d::UnivariateDistribution, x::Real) = logpdf(d, x) """