subsetF.twDEMCPops: subsetF twDEMCPops

Description Usage Arguments Details Author(s) Examples

Description

keeps only cases within population which evaluate to TRUE for a given function.

Usage

1
2
## S3 method for class 'twDEMCPops'
subsetF(x, fKeep, ...)

Arguments

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

Details

The samples are redistributed across chains

Author(s)

Thomas Wutzler

Examples

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)

twDEMC documentation built on May 31, 2017, 3:44 a.m.