On 11/28/12 3:11 PM, Spencer Maynes wrote:
> This is the first Stan model I've ever written,
That's an awfully ambitious first program to write
in any system.
I'd strongly recommend working up to bigger models
a little piece at a time (fewer predictors,
less hierarchical structure, etc.). Then when something
goes wrong, you'll have a more limited set of things
it might be.
> so I apologize for having a model that probably has errors in it beyond
> the one that the parser found, and also for not using enough vectorization. I really just want to know what "Parser
> expecting: <list><expression>","" means though. I think that it means that I'm missing a comma somewhere in my code,
> perhaps something along the lines of foo[i] when I define foo as matrix[i,j] foo; but after more than an hour of
> searching I can't find anything of the sort.
Sorry about that. Our 1.0.3 release broke the
localization of error messages, which is why it's saying
line=1, column=1. The 1.0.4 release which should be
out very soon puts them back.
The "expecting" message indeed means it's expecting
a list of expressions. Here's what the error message looks
like in 1.0.4:
--------------------
~/stan>bin/stanc /Users/carp/temp2/firstmodel.stan
Model name=firstmodel_model
Input file=/Users/carp/temp2/firstmodel.stan
Output file=firstmodel_model.cpp
INVALID COMMAND-LINE ARGUMENT
EXPECTATION FAILURE LOCATION: file=/Users/carp/temp2/firstmodel.stan; line=47, column=10
hourpred[,k] <- cowmean[k]+aemean[,k];
^-- here
DIAGNOSTIC(S) FROM PARSER:
Parser expecting: <list><expression>","
------------------
The issue is that Stan doesn't support partial array/vector/matrix
notation, so you can't do what you're trying to do.
If you have an M x N matrix x, then x[m] is a N-row-vector.
and for an M x N array y, y[m] is an N-array.
- Bob