File tree 2 files changed +13
-1
lines changed 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,7 @@ pdfsquaredL2norm
72
72
insupport(::UnivariateDistribution, x::Any)
73
73
pdf(::UnivariateDistribution, ::Real)
74
74
logpdf(::UnivariateDistribution, ::Real)
75
+ gradlogpdf(::Distribution, ::Any)
75
76
loglikelihood(::UnivariateDistribution, ::AbstractArray)
76
77
cdf(::UnivariateDistribution, ::Real)
77
78
logcdf(::UnivariateDistribution, ::Real)
Original file line number Diff line number Diff line change @@ -256,7 +256,7 @@ be disabled by using `@inbounds`.
256
256
Instead of `logpdf` one should implement `_logpdf(d, x)` which does not have to check the
257
257
size of `x`.
258
258
259
- See also: [`pdf`](@ref).
259
+ See also: [`pdf`](@ref), [`gradlogpdf`](@ref) .
260
260
"""
261
261
@inline function logpdf (
262
262
d:: Distribution{ArrayLikeVariate{N}} , x:: AbstractArray{<:Real,M}
@@ -280,6 +280,17 @@ See also: [`pdf`](@ref).
280
280
end
281
281
end
282
282
283
+ """
284
+ gradlogpdf(d::Distribution, x)
285
+
286
+ Evaluate the gradient of the logarithm of the probability density function of `d` at `x`.
287
+
288
+ For univariate distributions, return the derivative.
289
+
290
+ See also: [`logpdf`](@ref).
291
+ """
292
+ function gradlogpdf end
293
+
283
294
# `_logpdf` should be implemented and has no default definition
284
295
# _logpdf(d::Distribution{ArrayLikeVariate{N}}, x::AbstractArray{<:Real,N}) where {N}
285
296
You can’t perform that action at this time.
0 commit comments