I have tried to simply my model to fit a single gaussian and basing it off of this post. I am still unable to fit the model unfortunately
"""
functions {
real phi(real x, real mu, real sigma){
return 1 / (sigma * sqrt(2 * pi())) * exp(-(x - mu)^2/(2 * sigma^2));
}
}
data {
int<lower = 0> N;
vector[N] y;
vector[N] x;
}
parameters {
real m;
real<lower=0> sigma;
real<lower=0> s;
}
model {
//priors
m ~ normal(0, 1);
s ~ normal(0,1);
sigma ~ normal(0,1);
for(i in 1:N){
y[i] ~ normal(phi(x[N], m, s), sigma);
}
}
"""