cnSearchHist: Parent Histogram Matrix

View source: R/catnet.histo.R

cnSearchHistR Documentation

Parent Histogram Matrix

Description

Estimation of the parent matrix of nodes from data. The frequency of node edges is obtained by fitting networks consistent to randomly generated node orders.

Usage

cnSearchHist(data, perturbations=NULL, 
	maxParentSet=1, parentSizes=NULL, maxComplexity=0, 
	nodeCats=NULL, parentsPool=NULL, fixedParents=NULL, 
	score = "BIC", weight="likelihood", 
	maxIter=32, numThreads=2, echo=FALSE)

Arguments

data

a matrix in row-nodes format or a data.frame in column-nodes format

perturbations

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

maxParentSet

an integer, the maximal number of parents per node

parentSizes

an integer vector, maximal number of parents per node

maxComplexity

an integer, the maximal network complexity for the search

nodeCats

a list of node categories

parentsPool

a list of parent sets to choose from

fixedParents

a list of parent sets to choose from

score

a character, network selection score such as "AIC" and "BIC"

weight

a character, specifies how the

maxIter

an integer, the number of single order searches to be performed

numThreads

an integer value, the number of parallel threads

echo

a boolean that sets on/off some functional progress and debug information

Details

The function performs niter calls of cnSearchOrder for randomly generated node orders (uniformly over the space of all possible node orders), selects networks according to score and sum their parent matrices weighted by weight. Three scoring criteria are currently supported: "BIC", "AIC" and maximum complexity for any other value of score. The weight can be 1) "likelihhod", then the parent matrices are multiplied by the network likelihood, 1) "score", then the parent matrices are multiplied by the exponential of the network score, 3) any other value of weihgt uses multiplier 1. In this case the entries in the output matrix show how many times the corresponding parent-child pairs were found.

The function can runs numThreads number of parallel threads each processing different order. cnSearchHist function can be useful for empirical estimation of the relationships in some multivariate categorical data.

Value

A matrix

Author(s)

N. Balov

See Also

cnMatParents, cnSearchOrder

Examples

  cnet <- cnRandomCatnet(numnodes=8, maxParents=3, numCategories=2)
  psamples  <- cnSamples(object=cnet, numsamples=100)
  mhisto <- cnSearchHist(data=psamples, perturbations=NULL, 
		maxParentSet=2, maxComplexity=20)
  mhisto

catnet documentation built on Nov. 10, 2022, 5:08 p.m.