willwerscheid / flashier

A faster and angrier package for EBMF.
https://willwerscheid.github.io/flashier/
Other
10 stars 12 forks source link

Improve flash_factors_init docs #110

Open pcarbo opened 11 months ago

pcarbo commented 11 months ago

This gave me an error which I was surprised by:

fit <- flash_init(Y,var_type = 0)
fit <- flash_factors_init(fit,
                          list(F = matrix(0,n,k),L = matrix(0,m,k)),
                          ebnm_point_exponential)
# Error in dims.must.match(EF, get.Y(flash)) :
#   Dimensions of EF and get.Y(flash) do not match.

It turns out that it works if I instead do this:

fit <- flash_factors_init(fit,
                          list(matrix(0,n,k),matrix(0,m,k)),
                          ebnm_point_exponential)

The key is not to supply names for the list elements.

We should make this clear in help(flash_factors_init). It would also be nice if the error message were more helpful.