i want to fitting a model developed by Zainab Al-kaabawi , Yinghui Wei & Rana Moyeed(Bayesian hierarchical models for linear networks,Journal of Applied Statistics).
Write a model: counts y1,…,yn distributed according to a Poisson distribution with mean Lλ, in terms of the logarithm of the mean,θ
= logλ, Complete the model by assigning a
N(μ,σ) prior to the log mean parameter θ. Now, i have two variables:death denoting death cases due to accident in a province, and length denoting the length of roads in a province.
my Stan is as follows,
data {
int<lower=0> N;
vector[N] length;
vector[N] death;
}
parameters {
vector[N] lambda;
}
model {
lambda ~ normal(0,100);
death ~ poisson(exp(lambda)*length);
}
"
the result show that death ~ poisson(exp(lambda)*length) is wrong.
The message is “Ill-typed arguments supplied to infix operator *”
how to resolve the issue? thank you in advance.