If neither n_per_chain
and n
are provided, all iterations are
used.
tidy_flows(
nm,
mcmc,
n_per_chain = NULL,
n = NULL,
n_grid = 64,
steady_state = FALSE,
dt = NULL,
grid_size = NULL,
at = NULL,
end = NULL,
use_cache = TRUE,
cores = NULL
)
A tidy table containing the mcmc iterations (chain, iteration, parameters), the grouping variables from the network model and the flows. The returned flow values are the average flow per unit of time over the trajectory calculations (or steady state flows if
steady_state
is TRUE).
A networkModel
object.
The corresponding output from run_mcmc
.
Integer, number of iterations randomly drawn per chain. Note that iterations are in sync across chains (in practice, random iterations are chosen, and then parameter values extracted for those same iterations from all chains).
Integer, number of iterations randomly drawn from mcmc
. Note
that iterations are *not* drawn in sync across chains in this case (use
n_per_chain
if you need to have the same iterations taken across all
chains).
Size of the time grid used to calculate trajectories
Boolean (default: FALSE). If TRUE, then steady state
compartment sizes are calculated for each iteration and steady state flows
are calculated from those compartment sizes. Note that any pulse that
might be specified in the input model nm
is ignored in this case.
Time step size or grid points, respectively.
Timepoints at which the predictions should be returned.
Final timepoint used in the projections.
Boolean, use cache for faster calculations?
Number of cores to use for parallel calculations. Default is
NULL
, which means to use the value stored in
options()[["mc.cores"]]
(or 1 if this value is not set).
Warning: This function is still maturing and its interface and output might change in the future.
Note about how steady state sizes for split compartments are calculated: the steady size of the active portion is calculated divide it is divided by the active fraction (portion.act parameter) to get the total size including the refractory portion. In this case we get a "steady-state" refractory portion, consistent with steady state size of active fraction and with portion.act parameter.
tf <- tidy_flows(aquarium_mod, aquarium_run, n_per_chain = 25, cores = 2)
tf
tfmcmc <- as.mcmc.list(tf)
plot(tfmcmc)
Run the code above in your browser using DataLab