selectBestModel {celda}R Documentation

Select best chain within each combination of parameters

Description

Select the chain with the best log likelihood for each combination of tested parameters from a 'celdaList' object gererated by 'celdaGridSearch()'.

Usage

selectBestModel(celdaList, asList = FALSE)

Arguments

celdaList

Object of class 'celdaList'. An object containing celda models returned from 'celdaGridSearch()'.

asList

'TRUE' or 'FALSE'. Whether to return the best model as a 'celdaList' object or not. If 'FALSE', return the best model as a corresponding 'celda_C', 'celda_G' or 'celda_CG' object.

Value

A new 'celdaList' object containing one model with the best log likelihood for each set of parameters. If only one set of parameters is in the 'celdaList', the best model will be returned directly instead of a 'celdaList' object.

See Also

'celdaGridSearch()' can run Celda with multiple parameters and chains in parallel. 'subsetCeldaList()' can subset the 'celdaList' object.

Examples

data(celdaCGGridSearchRes)
## Returns same result as running celdaGridSearch with "bestOnly = TRUE"
cgsBest <- selectBestModel(celdaCGGridSearchRes)

[Package celda version 1.0.3 Index]