Hi! When using the generalized binary prior with flashier, I came across some instances where the KL estimate is negative. For example, for the flash fit generated by the code below:
set.seed(1)
X <- matrix(rnorm(100*1000), nrow=100, ncol=1000)
gb_flash_fit <- flash_init(X) |> flash_greedy(Kmax = 2, ebnm_fn = ebnm::ebnm_generalized_binary)
I found that all of the (negative) KL values were positive, e.g. one was 34.39.
I think there is an issue with the likelihood calculation. I looked through the code and I think in the generalized_binary.R file, line 228, the log(pi) term should be log(2*pi)?
Hi! When using the generalized binary prior with
flashier, I came across some instances where the KL estimate is negative. For example, for the flash fit generated by the code below:set.seed(1)X <- matrix(rnorm(100*1000), nrow=100, ncol=1000)gb_flash_fit <- flash_init(X) |> flash_greedy(Kmax = 2, ebnm_fn = ebnm::ebnm_generalized_binary)I found that all of the (negative) KL values were positive, e.g. one was 34.39.
I think there is an issue with the likelihood calculation. I looked through the code and I think in the generalized_binary.R file, line 228, the
log(pi)term should belog(2*pi)?