JenniNiku/gllvm

Warning message when row.eff = "random"

Closed this issue · 2 comments

hrlai commented

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!

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.

This has been fixed.