// // This Stan program defines a simple model, with a // vector of values 'y' modeled as normally distributed // with mean 'mu' and standard deviation 'sigma'. // // Learn more about model development with Stan at: // // http://mc-stan.org/users/interfaces/rstan.html // https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started // // The input data is a vector 'y' of length 'N'. data { int D; int N; int y[N]; row_vector[D] x[N]; } parameters { real mu[D]; real sigma[D]; } model { sigma ~ gamma(2,0.1); mu ~ normal(0, sigma); //convert to mvnormal for (n in 1:N) { y[n] ~ bernoulli_logit(x[n] * mu); } }