Individual priors for coefficients in regression

I using rstan to estimate the average time use for different laboratory analysis. The model is
T = a*beta, where T is a vector of length N of time used per person in different projects, a is a NxA matrix with counts of analysis performed. There are A different analysis types. Beta is the expression for a vector of length A of average times that I would like to estimate.
There exists estimates of time use from before, and I would prefer to use these in the prior for each beta to be estimated.

The model code is
progm ← "
data {
int<lower = 0> N;
int<lower = 0> A;
vector<lower = 0>[A] bp;
vector<lower = 0>[A] beta_sigma;
vector<lower = 0>[N] t;
matrix<lower = 0>[N,A] a;
}
parameters {
vector<lower = 0>[A] beta;
vector<lower = 0>[A] sigma;
}
model {
t ~ normal(a * beta, sigma);
beta ~ normal(bp, beta_sigma);
sigma ~ exponential(3);
}
"
sim1 ← stan(model_code = progm,
data = list(N = nrow(ma), A = ncol(ma),
t = vt, a = ma,
bp = beta_prior, beta_sigma = beta_sigma),
chains = 1, iter=5000*2, seed = 2345)

I have tried to indicate the individual priors as beta ~ normal(bp, beta_sigma), where bp is a vector of length A of the existing estimates, and beta_sigma is a vector of length A of identical values 0.1. This formulation causes an error. The program works fine with an identical prior distribution for all beta.

The number of rows in a * beta is N, while the number of rows in sigma is A. You can’t supply two different sized μ and σ vectors to t ~ normal(μ,σ). Since t has N rows, did you instead mean:

parameters {
 vector<lower = 0>[A] beta;
 vector<lower = 0>[N] sigma;
}

Thank you so much for pointing out this error. I was convinced the error came from the prior so I overlooked this. This was very helpful for me.

Are you not seeing error messages from the console? If not, you should turn them on, as in this case, the error message should tell you exactly what went wrong.