I’m trying to build a Stan model for an exponential fit with the formula y = \alpha e^{(-\beta x)}
I also want to add weights to the model.
What I’ve got so far is the following model, however, it’s not working. I’m getting several errors and divergencies, but as soon as I change to the OLS formula, it all works fine. So something should be off in the model section.
data {
int<lower=0> N;
vector[N] x;
vector[N] y;
vector[N] w;
}
parameters {
real<lower=1> alpha;
real<lower=0> beta;
real<lower=0> sigma;
}
model {
y ~ normal(alpha * exp(-beta * x), sigma);
}