Stan separates integer and real types. The left-hand side
of poisson_log has to be an integer or array of integers.
That's what the "available signatures" is trying to tell you.
You supplied a vector, which has real values.
- Bob
> Sorry, I have a really basic question but couldn't find the answer from the error message. I have a model where there are separate space a time components (random walk and CAR) but i'm getting an error when trying to define the model. Here's the error,
>
> ValueError: Failed to parse Stan model 'anon_model_297587f7140f457644e8760d4e424878'. Error message:
> SYNTAX ERROR, MESSAGE(S) FROM PARSER:
>
>
> No matches for:
>
>
> vector ~ poisson_log(vector)
>
>
> Available argument signatures for poisson_log:
>
>
> int ~ poisson_log(real)
> int ~ poisson_log(real[])
> int ~ poisson_log(vector)
> int ~ poisson_log(row vector)
> int[] ~ poisson_log(real)
> int[] ~ poisson_log(real[])
> int[] ~ poisson_log(vector)
> int[] ~ poisson_log(row vector)
>
>
> require real scalar return type for probability function.
>
>
> ERROR at line 94
>
>
> 93: for (t in 1:nt){
> 94: observed[t] ~ poisson_log(log_expected + rep_vector(temporal[t], numRegions) + v);
> ^
> 95: }
>
> observed and log_expected are defined in data as,
>
> vector[nt] observed[numRegions];
> vector[numRegions] log_expected; // The expected number of counts based on demographics etc
>
> which I tried after using
>
> matrix[numRegions, nt] observed; // The observed counts at each point
>
> and v and temporal are defined as parameters,
>
> vector[nt] temporal;
> vector[numRegions] v; // Spatial smoothing component
>
>
> I know I'm doing something very basic wrong here but I can't figure out the syntax! Also, is this the most efficient way of defining this? And with observed defined as a vector of vectors will passing a numpy matrix as the data work?
>
> Any help would be appreciated - thanks!
>
>
>
>
>
> --
> 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.