"Exception: variable does not exist" but it does

1,708 views
Skip to first unread message

Dan Stowell

unread,
Sep 16, 2014, 2:00:08 PM9/16/14
to stan-...@googlegroups.com
Hi all,

Thanks Bob for the tips on my code. I made some synthetic test data,
available here alongside my model:
https://gist.github.com/danstowell/272ce97b21130e2806b3

Unfortunately, running the model (using args "sample data
file=simul.data.R") gives this bizarre error:


Exception: variable does not exist; processing stage=data
initialization; variable name=N; base type=int
Diagnostic information:
Dynamic exception type: std::runtime_error
std::exception::what: variable does not exist; processing stage=data
initialization; variable name=N; base type=int


It's bizarre because "N" is definitely specified in my data file! So,
does the problem lie with me or stan?

Thanks
Dan

--
http://www.mcld.co.uk

Bob Carpenter

unread,
Sep 16, 2014, 2:04:00 PM9/16/14
to stan-...@googlegroups.com
Given that N's the first variable in the model, you may be pointing
to a file that doesn't exist. We need better error messages that indicate
the file's missing.

- Bob
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>

Dan Stowell

unread,
Sep 16, 2014, 6:01:24 PM9/16/14
to stan-...@googlegroups.com
Wow, OK thanks. Your diagnosis is correct. In my judgment that's
definitely stan's fault, then, if it can't say "file not found"!

Best
Dan
--
http://www.mcld.co.uk

Bob Carpenter

unread,
Sep 16, 2014, 6:36:37 PM9/16/14
to stan-...@googlegroups.com
On Sep 16, 2014, at 6:01 PM, Dan Stowell <danst...@gmail.com> wrote:

> Wow, OK thanks. Your diagnosis is correct. In my judgment that's
> definitely stan's fault, then, if it can't say "file not found"!

Definitely our fault for not instrumenting better messages.

I just filed bug reports against both RStan and CmdStan (though I
don't even know if RStan has the issue, so it may not need a fix).

This should get cleaned up over the next several months as we
refactor the commands across PyStan/RStan/CmdStan into common
code where we can change it in the underlying Stan C++ code,
which will be shared by these interfaces. They may get cleaned up
sooner if anyone has time to fix the interfaces before the refactor.

- Bob

Reply all
Reply to author
Forward
0 new messages