| ps_trace | R Documentation |
Runs multiple independent chains of the null model randomization algorithm and
records a mixing diagnostic at each step, producing trace plots to assess convergence.
This is a convenience wrapper around nullcat::trace_cat() that extracts the
appropriate community matrix from a phylospatial object.
ps_trace(ps, fun = c("nullcat", "quantize"), plot = TRUE, ...)
ps |
A |
fun |
Character: |
plot |
Logical: if |
... |
Additional arguments passed to |
An object of class "cat_trace". See nullcat::trace_cat() for details.
ps_suggest_n_iter(), ps_rand()
if (requireNamespace("nullcat", quietly = TRUE)) {
ps_bin <- ps_simulate(data_type = "binary")
tr <- ps_trace(ps_bin, fun = "nullcat", method = "curvecat",
n_iter = 2000, n_chains = 5, plot = TRUE)
ps <- ps_simulate(data_type = "prob")
tr <- ps_trace(ps, fun = "quantize", method = "curvecat",
n_strata = 4, fixed = "cell",
n_iter = 2000, n_chains = 5, plot = TRUE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.