For some reason Stan doesn’t like that I’ve given assigned the value 1 to the phi argument in the negative binomial distribution. I find this perplexing since other packages like brms use this exact syntax when you specify a geometric distribution for the response data.
model {
// priors including all constants
for(s in 1:S){
for(t in s:S){
target += beta_lpdf(P[s,t] | 0.5, 0.5) ;
}
}
// likelihood including all constants
if(!prior_only){
target += neg_binomial_2_log_lpmf(Y | eta, 1) ;
}
}
SYNTAX ERROR, MESSAGE(S) FROM PARSER:
No matches for:
neg_binomial_2_log_lpmf(matrix, matrix, int)
Available argument signatures for neg_binomial_2_log_lpmf:
neg_binomial_2_log_lpmf(int, real, real)
neg_binomial_2_log_lpmf(int, real, real[ ])
neg_binomial_2_log_lpmf(int, real, vector)
neg_binomial_2_log_lpmf(int, real, row_vector)
neg_binomial_2_log_lpmf(int, real[ ], real)
neg_binomial_2_log_lpmf(int, real[ ], real[ ])
neg_binomial_2_log_lpmf(int, real[ ], vector)
neg_binomial_2_log_lpmf(int, real[ ], row_vector)
neg_binomial_2_log_lpmf(int, vector, real)
neg_binomial_2_log_lpmf(int, vector, real[ ])
neg_binomial_2_log_lpmf(int, vector, vector)
neg_binomial_2_log_lpmf(int, vector, row_vector)
neg_binomial_2_log_lpmf(int, row_vector, real)
neg_binomial_2_log_lpmf(int, row_vector, real[ ])
neg_binomial_2_log_lpmf(int, row_vector, vector)
neg_binomial_2_log_lpmf(int, row_vector, row_vector)
neg_binomial_2_log_lpmf(int[ ], real, real)
neg_binomial_2_log_lpmf(int[ ], real, real[ ])
neg_binomial_2_log_lpmf(int[ ], real, vector)
neg_binomial_2_log_lpmf(int[ ], real, row_vector)
neg_binomial_2_log_lpmf(int[ ], real[ ], real)
neg_binomial_2_log_lpmf(int[ ], real[ ], real[ ])
neg_binomial_2_log_lpmf(int[ ], real[ ], vector)
neg_binomial_2_log_lpmf(int[ ], real[ ], row_vector)
neg_binomial_2_log_lpmf(int[ ], vector, real)
neg_binomial_2_log_lpmf(int[ ], vector, real[ ])
neg_binomial_2_log_lpmf(int[ ], vector, vector)
neg_binomial_2_log_lpmf(int[ ], vector, row_vector)
neg_binomial_2_log_lpmf(int[ ], row_vector, real)
neg_binomial_2_log_lpmf(int[ ], row_vector, real[ ])
neg_binomial_2_log_lpmf(int[ ], row_vector, vector)
neg_binomial_2_log_lpmf(int[ ], row_vector, row_vector)
error in ‘model428418796aa8_Orchid_Stan_Code’ at line 40, column 49
38: // likelihood including all constants
39: if (!prior_only) {
40: target += neg_binomial_2_log_lpmf(Y | eta, 1) ;
^
41: }
Error in stanc(file = file, model_code = model_code, model_name = model_name, :
failed to parse Stan model ‘Orchid Stan Code’ due to the above error.