Skip to content

Commit

Permalink
Agregar primer modelo de vinos
Browse files Browse the repository at this point in the history
  • Loading branch information
felipegonzalez committed Mar 13, 2024
1 parent fe99333 commit b4d3cec
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions notas/src/vinos-1.stan
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
data {
int<lower=0> N; //número de calificaciones
int<lower=0> n_vinos; //número de vinos
int<lower=0> n_jueces; //número de jueces
vector[N] S;
array[N] int juez;
array[N] int vino;
}

parameters {
vector[n_vinos] Q;
real <lower=0> sigma;
}

transformed parameters {
vector[N] media_score;
// determinístico dado parámetros
for (i in 1:N){
media_score[i] = Q[vino[i]];
}
}

model {
// partes no determinísticas
S ~ normal(media_score, sigma);
Q ~ std_normal();
sigma ~ exponential(1);
}

0 comments on commit b4d3cec

Please sign in to comment.