Hi, How do I build a bayesian network with arbitrary no. of incomming nodes? Is there a generalized way of representing the CPT / prior / posterior variables?
E.g. , in the Water-Sprinkler example, the incomming nodes are know and the datatype of their CPT and posterior variables are hardcoded.
Variable<Dirichlet> ProbCloudyPrior; // Zero Incoming Nodes
VariableArray<Dirichlet> CPTRainPrior; // One Incomming Node
VariableArray<VariableArray<Dirichlet>, Dirichlet[][]> CPTWetGrassPrior; // Two Incomming Nodes
VariableArray<VariableArray<VariableArray<Dirichlet>, Dirichlet[][][]>> CPTThree; // Three Incomming Nodes
In my case, I do not know how many incoming nodes I have during compile-time. It's decided by the user during runtime.
Is there a way to generalize the above data structure?
Any pointers / workaround would be appreciated.
Thanks