DistributionsAD.jl icon indicating copy to clipboard operation
DistributionsAD.jl copied to clipboard

There's little documentation for `filldist` and `arraydist`

Open ForceBru opened this issue 3 years ago • 0 comments

The only explanation of filldist I could find is here: https://turing.ml/dev/docs/using-turing/performancetips#special-care-for-tracker-and-zygote

filldist(dist, N) creates a multivariate distribution that is composed of N identical and independent copies of the univariate distribution dist if dist is univariate, or it creates a matrix-variate distribution composed of N identical and idependent (sic) copies of the multivariate distribution dist if dist is multivariate. filldist(dist, N, M) can also be used to create a matrix-variate distribution from a univariate distribution dist.

However, ?filldist says:

search: filldist

Out[66]:
No documentation found.
DistributionsAD.filldist is a Function.
# 4 methods for generic function "filldist":
[1] filldist(d::Normal, N::Int64) in DistributionsAD at /Users/forcebru/.julia/packages/DistributionsAD/pj8zf/src/filldist.jl:12
[2] filldist(dist::UnivariateDistribution{S} where S<:ValueSupport, N::Int64) in DistributionsAD at /Users/forcebru/.julia/packages/DistributionsAD/pj8zf/src/filldist.jl:9
[3] filldist(dist::UnivariateDistribution{S} where S<:ValueSupport, N1::Integer, N2::Integer) in DistributionsAD at /Users/forcebru/.julia/packages/DistributionsAD/pj8zf/src/filldist.jl:64
[4] filldist(dist::MultivariateDistribution{S} where S<:ValueSupport, N::Int64) in DistributionsAD at /Users/forcebru/.julia/packages/DistributionsAD/pj8zf/src/filldist.jl:83

Same thing for arraydist.

Also, the code of @model function tmodel(x, y) at https://turing.ml/dev/docs/using-turing/performancetips#ensure-that-types-in-your-model-can-be-inferred seems to be the only example of filldist usage in the documentation...

ForceBru avatar Jun 05 '21 16:06 ForceBru