mesh.project error

451 views
Skip to first unread message

Paul Lantos

unread,
Feb 24, 2017, 12:24:47 AM2/24/17
to R-inla discussion group
I'm trying to plot a posterior mean, but I've received this error:

> gproj <- inla.mesh.projector(mesh, xlim = 0:1, ylim = 0:1, dims = c(300, 300))
> g.mean <- inla.mesh.project(gproj, model1$summary.random$s$mean)
Error in projector$proj$A %*% as.vector(field) : 
  not-yet-implemented method for <dgCMatrix> %*% <NULL>

It's a hurdle model with binomial and negative binomial components. Would appreciate any help.
Paul

Finn Lindgren

unread,
Feb 24, 2017, 1:45:21 AM2/24/17
to Paul Lantos, R-inla discussion group
Hmm, it seems to say your model output for the random effect "s" is empty. Check that model1 contains what you think it should contain.

Finn
--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.
To post to this group, send email to r-inla-disc...@googlegroups.com.
Visit this group at https://groups.google.com/group/r-inla-discussion-group.
For more options, visit https://groups.google.com/d/optout.

Paul Lantos

unread,
Feb 24, 2017, 7:31:39 AM2/24/17
to R-inla discussion group, paul....@gmail.com
Looks like a capitalization issue, but I still get an error:

> g.mean <- inla.mesh.project(gproj, model1$summary.random$S$mean)
Error in projector$proj$A %*% as.vector(field) : 
  Cholmod error 'X and/or Y have wrong dimensions' at file ../MatrixOps/cholmod_sdmult.c, line 90

> str(model1$summary.random$S)
'data.frame':	1094 obs. of  8 variables:
 $ ID        : num  0 1 2 3 4 5 6 7 8 9 ...
 $ mean      : num  0.13 0.134 0.163 0.183 0.191 ...
 $ sd        : num  1.16 1.14 1.13 1.13 1.16 ...
 $ 0.025quant: num  -2.27 -2.22 -2.17 -2.15 -2.18 ...
 $ 0.5quant  : num  0.114 0.115 0.142 0.162 0.171 ...
 $ 0.975quant: num  2.62 2.6 2.63 2.65 2.7 ...
 $ mode      : num  0.092 0.0899 0.1151 0.1346 0.1486 ...
 $ kld       : num  9.83e-11 2.15e-10 2.62e-10 2.64e-10 1.05e-10 ...





On Friday, February 24, 2017 at 1:45:21 AM UTC-5, Finn Lindgren wrote:
Hmm, it seems to say your model output for the random effect "s" is empty. Check that model1 contains what you think it should contain.

Finn

On 24 Feb 2017, at 05:24, Paul Lantos <paul....@gmail.com> wrote:

I'm trying to plot a posterior mean, but I've received this error:

> gproj <- inla.mesh.projector(mesh, xlim = 0:1, ylim = 0:1, dims = c(300, 300))
> g.mean <- inla.mesh.project(gproj, model1$summary.random$s$mean)
Error in projector$proj$A %*% as.vector(field) : 
  not-yet-implemented method for <dgCMatrix> %*% <NULL>

It's a hurdle model with binomial and negative binomial components. Would appreciate any help.
Paul

--
You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion-group+unsub...@googlegroups.com.

Finn Lindgren

unread,
Feb 24, 2017, 7:42:16 AM2/24/17
to Paul Lantos, R-inla discussion group
...and the size of gproj$proj$A is?
...and mesh$n ?

Finn
To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.

Paul Lantos

unread,
Feb 24, 2017, 7:54:55 PM2/24/17
to R-inla discussion group, paul....@gmail.com
I discovered the problem - I didn't have control.predictor set to compute the fitted values.

This model is structured a bit differently than some of the others I've asked about, it's a hurdle model as described in this paper (and the author Ali Arab has helped me with it).

https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4586626/

Ruby Ji

unread,
Dec 18, 2017, 3:54:32 PM12/18/17
to R-inla discussion group
Hi Paul, 

I came across the same issue. I also fitted a hurdle model, but  I did have control.predictor in the inla call:
control.predictor=list(A=inla.stack.A(stk.zy.1), compute=TRUE,link=inla.stack.data(stk.zy.1)$link)
Could you please give me some suggestions?

Thanks,
Ruby



在 2017年2月24日星期五 UTC-5下午7:54:55,Paul Lantos写道:
Reply all
Reply to author
Forward
0 new messages