willwerscheid / flashier

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

make flash_factors_init work with empty flash fit #99

Closed stephens999 closed 1 year ago

stephens999 commented 1 year ago

suppose f0 is a flash fit with 0 factors. I think flash_factors_init(f,f0) should just return f. Does that make sense?

Right now I get an error:

> n= 10
> p = 20
> Y = matrix(rnorm(n*p),ncol=p, nrow=n)
> f0 = flash_init(Y)
> f1 = flash_init(2*Y)
> f1 = flash_factors_init(f1,f0) # should be f1 ?
Error in rep(0, K) : invalid 'times' argument
Called from: set.KL(flash, c(get.KL(flash, n), rep(0, K)), n)
willwerscheid commented 1 year ago

fixed -- should now work with any empty objects