Description Usage Arguments Details Author(s) Examples
keeps only cases within population which evaluate to TRUE for a given function.
1 2 | ## S3 method for class 'twDEMCPops'
subsetF(x, fKeep, ...)
|
x |
object of class twDEMCPops |
fKeep |
function(pop) returning an boolean matrix (nStep x nChain) of cases to keep << ,alternatively returning an integer matrix (niStep x nChain) with the indices to keep << ,alternatively returning an integer or boolean vector, that is applied to each chain |
... |
further arguments to fKeep |
The samples are redistributed across chains
Thomas Wutzler
1 2 3 4 5 6 7 8 | data(twdemcEx1)
range(concatPops(twdemcEx1)$parms[,"a",]) # spanning 9 to 11
#pop <- twdemcEx1$pops[[1]]
# note that the numer of samples across chains within one population is allowed to differ
fKeep <- function(pop){ tmp <- (pop$parms[,"a",] < 10) }
res <- subsetF(twdemcEx1, fKeep )
plot( as.mcmc.list(res), smooth=FALSE )
getNSamples(res)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.