Marcus Brubaker
unread,Aug 17, 2012, 6:27:38 PM8/17/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to stan...@googlegroups.com
I know if statements are on the TODO list somewhere, but until then I thought I would share this in case it's useful to anyone else. You can easily simulate an if statement in stan with a for loop.
For instance:
if (a > b) {
...
}
can be handled with
for (i in 1:int_step(a-b)) {
...
}
Ugly, yes, but effective and it avoids evaluation unlike the if_then_else() function.
Cheers,
Marcus