calculate doesn't work on data array?
- Dominant language
- C++
- Stars
- 607
- Forks
- 67
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 1
Description
Hi, I wish to simulate observations after fitting a greta model with mixture likelihood, but couldn't get it to work. Below is the example in `?mixture`. I only modified the first line with `as_data` to be able to use `calculate` on `x`. Perhaps I missed something?
```
library(greta)
x <- as_data(c(
rpois(800, 3),
rpois(200, 10)
))
weights <- uniform(0, 1, dim = 2)
rates <- normal(0, 10, truncation = c(0, Inf), dim = 2)
distribution(x) <- mixture(poisson(rates[1]),
poisson(rates[2]),
weights = weights
)
m <- model(rates)
draws_rates <- mcmc(m, n_samples = 500)
calculate(x, values = draws_rates, nsim = 1) # will fail with error
```
Thanks in advance!
Contributor guide
Assessment
This issue has not been assessed yet.