---
title: "dobson"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{dobson}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---
  
```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

```{r}
library(serodynamics)
library(rjags)
library(runjags)
runjags::findJAGS()
```

```{r "run-dobson-model", warn = FALSE, message = FALSE, }

set.seed(1)
data1 <- rbinom(n = 91, size = 1, prob = .6)
jags_post0 <- run.jags(
  n.chains = 2,
  inits = initsfunction,
  model = serodynamics_example("model.dobson.jags"),
  data = list(r = data1, N = length(data1)),
  monitor = "p"
)
```

```{R}
jags_post0$mcmc |> as.array() |> head()
```
