Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psi variable not used in compute_mallows? #313

Closed
lorenzo-zuccato opened this issue Oct 3, 2023 · 3 comments · Fixed by #315
Closed

psi variable not used in compute_mallows? #313

lorenzo-zuccato opened this issue Oct 3, 2023 · 3 comments · Fixed by #315
Assignees
Labels
bug Something isn't working

Comments

@lorenzo-zuccato
Copy link

Hi, I have noticed that the psi parameter is not used anywhere in the function compute_mallows. I think it should be passed to the run_mcmc function, otherwise it will always use 10 as fixed value. Is there a reason for this?

@osorensen osorensen added the bug Something isn't working label Oct 3, 2023
@osorensen osorensen self-assigned this Oct 3, 2023
@osorensen
Copy link
Collaborator

Thanks @lorenzo-zuccato, that's a very good catch.

@osorensen
Copy link
Collaborator

Here is a test I've made after properly propagating the psi argument to run_mcmc. It seems to me correct, in light of the animation on Wikipedia, that with lower psi we get closer to hard clustering, and with increasing psi we get soft clustering.

library(BayesMallows)
library(ggplot2)
library(patchwork)
set.seed(123)
mixture_model1 <- compute_mallows(
  rankings = sushi_rankings[1:100, ], n_clusters = 3,
  include_wcd = TRUE, save_clus = TRUE, nmc = 100, psi = 100
)

set.seed(123)
mixture_model2 <- compute_mallows(
  rankings = sushi_rankings[1:100, ], n_clusters = 3,
  include_wcd = TRUE, save_clus = TRUE, nmc = 100, psi = .1
)

(assess_convergence(mixture_model1, parameter = "cluster_probs") +
  ggtitle("psi = 100")) +
  (assess_convergence(mixture_model2, parameter = "cluster_probs") +
     ggtitle("psi = 0.1"))

Created on 2023-10-03 with reprex v2.0.2

@osorensen
Copy link
Collaborator

Thanks again @lorenzo-zuccato, this is fixed now, and will be on CRAN in a few days, hopefully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants