Skip to content

zero log likelihood when using rlda.binomialMH #23

@andriizayac

Description

@andriizayac

Hi Pedro,
I'm trying to speed up a binomial version of the Rlda model with the Metropolis-Hasting version, but obtain zeros for the log-likelihood vector. On top of it, the length of LL vector is different from the number of Gibbs iterations. Based on the documentation, it appears that log-likelihood should be calculated for each Gibbs iteration but unlike with the rlda.binomial() the values are all zeros. Is there another way to obtain the LL trajectory from the rlda.binomialMH object, or is there a mistake in the code?
Here is an example:
R version 3.5.2 (2018-12-20)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Mojave 10.14.6
[1] Rlda_0.2.6

library(Rlda)
data("Landsat")
Landsat_tr=Landsat[sample(nrow(Landsat), size=round(.005*nrow(Landsat))),-c(1,2)]
df=Landsat_tr
tmp=apply(df, 2, max)
npix=nrow(df)
nbands=ncol(df)
max2=as.data.frame(matrix(tmp, npix, nbands, byrow=T))
a.phi=1
b.phi=1
gamma=1
ngibbs=100
ncomm=5
res=rlda.binomialMH(data=Landsat_tr, pop=max2,
               n_community = ncomm,alpha0=a.phi, alpha1=b.phi,
               gamma=gamma, n_gibbs=ngibbs, display_progress = TRUE)
ll=res$logLikelihood
length(ll)
> [1] 348
sum(ll==0)
>[1] 348

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions