For a given data sample, the function calculates the log-likelihood of a node with respect to a specified parent set.
cnNodeSampleLoglik(node, pars, data, pert=NULL)
cnNodeSampleProb(node, pars, data, pert=NULL)
an integer
or a list
of integer
s, node indices in the data
an integer
or a list
of integer
s, vector of parent indices for the node
s
a matrix
or data.frame
of categories
an optional perturbation matrix
or data.frame
a numeric
value
# NOT RUN {
cnet <- cnRandomCatnet(numnodes=10, maxpars=3, numcats=2)
psamples <- cnSamples(object=cnet, numsamples=100)
cnNodeSampleLoglik(node=5, pars=c(1,2), data=psamples)
# }
Run the code above in your browser using DataLab