jrfaulkner / spmrf

R package for Bayesian nonparametric adaptive smoothing with Stan
GNU Lesser General Public License v3.0
8 stars 4 forks source link

Long vectors not supported #3

Open george-githinji opened 7 years ago

george-githinji commented 7 years ago

I ran the model against a long vector (15,100). Running the model with a normal prior runs OK but running the same with a Laplace prior gives an error on completion.

Error in sendMaster(try(eval(expr, env), silent = TRUE)) :
  long vectors not supported yet: fork.c:376
Error in FUN(X[[i]], ...) :
  trying to get slot "mode" from an object (class "try-error") that is not an S4 object
In addition: Warning message:
In parallel::mclapply(1:chains, FUN = callFun, mc.preschedule = FALSE,  :
  4 function calls resulted in an error

The error could be R specific but I am not sure if it has to do with the class of model fit object. What are your thoughts?

jrfaulkner commented 7 years ago

Interesting. I have never tried so many parameters with this. Are you using parallelization and the mcapply function? It looks like there could be a problem with mcapply calling stan with large models. Check this post: https://github.com/stan-dev/rstan/issues/378 The Laplace and horseshoe models will nearly double the number of parameters over the normal model, so that could explain the difference. You may have to run chains in sequence. I have not set up the model code yet to handle multiple observations per grid cell. Otherwise you could try reducing the dimension of your grid. I will look into making that fix.

On Tue, May 2, 2017 at 10:32 AM, George notifications@github.com wrote:

I ran the model against a long vector (15,100). Running the model with a normal prior runs OK but running the same with a Laplace prior gives an error on completion.

Error in sendMaster(try(eval(expr, env), silent = TRUE)) : long vectors not supported yet: fork.c:376 Error in FUN(X[[i]], ...) : trying to get slot "mode" from an object (class "try-error") that is not an S4 object In addition: Warning message: In parallel::mclapply(1:chains, FUN = callFun, mc.preschedule = FALSE, : 4 function calls resulted in an error

The error could be R specific but I am not sure if it has to do with the class of model fit object. What are your thoughts?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/jrfaulkner/spmrf/issues/3, or mute the thread https://github.com/notifications/unsubscribe-auth/AKVwoK3vslX5AMvt70hsugqoY0Xp5G5fks5r12jHgaJpZM4NOcuO .

george-githinji commented 7 years ago

Yes, it does look like variant of https://github.com/stan-dev/rstan/issues/378 issue. I will ran with fewer iterations and chains and assess the convergence. Glad you will look into the issue. Many thanks.