Learn R Programming

catnet (version 1.08.2)

cnSearchHist: 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, 
	maxParentSet, parentSizes=NULL, maxComplexity=0, 
	parentsPool=NULL, fixedParentsPool=NULL, 
	selectMode = "BIC", 
	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
parentsPool
a list of parent sets to choose from
fixedParentsPool
a list of parent sets to choose from
selectMode
a character, optimization network selection criterion such as "AIC" and "BIC"
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

Value

  • A matrix

Details

After performing niter calls of cnSearchOrder for randomly generated node orders (uniformly over the space of all possible node orders), the function returns the histogram matrix of the parent-child relations, as given by cnMatParents function, for the resulting optimal networks. Essentially, the result is sum of cnMatParents applied to all found networks, across the random orders and complexities up to the maximum specified. The entries in the output matrix shows how many times a given parent-child pair was found.

The function speeds up the Markov Chain by implementing a pre-computing buffer. It runs numThreads number of parallel threads each of which process a proposed order. However, only the last, if any, of the accepted proposals from the computed numThreads ones is considered.

cnSearchHist function can be useful for empirical estimation of the relationships in some multivariate categorical data.

See Also

cnMatParents, cnSearchOrder

Examples

Run this code
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

Run the code above in your browser using DataLab