More questions about Conditional Probabilities in Parameter Learning

The engine.
Post Reply
Bo Hu
Posts: 18
Joined: Tue Aug 02, 2016 4:13 am

More questions about Conditional Probabilities in Parameter Learning

Post by Bo Hu »

Hello,

I encountered some troubles when I tried to extract the conditional probability.

1) I got a linear 4-node structure, where B is conditional on A, C is conditional on B, and D is conditional on C. However, when I checked the conditional probability matrix for node, there are 4 elements (there are supposed to be 2 for A). I do not know why.

2) I wonder if there is a way to figure out what each conditional probability represents (namely, the label for each CP), for I noticed the order (or index) of the conditional probabilities has been changing.

Many thanks in advance.

Bo
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: More questions about Conditional Probabilities in Parameter Learning

Post by shooltz[BayesFusion] »

I got a linear 4-node structure, where B is conditional on A, C is conditional on B, and D is conditional on C. However, when I checked the conditional probability matrix for node, there are 4 elements (there are supposed to be 2 for A). I do not know why.
Can you post your network here? The board software accepts attachments. Alternatively, you can copy the contents of your xdsl file into the message.
I wonder if there is a way to figure out what each conditional probability represents (namely, the label for each CP), for I noticed the order (or index) of the conditional probabilities has been changing.
Changing between EM runs?
Bo Hu
Posts: 18
Joined: Tue Aug 02, 2016 4:13 am

Re: More questions about Conditional Probabilities in Parameter Learning

Post by Bo Hu »

Yes, the order of conditional probabilities is changing between EM runs. Because I do not get the rule by which these probabilities are presented in the outcome, it's hard to tell which is which.

Here is the code I used to create the network. There are 30 observed variables, x1.............x30, which are intended to measure 4 latent variables, A, B, C, D. Four latent nodes are linked through a linear hierarchy, A---->B---->C----->D.

Thanks,
Bo

Code: Select all

void CreateNetwork(void) {
		DSL_network LIN_4T;
		int x1 = LIN_4T.AddNode(DSL_CPT, "x1");
		int x2 = LIN_4T.AddNode(DSL_CPT, "x2");
		int x3 = LIN_4T.AddNode(DSL_CPT, "x3");
		int x4 = LIN_4T.AddNode(DSL_CPT, "x4");
		int x5 = LIN_4T.AddNode(DSL_CPT, "x5");
		int x6 = LIN_4T.AddNode(DSL_CPT, "x6");
		int x7 = LIN_4T.AddNode(DSL_CPT, "x7");
		int x8 = LIN_4T.AddNode(DSL_CPT, "x8");
		int x9 = LIN_4T.AddNode(DSL_CPT, "x9");
		int x10 = LIN_4T.AddNode(DSL_CPT, "x10");
		int x11 = LIN_4T.AddNode(DSL_CPT, "x11");
		int x12 = LIN_4T.AddNode(DSL_CPT, "x12");
		int x13 = LIN_4T.AddNode(DSL_CPT, "x13");
		int x14 = LIN_4T.AddNode(DSL_CPT, "x14");
		int x15 = LIN_4T.AddNode(DSL_CPT, "x15");
		int x16 = LIN_4T.AddNode(DSL_CPT, "x16");
		int x17 = LIN_4T.AddNode(DSL_CPT, "x17");
		int x18 = LIN_4T.AddNode(DSL_CPT, "x18");
		int x19 = LIN_4T.AddNode(DSL_CPT, "x19");
		int x20 = LIN_4T.AddNode(DSL_CPT, "x20");
		int x21 = LIN_4T.AddNode(DSL_CPT, "x21");
		int x22 = LIN_4T.AddNode(DSL_CPT, "x22");
		int x23 = LIN_4T.AddNode(DSL_CPT, "x23");
		int x24 = LIN_4T.AddNode(DSL_CPT, "x24");
		int x25 = LIN_4T.AddNode(DSL_CPT, "x25");
		int x26 = LIN_4T.AddNode(DSL_CPT, "x26");
		int x27 = LIN_4T.AddNode(DSL_CPT, "x27");
		int x28 = LIN_4T.AddNode(DSL_CPT, "x28");
		int x29 = LIN_4T.AddNode(DSL_CPT, "x29");
		int x30 = LIN_4T.AddNode(DSL_CPT, "x30");

		int A = LIN_4T.AddNode(DSL_CPT, "A");
		int B = LIN_4T.AddNode(DSL_CPT, "B");
		int C = LIN_4T.AddNode(DSL_CPT, "C");
		int D = LIN_4T.AddNode(DSL_CPT, "D");

		LIN_4T.AddArc(A, x1);
		LIN_4T.AddArc(B, x2);
		LIN_4T.AddArc(C, x3);
		LIN_4T.AddArc(D, x4);
		LIN_4T.AddArc(A, x5);
		LIN_4T.AddArc(B, x5);
		LIN_4T.AddArc(A, x6);
		LIN_4T.AddArc(C, x6);
		LIN_4T.AddArc(A, x7);
		LIN_4T.AddArc(D, x7);
		LIN_4T.AddArc(B, x8);
		LIN_4T.AddArc(C, x8);
		LIN_4T.AddArc(B, x9);
		LIN_4T.AddArc(D, x9);
		LIN_4T.AddArc(C, x10);
		LIN_4T.AddArc(D, x10);
		LIN_4T.AddArc(A, x11);
		LIN_4T.AddArc(B, x12);
		LIN_4T.AddArc(C, x13);
		LIN_4T.AddArc(D, x14);
		LIN_4T.AddArc(A, x15);
		LIN_4T.AddArc(B, x15);
		LIN_4T.AddArc(A, x16);
		LIN_4T.AddArc(C, x16);
		LIN_4T.AddArc(A, x17);
		LIN_4T.AddArc(D, x17);
		LIN_4T.AddArc(B, x18);
		LIN_4T.AddArc(C, x18);
		LIN_4T.AddArc(B, x19);
		LIN_4T.AddArc(D, x19);
		LIN_4T.AddArc(C, x20);
		LIN_4T.AddArc(D, x20);
		LIN_4T.AddArc(A, x21);
		LIN_4T.AddArc(B, x22);
		LIN_4T.AddArc(C, x23);
		LIN_4T.AddArc(D, x24);
		LIN_4T.AddArc(A, x25);
		LIN_4T.AddArc(B, x25);
		LIN_4T.AddArc(A, x26);
		LIN_4T.AddArc(C, x26);
		LIN_4T.AddArc(A, x27);
		LIN_4T.AddArc(D, x27);
		LIN_4T.AddArc(B, x28);
		LIN_4T.AddArc(C, x28);
		LIN_4T.AddArc(B, x29);
		LIN_4T.AddArc(D, x29);
		LIN_4T.AddArc(C, x30);
		LIN_4T.AddArc(D, x30);

		LIN_4T.AddArc(B, A);
		LIN_4T.AddArc(C, B);
		LIN_4T.AddArc(D, C);

		LIN_4T.WriteFile("LIN_4T.xdsl");
	}
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: More questions about Conditional Probabilities in Parameter Learning

Post by shooltz[BayesFusion] »

Four latent nodes are linked through a linear hierarchy, A---->B---->C----->D.
Your code creates the hierarchy in the reverse direction; D->C->B->A. Here's the line which connects the parent B with child A.

Code: Select all

LIN_4T.AddArc(B, A);
Post Reply