select.chains: Select chains in a fitted evorates model

View source: R/out_chain.management.R

select.chainsR Documentation

Select chains in a fitted evorates model

Description

This function subsets fitted evorates model to specific chains.

Usage

select.chains(fit, chains, simplify = TRUE)

Arguments

fit

An object of class "evorates_fit".

chains

A character or numeric vector specifying which chains to select. Notably, NA (or out of bound) selections are not allowed and automatically ignored with a warning.

simplify

TRUE or FALSE: should the resulting param_block array(s) in fit be simplified? If TRUE (the default), dimensions of length 1 in the result are automatically collapsed, with corresponding information stored as attributes (this is the default behavior of param_block operators).

Value

An object of class "evorates_fit". All previously-existing param_block arrays stored in fit will be included.

See Also

Other chain management: combine.chains(), exclude.warmup(), thin.chains()

Examples

#get whale/dolphin evorates fit
data("cet_fit")

#three ways to get the second and first chain
fit <- select.chains(cet_fit, c('chain 1','chain 2'))
fit <- select.chains(cet_fit, c(1,2))
fit <- select.chains(cet_fit, -c(3,4))

#note handling of NAs
fit <- select.chains(cet_fit, c('chain 1', NA))
fit <- select.chains(cet_fit, c('chain 1', 'chain 5'))
fit <- select.chains(cet_fit, c(1,5))

#here's what happens when you do vs. don't simplify the result
select.chains(cet_fit, 1)$means; select.chains(cet_fit, 1, simplify = FALSE)$means



bstaggmartin/backwards-BM-simulator documentation built on June 3, 2024, 5:51 p.m.