Skip to content

Commit

Permalink
v1.2.0beta2
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavnatarajan committed Feb 6, 2023
1 parent a8f861c commit d39065e
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 10,350 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RedClust"
uuid = "bf1adee6-87fe-4679-8d23-51fe99940a25"
authors = ["Abhinav Natarajan <[email protected]>"]
version = "1.2.0beta"
version = "1.2.0beta2"

[deps]
Clustering = "aaaa29a8-35af-508c-8bc3-b662a17a0fe5"
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,22 @@ A more elaborate example can be found in the detailed documentation.
## Citing this package
If you want to use this package in your work, please cite it as:

Natarajan, A., De Iorio, M., Heinecke, A., Mayer, E. and Glenn, S., 2022. ‘Cohesion and Repulsion in Bayesian Distance Clustering’, arXiv [2107.05414](https://arxiv.org/abs/2107.05414).
Natarajan, A., De Iorio, M., Heinecke, A., Mayer, E. and Glenn, S., 2021. ‘Cohesion and Repulsion in Bayesian Distance Clustering’, arXiv [2107.05414](https://arxiv.org/abs/2107.05414).

For BibTeX users:

```latex
@misc{https://doi.org/10.48550/arxiv.2107.05414,
doi = {10.48550/ARXIV.2107.05414},
url = {https://arxiv.org/abs/2107.05414},
author = {Natarajan, Abhinav and De Iorio, Maria and Heinecke, Andreas and Mayer, Emanuel and Glenn, Simon},
keywords = {Methodology (stat.ME), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Cohesion and Repulsion in Bayesian Distance Clustering},
publisher = {arXiv},
year = {2021},
copyright = {arXiv.org perpetual, non-exclusive license}
}
```

[github-CI-img]: https://img.shields.io/github/workflow/status/abhinavnatarajan/RedClust.jl/CI?label=CI&logo=github&labelColor=222222
[github-CI-url]: https://github.com/abhinavnatarajan/RedClust.jl/actions/workflows/CI.yml
Expand Down
2 changes: 1 addition & 1 deletion docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"

[compat]
Documenter = "0.27"
Literate = "0.3"
Literate = "2.7"
StatsBase = "0.33.8"
julia = "1.7"
42 changes: 22 additions & 20 deletions docs/basic_example_for_docs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ colorbar_tickfontsize = 12,
legend_font_pointsize = 12,
plot_titlefontsize = 14
)

# seed the default RNG so that documentation remains stable
## seed the default RNG so that documentation remains stable
seed!(44)
#!setup

Expand All @@ -57,13 +56,16 @@ function sqmatrixplot(X::Matrix; kwargs...)
end

## Histogram with integer bins
function histogram_pmf(X::AbstractVector{<:Integer}; kwargs...)
xvals = minimum(X):maximum(X)
yvals = counts(X)./length(X)
bar(xvals, yvals,
linewidth = 0,
legend = false,
xticks = xvals; kwargs...)
function histogram_pmf(X::AbstractVector{<:Integer}; binwidth::Int=1, kwargs...)
xmin = minimum(X)
xmax = maximum(X)
binedges = xmin:binwidth:xmax
c = counts(X)./length(X)
bincounts = map(sum, [c[(i-xmin+1):minimum([i-xmin+1+binwidth-1, xmax-xmin+1])] for i in binedges])
bar(binedges, bincounts,
linewidth = 0,
legend = false,
xticks = binedges; kwargs...)
end

## Combine two symmetric square matrices together into the upper and lower triangle of a square matrix
Expand Down Expand Up @@ -137,17 +139,17 @@ params = fitprior(points, "k-means", false)
begin
pred_intracluster = sampledist(params, "intracluster", 10000)
pred_intercluster = sampledist(params, "intercluster", 10000)
density(pred_intracluster,
label="Simulated WCD", xlabel = "Distance", ylabel = "Density",
density(pred_intercluster,
label="Simulated ICD", xlabel = "Distance", ylabel = "Density",
linewidth = 2, linestyle = :dash)
density!(empirical_intracluster,
label="Empirical WCD",
color = 1, linewidth = 2)
density!(pred_intercluster,
label="Simulated ICD",
linewidth = 2, linestyle = :dash, color = 2)
density!(empirical_intercluster,
label="Empirical ICD",
color = 1, linewidth = 2)
density!(pred_intracluster,
label="Simulated WCD",
linewidth = 2, linestyle = :dash, color = 2)
density!(empirical_intracluster,
label="Empirical WCD",
linewidth = 2, color = 2)
title!("Distances: Prior Predictive vs Empirical Distribution")
end
Expand Down Expand Up @@ -195,10 +197,10 @@ begin
ylabel = "Density", xlabel = "\$p\$",
title = "Posterior Distribution of \$p\$",
label = "Empirical density",
legend_font_pointsize=12,
legend_position = :topleft)
legend_font_pointsize=12)
density!(result.p, color=:black, linewidth = 2, linestyle=:dash,
label = "Kernel estimate")
label = "Kernel estimate",
legend_position = :topleft)
end
#md # ## Convergence statistics
# Plot the traceplot of the autocorrelation function of ``K``:
Expand Down
7 changes: 5 additions & 2 deletions docs/src/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
## [1.2.0]
### Added
- added function [`fitprior2`](@ref), alternative method to fit prior hyperparameters.
- updated the basic_example file
- added individual example files for each example shown in the paper, except for the numismatic example (for data privacy reasons).

### Changed
- pretty print for [`MCMCResult`](@ref) also shows whether the model includes repulsion.
- moved `basic_example.jl` from the `examples` folder to `docs`.
- removed `examples` (added to a separate branch).

## [1.1.0]
### Added
Expand Down
17 changes: 16 additions & 1 deletion docs/src/cite.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
# Citation Information
If you want to use this package in your work, please cite it as:

Natarajan, A., De Iorio, M., Heinecke, A., Mayer, E. and Glenn, S., 2021. ‘Cohesion and Repulsion in Bayesian Distance Clustering’, arXiv [2107.05414](https://arxiv.org/abs/2107.05414).
Natarajan, A., De Iorio, M., Heinecke, A., Mayer, E. and Glenn, S., 2021. ‘Cohesion and Repulsion in Bayesian Distance Clustering’, arXiv [2107.05414](https://arxiv.org/abs/2107.05414).

For BibTeX users:

```latex
@misc{https://doi.org/10.48550/arxiv.2107.05414,
doi = {10.48550/ARXIV.2107.05414},
url = {https://arxiv.org/abs/2107.05414},
author = {Natarajan, Abhinav and De Iorio, Maria and Heinecke, Andreas and Mayer, Emanuel and Glenn, Simon},
keywords = {Methodology (stat.ME), FOS: Computer and information sciences, FOS: Computer and information sciences},
title = {Cohesion and Repulsion in Bayesian Distance Clustering},
publisher = {arXiv},
year = {2021},
copyright = {arXiv.org perpetual, non-exclusive license}
}
```
2 changes: 1 addition & 1 deletion docs/src/funding.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
We are grateful to the following funding organisations for their financial support for the research that led to the main publication behind this package.
- National University of Singapore, HSS Seed Fund R-607-000-449-646
- Yale-NUS College, grant IG20-RA001
- Singapore Ministry of Education, Academic Research Fund Tier 2 Grant MOE-T2EP40121-0021.
- Singapore Ministry of Education, Academic Research Fund Tier 2 Grant MOE-T2EP40121-0021
13 changes: 0 additions & 13 deletions examples/Project.toml

This file was deleted.

Binary file not shown.
Loading

0 comments on commit d39065e

Please sign in to comment.