logScoreMultDir.bnpostmcmc: Log scores of best graphs.

Description Usage Arguments Value See Also

View source: R/post-mcmc.R

Description

Returns the log scores of the best graphs encountered by the sampler.

Usage

1
2
3
  ## S3 method for class 'bnpostmcmc'
 logScoreMultDir(x, sampler, data,
    sort.by = "posterior", head = Inf, use.names = F, ...)

Arguments

x

An object of class 'bnpostmcmc'

sampler

A function generated by BNSampler() or similar

data

A data.frame of the form required by logScoreMultDir()

sort.by

A character of length 1. Either "posterior" or "logScoreMultDir". Determines the sorting of the result, and if head is finite and smaller than the number of graphs encountered in the MCMC, it also determines the graphs for which the scores are returned. if sort.by == "posterior": the scores of the most frequently encountered graphs are returned, sorted by the frequency that they are encountered. ie if the MCMC has converged, this returns best graphs with respect to the posterior distribution on graphs, sorted with respect to the posterior distribution on graphs. if sort.by == "logScoreMultDir": the scores of the graphs encountered during MCMC that score the most highly according to logScoreMultDir() are returned. This will be slower, because the scores of ALL the graphs encountered must be computed first (only local, incremental scores are stored by the MCMC)

head

A numeric of length 1. The 1st to headth most-highly scoring (with respect to the sort.by metric) will be returned. If the 'head'th most-commonly encountered graph ties in score with other graphs, all of the ties will be returned. Thus the result may NOT be of length head.

use.names

A logical of length 1. If TRUE, the result is a named vector, with names given by as.character(bn)

...

Further arguments passed to logScoreMultDir()

Value

A vector of length at least head (if head is finite), giving the logScoreMultDir() of the graphs, or all the graphs encountered during MCMC if head == Inf.

See Also

logScoreMultDir


rjbgoudie/structmcmc documentation built on Nov. 3, 2020, 3:41 a.m.