Closed zihao12 closed 1 year ago
Here is the example in R rerproducing the error:
library(ebnm)
load("zihao.RData")
fit = ebnm(x = x,s = s,prior_family = "normal_scale_mixture")
# Error in (x - mode)^2/sigma2 : non-conformable arrays
here x
and s
are of class array
. The code works if you instead call fit = ebnm(x = as.numeric(x),s = as.numeric(s),prior_family = "normal_scale_mixture")
.
This worked for me (after running the above code):
import rpy2.robjects
y = robjects.vectors.FloatVector(x)
w = robjects.vectors.FloatVector(s)
fit = ebnm.ebnm(x = y, s=w, prior_family = prior_family, mode = "estimate")
So it looks like some care is needed in converting python data structures to R (and presumably vice versa).
I am calling ebnm through python. It works when I use "point_normal", but gives an error when using "normal_scale_mixture".
Code is as follows
The error message is