There's something wrong on the devel branch when calling the rw2 model. I haven't checked but it's probably a general error. As far as I can tell, what it's doing is treating it like a spde component, so it's got internal length of length(values). But what it's not doing is correctly building an "A-matrix" so it is expecting index in the data to be the save length as values, which is almost never true.
I can't quite work out the code well enough to suggest a fix (sorry!), but I thought you should know before pushing this to main!
D
Minimal error:
library(inlabru)
n = 40
tt = 1:20
times = sample(x = tt, size=n, replace = TRUE)
yy = sin(times) + rnorm(n)
data = data.frame(yy,times)
formula = yy ~ time_trend(map=times,model="rw2",values=tt)
out = bru(formula, family="gaussian",data=data)
There's something wrong on the
devel
branch when calling therw2
model. I haven't checked but it's probably a general error. As far as I can tell, what it's doing is treating it like a spde component, so it's got internal length oflength(values)
. But what it's not doing is correctly building an "A-matrix" so it is expecting index in the data to be the save length asvalues
, which is almost never true.I can't quite work out the code well enough to suggest a fix (sorry!), but I thought you should know before pushing this to main!
D
Minimal error:
This gives the error message
Session Info