You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
800 B
Plaintext
33 lines
800 B
Plaintext
//
|
|
// 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<lower=0> N;
|
|
int<lower=0> k;
|
|
matrix[N,k] X;
|
|
vector[N] int<lower=0, upper=1> y;
|
|
}
|
|
|
|
// The parameters accepted by the model. Our model
|
|
// accepts two parameters 'mu' and 'sigma'.
|
|
parameters {
|
|
vector[k] beta;
|
|
}
|
|
|
|
// The model to be estimated. We model the output
|
|
// 'y' to be normally distributed with mean 'mu'
|
|
// and standard deviation 'sigma'.
|
|
model {
|
|
y ~ bernoulli_logit( X * beta);
|
|
}
|
|
|