Skip to content

Commit

Permalink
Deploying to gh-pages from @ 0340e4c 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
tereom committed Dec 5, 2024
1 parent 64f3bc6 commit ceff1ba
Show file tree
Hide file tree
Showing 43 changed files with 482 additions and 481 deletions.
294 changes: 147 additions & 147 deletions 01-exploratorio.md

Large diffs are not rendered by default.

Binary file modified 01-exploratorio_files/figure-html/unnamed-chunk-11-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 01-exploratorio_files/figure-html/unnamed-chunk-30-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 01-exploratorio_files/figure-html/unnamed-chunk-31-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 01-exploratorio_files/figure-html/unnamed-chunk-33-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 02-tipos-de-estudio_files/figure-html/grafica-pcr-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions 14-intro-bayesiana.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ quantile(sim_inicial$theta, c(0.025, 0.975)) |> round(2)

```
## 2.5% 97.5%
## 0.14 0.85
## 0.15 0.85
```

Es difícil justificar en abstracto por qué escogeriamos una inicial con esta
Expand Down Expand Up @@ -388,8 +388,8 @@ sims |> group_by(dist) |>
## # A tibble: 2 × 2
## dist theta_hat
## <chr> <dbl>
## 1 inicial 0.503
## 2 posterior 0.61
## 1 inicial 0.5
## 2 posterior 0.61
```
Nota que el estimador de máxima verosimilitud es $\hat{p} = 19/30 = 0.63$, que
es ligeramente diferente de la media posterior. ¿Por qué?
Expand All @@ -410,7 +410,7 @@ sims |> group_by(dist) |>
## # Groups: dist [2]
## dist `0.025` `0.975`
## <chr> <dbl> <dbl>
## 1 inicial 0.14 0.85
## 1 inicial 0.15 0.85
## 2 posterior 0.45 0.76
```
El segundo renglón nos da un intervalo posterior para $\theta$ de *credibilidad*
Expand Down
Binary file modified 14-intro-bayesiana_files/figure-html/unnamed-chunk-6-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 14-intro-bayesiana_files/figure-html/unnamed-chunk-8-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion 15-bayesiana-calibracion.md
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ se muestra como una horizontal punteada.

## Ejemplo: estimación de proporciones {-}

Ahora repetimos el ejercicio
Ahora repetimos el ejercicio de la estimación de la proporción de hogares con ingresos
superiores a 150 mil.


``` r
Expand Down
46 changes: 23 additions & 23 deletions 16-bayes-mcmc.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ c(media_post, momento_2_post)
```

```
## [1] 0.7155559 0.5372170
## [1] 0.7147007 0.5364443
```

Y podemos aproximar de esta manera cualquier cantidad de interés que esté basada
Expand All @@ -202,7 +202,7 @@ mean(exp(theta) > 2)
```

```
## [1] 0.5958
## [1] 0.5959
```
y así sucesivamente.

Expand Down Expand Up @@ -286,10 +286,10 @@ simular_conjunta(1, datos)
## # A tibble: 4 × 2
## sabor valor_sim
## <chr> <dbl>
## 1 fresa 0.755
## 2 limón 0.783
## 3 mango 0.819
## 4 guanábana 0.569
## 1 fresa 0.886
## 2 limón 0.729
## 3 mango 0.701
## 4 guanábana 0.493
```


Expand All @@ -306,16 +306,16 @@ sims_posterior
## # A tibble: 20,000 × 3
## rep sabor valor_sim
## <int> <chr> <dbl>
## 1 1 fresa 0.732
## 2 1 limón 0.831
## 3 1 mango 0.850
## 4 1 guanábana 0.397
## 5 2 fresa 0.670
## 6 2 limón 0.839
## 7 2 mango 0.664
## 8 2 guanábana 0.558
## 9 3 fresa 0.671
## 10 3 limón 0.758
## 1 1 fresa 0.727
## 2 1 limón 0.823
## 3 1 mango 0.849
## 4 1 guanábana 0.474
## 5 2 fresa 0.659
## 6 2 limón 0.785
## 7 2 mango 0.866
## 8 2 guanábana 0.631
## 9 3 fresa 0.553
## 10 3 limón 0.719
## # ℹ 19,990 more rows
```

Expand All @@ -338,9 +338,9 @@ sims_posterior %>%
## sabor n prop
## <chr> <int> <dbl>
## 1 fresa 1264 0.0632
## 2 guanábana 8 0.0004
## 3 limón 5396 0.270
## 4 mango 13332 0.667
## 2 guanábana 20 0.001
## 3 limón 5424 0.271
## 4 mango 13292 0.665
```
Y vemos que los mejores sabores son mango y limón. La probabilidad posterior de
que mango sea el sabor preferido por la población es de 66%. La integral correspondiente
Expand Down Expand Up @@ -372,7 +372,7 @@ de una distribución cualquiera $p(\theta) = K f(\theta)$, donde sólo conocemos
la función $f(\theta)$.


## Ejemplo de islas
## Ejemplo de islas {-}

Comenzamos revisando el ejemplo de las islas en @Kruschke (7.2) para tener más intuición de cómo funciona este algoritmo.

Expand Down Expand Up @@ -746,8 +746,8 @@ tibble(metodo = c("sim Metrópolis", "sim Independiente", "exacto"),
## # A tibble: 3 × 2
## metodo media_post
## <chr> <dbl>
## 1 sim Metrópolis 0.605
## 2 sim Independiente 0.602
## 1 sim Metrópolis 0.613
## 2 sim Independiente 0.600
## 3 exacto 0.6
```

Expand Down Expand Up @@ -894,7 +894,7 @@ estimaciones_media %>% bind_rows(tibble(tipo = "exacta", media = 20/100)) %>%
## # A tibble: 4 × 2
## tipo media
## <chr> <dbl>
## 1 salto chico 0.128
## 1 salto chico 0.132
## 2 salto grande 0.190
## 3 salto apropiado 0.203
## 4 exacta 0.2
Expand Down
Binary file modified 16-bayes-mcmc_files/figure-html/unnamed-chunk-13-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 16-bayes-mcmc_files/figure-html/unnamed-chunk-14-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 16-bayes-mcmc_files/figure-html/unnamed-chunk-19-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 16-bayes-mcmc_files/figure-html/unnamed-chunk-20-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 16-bayes-mcmc_files/figure-html/unnamed-chunk-21-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 16-bayes-mcmc_files/figure-html/unnamed-chunk-24-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 16-bayes-mcmc_files/figure-html/unnamed-chunk-25-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 16-bayes-mcmc_files/figure-html/unnamed-chunk-26-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 16-bayes-mcmc_files/figure-html/unnamed-chunk-27-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@
<li class="chapter" data-level="" data-path="métodos-de-cadenas-de-markov-monte-carlo.html"><a href="métodos-de-cadenas-de-markov-monte-carlo.html#ejemplo-varias-pruebas-independientes"><i class="fa fa-check"></i>Ejemplo: varias pruebas independientes</a></li>
</ul></li>
<li class="chapter" data-level="" data-path="métodos-de-cadenas-de-markov-monte-carlo.html"><a href="métodos-de-cadenas-de-markov-monte-carlo.html#simulando-de-la-posterior"><i class="fa fa-check"></i>Simulando de la posterior</a></li>
<li class="chapter" data-level="12.1" data-path="métodos-de-cadenas-de-markov-monte-carlo.html"><a href="métodos-de-cadenas-de-markov-monte-carlo.html#ejemplo-de-islas"><i class="fa fa-check"></i><b>12.1</b> Ejemplo de islas</a></li>
<li class="chapter" data-level="" data-path="métodos-de-cadenas-de-markov-monte-carlo.html"><a href="métodos-de-cadenas-de-markov-monte-carlo.html#ejemplo-de-islas"><i class="fa fa-check"></i>Ejemplo de islas</a></li>
<li class="chapter" data-level="" data-path="métodos-de-cadenas-de-markov-monte-carlo.html"><a href="métodos-de-cadenas-de-markov-monte-carlo.html#por-qué-funciona-metrópolis"><i class="fa fa-check"></i>¿Por qué funciona Metrópolis?</a></li>
<li class="chapter" data-level="" data-path="métodos-de-cadenas-de-markov-monte-carlo.html"><a href="métodos-de-cadenas-de-markov-monte-carlo.html#método-de-metrópolis"><i class="fa fa-check"></i>Método de Metrópolis</a></li>
<li class="chapter" data-level="" data-path="métodos-de-cadenas-de-markov-monte-carlo.html"><a href="métodos-de-cadenas-de-markov-monte-carlo.html#ajustando-el-tamaño-de-salto"><i class="fa fa-check"></i>Ajustando el tamaño de salto</a>
Expand Down
Loading

0 comments on commit ceff1ba

Please sign in to comment.