Description Usage Arguments Value Examples
View source: R/adapt_particles.R
This function takes the provided libbi
and
runs MCMC at a single point (i.e., repeatedly proposing the same parameters),
adapting the number of particles distribution until the variance of the log-likelihood
crosses the value given as target.variance
(1 by default).
1 2 3 4 5 6 7 8 | adapt_particles(
x,
min = 1,
max = 1024,
target.variance = 1,
quiet = FALSE,
...
)
|
x |
a |
min |
minimum number of particles |
max |
maximum number of particles |
target.variance |
target log-likelihood variance; once this is crossed, the current number of particles will be used |
quiet |
if set to TRUE, will not provide running output of particle numbers tested |
... |
parameters for libbi$run |
a libbi
with the desired proposal distribution
1 2 3 4 5 6 | example_obs <- bi_read(system.file(package="rbi", "example_dataset.nc"))
example_model <- bi_model(system.file(package="rbi", "PZ.bi"))
example_bi <- libbi(model = example_model, obs = example_obs)
obs_states <- var_names(example_model, type = "obs")
max_time <- max(vapply(example_obs[obs_states], function(x) { max(x[["time"]])}, 0))
adapted <- adapt_particles(example_bi, nsamples = 128, end_time = max_time)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.