Skip to content

Commit

Permalink
Merge branch 'master' into st/cov_pdmat
Browse files Browse the repository at this point in the history
  • Loading branch information
st-- authored Jan 7, 2022
2 parents 8830b3f + 93a542d commit 8b5261c
Show file tree
Hide file tree
Showing 113 changed files with 3,849 additions and 1,454 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/ci.yml → .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI

on:
pull_request:
branches:
Expand All @@ -7,6 +8,13 @@ on:
branches:
- master
tags: '*'

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/DocPreviewCleanup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Doc Preview Cleanup

on:
pull_request:
types: [closed]

jobs:
doc-preview-cleanup:
runs-on: ubuntu-latest
steps:
- name: Checkout gh-pages branch
uses: actions/checkout@v2
with:
ref: gh-pages
- name: Delete preview and history + push changes
run: |
if [ -d "previews/PR$PRNUM" ]; then
git config user.name "Documenter.jl"
git config user.email "documenter@juliadocs.github.io"
git rm -rf "previews/PR$PRNUM"
git commit -m "delete preview"
git branch gh-pages-new $(echo "delete history" | git commit-tree HEAD^{tree})
git push --force origin gh-pages-new:gh-pages
fi
env:
PRNUM: ${{ github.event.number }}
61 changes: 61 additions & 0 deletions .github/workflows/IntegrationTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: IntegrationTest

on:
pull_request:
branches:
- master
push:
branches:
- master

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
name: ${{ matrix.package.repo }}/${{ matrix.package.group }}
runs-on: ubuntu-latest
env:
GROUP: ${{ matrix.package.group }}
strategy:
fail-fast: false
matrix:
package:
- {user: TuringLang, repo: DistributionsAD.jl, group: Others}
- {user: TuringLang, repo: DistributionsAD.jl, group: Tracker}
- {user: TuringLang, repo: DistributionsAD.jl, group: ReverseDiff}
- {user: TuringLang, repo: DistributionsAD.jl, group: Zygote}
#- {user: TuringLang, repo: DistributionsAD.jl, group: ForwardDiff} takes > 1 hour

steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: 1
arch: x64
- uses: julia-actions/julia-buildpkg@latest
- name: Clone Downstream
uses: actions/checkout@v2
with:
repository: ${{ matrix.package.user }}/${{ matrix.package.repo }}
path: downstream
- name: Load this and run the downstream tests
shell: julia --color=yes --project=downstream {0}
run: |
using Pkg
try
# force it to use this PR's version of the package
Pkg.develop(PackageSpec(path=".")) # resolver may fail with main deps
Pkg.update()
Pkg.test() # resolver may fail with test time deps
catch err
err isa Pkg.Resolve.ResolverError || rethrow()
# If we can't resolve that means this is incompatible by SemVer and this is fine
# It means we marked this as a breaking change, so we don't need to worry about
# Mistakenly introducing a breaking change, as we have intentionally made one
@info "Not compatible with this release. No problem." exception=err
exit(0) # Exit immediately, as a success
end
28 changes: 13 additions & 15 deletions CITATION.bib
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
% reference paper
@article{2019arXiv190708611B,
author = {{Besan{\c{c}}on}, Mathieu and {Anthoff}, David and {Arslan}, Alex and
{Byrne}, Simon and {Lin}, Dahua and {Papamarkou}, Theodore and
{Pearson}, John},
title = {Distributions.jl: Definition and Modeling of Probability Distributions in the JuliaStats Ecosystem},
journal = {arXiv e-prints},
keywords = {Statistics - Computation, Computer Science - Mathematical Software},
year = 2019,
month = "Jul",
eid = {arXiv:1907.08611},
pages = {arXiv:1907.08611},
archivePrefix = {arXiv},
eprint = {1907.08611},
primaryClass = {stat.CO},
@article{JSSv098i16,
author = {Mathieu Besançon and Theodore Papamarkou and David Anthoff and Alex Arslan and Simon Byrne and Dahua Lin and John Pearson},
title = {Distributions.jl: Definition and Modeling of Probability Distributions in the JuliaStats Ecosystem},
journal = {Journal of Statistical Software},
volume = {98},
number = {16},
year = {2021},
keywords = {Julia; distributions; modeling; interface; mixture; KDE; sampling; probabilistic programming; inference},
issn = {1548-7660},
pages = {1--30},
doi = {10.18637/jss.v098.i16},
url = {https://www.jstatsoft.org/v098/i16}
}

% reference for the software itself
Expand All @@ -32,7 +30,7 @@ @misc{Distributions.jl-2019
Moritz Schauer and
other contributors},
title = {{JuliaStats/Distributions.jl: a Julia package for probability distributions and associated functions}},
month = july,
month = jul,
year = 2019,
doi = {10.5281/zenodo.2647458},
url = {https://doi.org/10.5281/zenodo.2647458}
Expand Down
12 changes: 9 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
name = "Distributions"
uuid = "31c24e10-a181-5473-b8eb-7969acd0382f"
authors = ["JuliaStats"]
version = "0.25.11"
version = "0.25.37"

[deps]
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
DensityInterface = "b429d917-457f-4dbc-8f4c-0cc954292b1d"
FillArrays = "1a297f60-69ca-5386-bcde-b61e274b549b"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
PDMats = "90014a1f-27ba-587c-ab20-58faa44d9150"
Expand All @@ -15,18 +17,22 @@ SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
ChainRulesCore = "1"
DensityInterface = "0.4"
FillArrays = "0.9, 0.10, 0.11, 0.12"
PDMats = "0.10, 0.11"
QuadGK = "2"
SpecialFunctions = "0.8, 0.9, 0.10, 1.0"
SpecialFunctions = "0.8, 0.9, 0.10, 1.0, 2"
StatsBase = "0.32, 0.33"
StatsFuns = "0.8, 0.9"
julia = "1"

[extras]
Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9"
ChainRulesTestUtils = "cdddcdb0-9152-4a09-a978-84456f9df70a"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
Expand All @@ -36,4 +42,4 @@ StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["StableRNGs", "Calculus", "Distributed", "FiniteDifferences", "ForwardDiff", "JSON", "StaticArrays", "Test"]
test = ["StableRNGs", "Calculus", "ChainRulesTestUtils", "Distributed", "FiniteDifferences", "ForwardDiff", "JSON", "StaticArrays", "Test"]
2 changes: 2 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"

[compat]
Documenter = "0.26, 0.27"
GR = "0.61, 0.62, 0.63"
9 changes: 7 additions & 2 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ makedocs(
"truncate.md",
"multivariate.md",
"matrix.md",
"reshape.md",
"cholesky.md",
"mixture.md",
"convolution.md",
"fit.md",
"extends.md",
"density_interface.md",
]
)

deploydocs(
deploydocs(;
repo = "github.com/JuliaStats/Distributions.jl.git",
versions = ["stable" => "v^", "v#.#", "dev" => "master"]
versions = ["stable" => "v^", "v#.#", "dev" => "master"],
push_preview=true,
)
15 changes: 15 additions & 0 deletions docs/src/cholesky.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# [Cholesky-variate Distributions](@id cholesky-variates)

*Cholesky-variate distributions* are distributions whose variate forms are `CholeskyVariate`. This means each draw is a factorization of a positive-definite matrix of type `LinearAlgebra.Cholesky` (the object produced by the function `LinearAlgebra.cholesky` applied to a dense positive-definite matrix.)

## Distributions

```@docs
LKJCholesky
```

## Index

```@index
Pages = ["cholesky.md"]
```
11 changes: 11 additions & 0 deletions docs/src/convolution.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Convolutions

A [convolution of two probability distributions](https://en.wikipedia.org/wiki/List_of_convolutions_of_probability_distributions)
is the probability distribution of the sum of two independent random variables that are
distributed according to these distributions.

The convolution of two distributions can be constructed with [`convolve`](@ref).

```@docs
convolve
```
7 changes: 7 additions & 0 deletions docs/src/density_interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Support for DensityInterface

`Distributions` supports [`DensityInterface`](https://github.com/JuliaMath/DensityInterface.jl) for distributions.

A probability distribution has a probability density, so `DensityInterface.DensityKind(::Distribution) === HasDensity()`.

For *single* variate values `x`, `DensityInterface.logdensityof(d::Distribution, x)` is equivalent to `logpdf(d, x)` and `DensityInterface.densityof(d::Distribution, x)` is equivalent to `pdf(d, x)`.
8 changes: 3 additions & 5 deletions docs/src/matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,9 @@ Distributions.rank(::MatrixDistribution)
mean(::MatrixDistribution)
var(::MatrixDistribution)
cov(::MatrixDistribution)
pdf{T<:Real}(d::MatrixDistribution, x::AbstractMatrix{T})
logpdf{T<:Real}(d::MatrixDistribution, x::AbstractMatrix{T})
pdf(d::MatrixDistribution, x::AbstractMatrix{<:Real})
logpdf(d::MatrixDistribution, x::AbstractMatrix{<:Real})
Distributions._rand!(::AbstractRNG, ::MatrixDistribution, A::AbstractMatrix)
vec(d::MatrixDistribution)
```

## Distributions
Expand All @@ -35,7 +34,6 @@ vec(d::MatrixDistribution)
MatrixNormal
Wishart
InverseWishart
MatrixReshaped
MatrixTDist
MatrixBeta
MatrixFDist
Expand All @@ -45,7 +43,7 @@ LKJ
## Internal Methods (for creating your own matrix-variate distributions)

```@docs
Distributions._logpdf(d::MatrixDistribution, x::AbstractArray)
Distributions._logpdf(d::MatrixDistribution, x::AbstractMatrix{<:Real})
```

## Index
Expand Down
4 changes: 4 additions & 0 deletions docs/src/multivariate.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,12 @@ invcov(::Distributions.AbstractMvNormal)
logdetcov(::Distributions.AbstractMvNormal)
sqmahal(::Distributions.AbstractMvNormal, ::AbstractArray)
rand(::AbstractRNG, ::Distributions.AbstractMvNormal)
minimum(::Distributions.AbstractMvNormal)
maximum(::Distributions.AbstractMvNormal)
extrema(::Distributions.AbstractMvNormal)
```


### MvLogNormal

In addition to the methods listed in the common interface above, we also provide the following methods:
Expand Down
9 changes: 9 additions & 0 deletions docs/src/reshape.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Reshaping distributions

Distributions of array variates such as `MultivariateDistribution`s and
`MatrixDistribution`s can be reshaped.

```@docs
reshape
vec
```
Loading

0 comments on commit 8b5261c

Please sign in to comment.