You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now we have the ability to write probabilistic compare functions within odin, it makes sense to try to use them for not just log-likelihood calculation, but also random generation of data.
We can then simulate from this model, and compare it to some data
np <- 10
mod <- gen$new(list(), 0, np, seed = 1L)
y <- mod$run(50)
data <- data.frame(time = 50, observed_y = 3, observed_z = 4)
mod$set_data(dust::dust_data(data, "time"))
mod$compare_data()
We could perhaps instead want to simulate data based upon the simulation of the model. Something like a mod$simulate_data() function. Maybe there are inputs we would want to use for this, e.g. the time-steps at which we want to simulate data, or which data streams we want to simulate data for (other data streams appearing in the compare could just return NA values).
Potential issue - how would distributions where there are two (or more) bits of data be handled? Obvious example is binomial, where the number of trials/tests and number of "successes" might both be treated as data in the odin code. One might want to input the number of tests and simulate the number of "successes"?
Now we have the ability to write probabilistic compare functions within odin, it makes sense to try to use them for not just log-likelihood calculation, but also random generation of data.
Consider a toy model
We can then simulate from this model, and compare it to some data
We could perhaps instead want to simulate data based upon the simulation of the model. Something like a
mod$simulate_data()
function. Maybe there are inputs we would want to use for this, e.g. the time-steps at which we want to simulate data, or which data streams we want to simulate data for (other data streams appearing in the compare could just returnNA
values).Welcoming thoughts or flagging up potential issues from those who contributed to previous discussion (mrc-ide/odin.dust#130): @richfitz, @annecori, @MJomaba, @lwhittles, @cwhittaker1000. Feel free to suggest others who would provide useful input.
The text was updated successfully, but these errors were encountered: