Dear Atesh,
I hope you don’t mind me CC’ing the SPM mailing list so that other can benefit. You emailed regarding your family definition for post-hoc DCM. You were surprised that whichever family you had first in your if…elseif statement in your family definition function, your models would get assigned to the first family.
The role of the family function is to map each individual candidate model to a single family. The free energies of the models in each family are then pooled to allow families of models to be compared. I think your confusion is a simple matter regarding the use of “if” and “elseif” statements. When the first statement in your family function is:
if B_matrix(regionC,regionA,input_index) ~= 0
family = 1;
Your best models are being assigned to family 1, and no other family, because your best models have the A->C connection. If you change this to:
if B_matrix(regionD,regionA,input_index) ~= 0
family = 1;
I expect that some or all of the same best models as before are getting assigned to the new family 1, because these models have both the A->C connection and the A->D connection.
Let me give you another example of where this will happen. See lines 76-79 in your family function:
elseif B_matrix(regionB,regionE,input_index) ~= 0
family = 8;
elseif (B_matrix(regionB,regionE,input_index) && B_matrix(regionB,regionE,input_index)) ~= 0
family = 9;
The second elseif statement can never be executed, because if B_matrix(regionB,regionE,input_index) ~= 0 is true, then the assigned family will be 8, and Matlab will never reach the next line of code. This is the definition of “elseif”.
So, you need to think about how you can define families such that every model is only assigned to one family.
Please direct any further queries to the SPM mailing list, where one of my colleagues or I will reply.
Hope that helps,
Peter
From: atesh koul [mailto:[log in to unmask]]
Sent: 09 March 2015 13:26
To: Zeidman, Peter
Subject: Re: DCM post-hoc family inferences
Dear Dr. Peter Zeidman,
Thank you for your email. The concern that you have mentioned is correct.
The problem is actually the same. However, since the data is from a lesser number of participants, the winning modulatory connection is different. So, in the same data that I have sent you, if a modulatory connection from region A to B is tested first (as in the attached which_family2.m file), the user defined family is selected to be family 1. Alternatively, if a modulatory connection from region A to C is checked first, the result is again family 1 (basically all the connections that have DCM.Pp.B value >0) .Thanks again,
Best regards,
Atesh