Skip to content

Commit

Permalink
Ensure that the model does compile
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Oct 15, 2024
1 parent 9d8e3ed commit 91e9ff0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 0 additions & 1 deletion vignettes/examples/sir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// [[dust2::class(sir)]]
// [[dust2::time_type(discrete)]]
// [[dust2::has_compare()]]
// [[dust2::has_adjoint()]]
// [[dust2::parameter(I0)]]
// [[dust2::parameter(N)]]
// [[dust2::parameter(beta)]]
Expand Down
6 changes: 6 additions & 0 deletions vignettes/writing.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -292,3 +292,9 @@ cc_output(sir_code[methods_sir$compare_data])
```

This has the same long sort of call signature as `initial` and `update` but with **read-only** `state` and **read-only** data. Here, we return a single real number, being the log-likelihood at this point. In this example we add some small random noise to the modelled data (to avoid `NaN`s where our modelled cases are zero) and compute the log density from a Poisson distribution for observing the cases in `data`.

```{r, include = FALSE}
# just to check these do actually compile, otherwise fail the build:
dust_compile("examples/walk.cpp")
dust_compile("examples/sir.cpp")
```

0 comments on commit 91e9ff0

Please sign in to comment.