JenniNiku / gllvm

Generalized Linear Latent Variable Models
https://jenniniku.github.io/gllvm/
48 stars 20 forks source link

Warning message when row.eff = "random" #73

Closed hrlai closed 1 year ago

hrlai commented 1 year ago

Hi dev, when I have the argument row.eff = "random" in the following minimal example:

library(gllvm)
library(mvabund)
data(antTraits)

y <- as.matrix(antTraits$abund)
X <- as.matrix(antTraits$env)
TR <- antTraits$traits

mod <- gllvm(y = y,
             X = X,
             TR = TR,
             num.lv = 2,
             family = "negative.binomial",
             row.eff = "random",
             randomX = ~ .)

I get the warning message:

Warning message:
In matrix(param[ui], n, nlvr) :
  data length differs from size of matrix: [60 != 30 x 3]

Is this something that can be safely ignored?

The warning also goes away if I set row.eff to its default:

# no warning
mod <- gllvm(y = y,
             X = X,
             TR = TR,
             num.lv = 2,
             family = "negative.binomial",
             randomX = ~ .)

Thanks in advance!

JenniNiku commented 1 year ago

Hi, thanks for noting this, and sorry for long response time. Based on a quick look I made it can be ignored. But I will take a closer look at this this week and fix it.

JenniNiku commented 1 year ago

This has been fixed.