Index out of range error

250 views
Skip to first unread message

Jo Lweny

unread,
Nov 16, 2015, 7:34:06 AM11/16/15
to Stan users mailing list
Hello Stan-People,
I have a simple script- attached- that give the error below when run
SAMPLING FOR MODEL 'c716ca84189ceb1baba1ae38323494c9' NOW (CHAIN 1).
Error : Exception thrown at line 47:
Exception thrown at line 28:
[]: accessing element out of range. index 1 out of range; expecting index to be between 1 and 0; index position = 1z
error occurred during calling the sampler; sampling not done
Warning in .local(object, ...) :
  some chains had errors; consider specifying chains = 1 to debug
here are whatever error messages were returned


I cant figure out why I run into this error, please help.


Lukio Olweny.
neg_bin.R

Daniel Lee

unread,
Nov 16, 2015, 8:26:56 AM11/16/15
to stan-...@googlegroups.com
Looks like your variable k within the function is declared without a size? I wonder if that initializes to 0. I would have expected it to fail. 


Daniel
--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
To post to this group, send email to stan-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<neg_bin.R>
Reply all
Reply to author
Forward
0 new messages