From 0c0f1f5d8bf7f5a7eeae1db648aee570dc4e1698 Mon Sep 17 00:00:00 2001 From: Felipe Gonzalez Date: Tue, 23 Apr 2024 13:23:10 -0600 Subject: [PATCH] Agregar sims de coeficientes --- notas/src/bangladesh-3.stan | 5 ++++- notas/src/bangladesh-4.stan | 3 +++ notas/src/bangladesh-5.stan | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/notas/src/bangladesh-3.stan b/notas/src/bangladesh-3.stan index b73b015..a18e5fe 100644 --- a/notas/src/bangladesh-3.stan +++ b/notas/src/bangladesh-3.stan @@ -43,5 +43,8 @@ generated quantities { prob_distrito_urbano[i] = inv_logit(alpha[i] + beta[i]); prob_distrito_rural[i] = inv_logit(alpha[i]); } - + // Simular de a priori poblacional + vector[2] beta_sim; + beta_sim[1] = normal_rng(alpha_bar, sigma_alpha); + beta_sim[2] = normal_rng(beta_bar, sigma_beta); } diff --git a/notas/src/bangladesh-4.stan b/notas/src/bangladesh-4.stan index c7e34aa..1b5109b 100644 --- a/notas/src/bangladesh-4.stan +++ b/notas/src/bangladesh-4.stan @@ -46,4 +46,7 @@ generated quantities { prob_distrito_urbano[i] = inv_logit(beta[i][1] + beta[i][2]); prob_distrito_rural[i] = inv_logit(beta[i][1]); } + // Simular de a priori poblacional + vector[2] beta_sim; + beta_sim = multi_normal_rng(beta_bar, Sigma); } diff --git a/notas/src/bangladesh-5.stan b/notas/src/bangladesh-5.stan index 1e22ec5..4a409ca 100644 --- a/notas/src/bangladesh-5.stan +++ b/notas/src/bangladesh-5.stan @@ -56,4 +56,9 @@ generated quantities { prob_distrito_urbano[i] = inv_logit(beta[1,i] + beta[2,i]); prob_distrito_rural[i] = inv_logit(beta[1,i]); } + + // Simular de a priori poblacional + vector[2] beta_sim; + beta_sim = multi_normal_rng(beta_bar, Sigma); + }