Temporal beliefs

<< Click to Display Table of Contents >>

Navigation:  Using SMILE > Dynamic Bayesian networks >

Temporal beliefs

For plate nodes in the DBN, the inference algorithm calculates temporal beliefs, which are marginal posterior probability distributions indexed by time. To access temporal beliefs, use the DSL_nodeVal::GetMatrix method. We described the same method earlier in Node value & evidence section, where it was used to retrieve static marginal probabilities. The dependency of marginal probabilities on time makes the temporal beliefs matrix large. If a node has X outcomes and the slice count was set to Y, the matrix will have X * Y elements. The elements representing a single time slice are adjacent. Therefore, elements with indices [0..X-1] in the matrix are the beliefs for t=0, elements [X..2*X-1] are the beliefs for t=1 and so on. The code snippet below iterates over the temporal beliefs and displays a single line of numbers for each time step. The numbers are marginal probabilities of node outcomes.

DSL_node *node = …;

int outcomeCount = node->Def()->GetNumberOfOutcomes();

int sliceCount = node->Network()->GetNumberOfSlices();

const DSL_Dmatrix *mtx = node->Val()->GetMatrix();

for (int sliceIdx = 0; sliceIdx < sliceCount; sliceIdx++)

{

    printf("\tt=%d:", sliceIdx);

 for (int i = 0; i < outcomeCount; i++)

    {

        printf(" %f", (*mtx)[sliceIdx * outcomeCount + i]);

    }

    printf("\n");

}

Only the plate nodes have the temporal beliefs. Other temporal node types have normal beliefs (the number of elements in the belief array is equal to their outcome count).

If a plate node has defined intervals or point values, the temporal mean and standard deviation are available. DSL_nodeValue::GetTemporalMeanStdDev returns two vectors or two arrays containing means and standard deviations for all time slices.