Hi all,
I have written the following model
data {
int<lower=1> N;
int<lower=2> n_fighters;
int<lower=1, upper=n_fighters> red[N]; # fighter_id
int<lower=1, upper=n_fighters> blue[N]; # opponent_id
array[N, 2] int<lower=0> n_strikes_red;
array[N, 2] int<lower=0> n_strikes_blue;
int<lower=0> t_fight[N];
}
parameters {
vector[n_fighters - 1] raw_lambda_str_att;
vector[n_fighters - 1] raw_lambda_str_def;
real gamma_str;
}
transformed parameters {
vector[n_fighters] lambda_str_att = append_row(0, raw_lambda_str_att);
vector[n_fighters] lambda_str_def = append_row(0, raw_lambda_str_def);
}
model {
# priors
gamma_str ~ cauchy(0, 10);
raw_lambda_str_att ~ normal(0, 2);
raw_lambda_str_def ~ normal(0, 2);
# work-rate model
n_strikes_red[2] ~ poisson_log(gamma_str + lambda_str_att[red] + lambda_str_def[blue] + log(t_fight));
}
The array n_strikes_red
consist of integers values that represent the number of strikes landed and the number of strikes attempted for N
fights.
When I run this model I get the following error:
Instead supplied arguments of incompatible type: vector, array[ ] real.
How can I overcome this error?