cnLoglik: Sample Log-likelihood

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Calculate the log-likelihood of a sample with respect to a given catNetwork object

Usage

1
cnLoglik(object, data, pert=NULL, bysample=FALSE, softmode=FALSE)

Arguments

object

a catNetwork object

data

a data matrix given in the column-sample format, or a data.frame in the row-sample format

pert

a binary matrix with the dimensions of data. A value 1 designates the corresponding node in the sample as perturbed.

bysample

a logical

softmode

a logical, turns on/off the soft quantization mode

Details

If bysample is set to TRUE, the function output is a vector of log-likelihoods of the individual sample records. Otherwise, the total average of the log-likelihood of the sample is reported.

Value

A numeric value

Author(s)

N. Balov

See Also

cnNodeLoglik

Examples

1
2
3
  cnet <- cnRandomCatnet(numnodes=10, maxpars = 3, numcats = 2)
  psamples <- cnSamples(object=cnet, numsamples=100)
  cnLoglik(object=cnet, data=psamples)

sdnet documentation built on May 2, 2019, 12:43 a.m.