// update distributions of this node
Estimator[] distributions = m_Distributions[nTargetNode];
int nNewCard = values.size();
for (int iParent = 0; iParent < distributions.length; iParent++) {
DiscreteEstimatorBayes distribution = new DiscreteEstimatorBayes(nNewCard, 0);
for (int iValue = 0; iValue < nNewCard - 1; iValue++) {
distribution.addValue(iValue, distributions[iParent].getProbability(iValue));
}
distributions[iParent] = distribution;
}
// update distributions of all children
for (int iNode = 0; iNode < getNrOfNodes(); iNode++) {
if (m_ParentSets[iNode].contains(nTargetNode)) {
distributions = m_Distributions[iNode];
ParentSet parentSet = m_ParentSets[iNode];
int nParentCard = parentSet.getFreshCardinalityOfParents(m_Instances);
Estimator[] newDistributions = new Estimator[nParentCard];
int nCard = getCardinality(iNode);
int nParents = parentSet.getNrOfParents();
int[] values2 = new int[nParents];
int iOldPos = 0;
int iTargetNode = 0;
while (parentSet.getParent(iTargetNode) != nTargetNode) {
iTargetNode++;
}
for (int iPos = 0; iPos < nParentCard; iPos++) {
DiscreteEstimatorBayes distribution = new DiscreteEstimatorBayes(nCard, 0);
for (int iValue = 0; iValue < nCard; iValue++) {
distribution.addValue(iValue, distributions[iOldPos].getProbability(iValue));
}
newDistributions[iPos] = distribution;
// update values
int i = 0;
values2[i]++;