You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just came across this issue that's very much related to #270 and which is occurring in both sdmTMB 0.4.0 and 0.4.1. The problem with matching the length of the offset and the number of rows of newdata (in this case obtained internally) resurfaces when a value of nsim is being provided:
library(sdmTMB)
mesh<- make_mesh(pcod, c("X", "Y"), cutoff=10)
pcod$os<- rep(log(0.01), nrow(pcod)) # offsetm<- sdmTMB(
data=pcod,
formula=density~ poly(log(depth), 2),
mesh=mesh,
offset=pcod$os,
family= tweedie(link="log"),
spatial="on",
time="year",
extra_time= c(2006, 2008, 2010, 2012, 2014, 2016),
spatiotemporal="AR1"
)
p1<- predict(m, offset=pcod$os) # This worksp2<- predict(m, newdata=pcod, offset=pcod$os) # This used to fail but now works p3<- predict(m, newdata=pcod) # This worksp4<- predict(m, offset=pcod$os, nsim=30) # This fails# Error in `predict()`:# ! Prediction offset vector does not equal number of rows in prediction dataset.# Run `rlang::last_trace()` to see where the error occurred.
The text was updated successfully, but these errors were encountered:
Just came across this issue that's very much related to #270 and which is occurring in both sdmTMB 0.4.0 and 0.4.1. The problem with matching the length of the offset and the number of rows of newdata (in this case obtained internally) resurfaces when a value of
nsim
is being provided:The text was updated successfully, but these errors were encountered: