Dear Marco,
I think the routine you want is
spm_dcm_post_hoc. I have included the help on this routine below (and the short descriptions of the various post-hoc optimization routines in the appendix of NeuroImage 56 (2011) 2089–2099). I am very sorry but I cannot remember where spm_dcm_diagnose
came from - I suspect it was a forerunner of spm_dcm_post_hoc.
I hope this helps,
With very best wishes,
Karl
function DCM = spm_dcm_post_hoc(P,fun)
% Post hoc optimisation of DCMs (under the Laplace approximation)
% FORMAT DCM = spm_dcm_post_hoc(P,[fun])
%
% P - character/cell array of DCM filenames
% - or cell array of DCM structures
%
% fun - optional family definition function: k = fun(A,B,C,D)
% k = 1,2,...,K for K families or proper subsets of a partition
% of model space - a function of the adjacency matrices: e.g.,
%
% fun = inline('any(spm_vec(B(:,:,2))) + 1','A','B','C','D')
%
% returns 1 if there are no bilinear parameters for the 2nd
% bilinear effect and 2 if there are. fun should be an inline
% function or script. NB: Model posteriors over families with
% and without free parameters (in A,B,C and D) are evaluated
% automatically and saved in DCM_BPA (DCM.Pp)
%
%--------------------------------------------------------------------------
% This routine searches over all possible reduced models of a full model
% (DCM) and uses post hoc model selection to select the best. Reduced
% models mean all permutations of free parameters (parameters with a non-
% zero prior covariance), where models are defined in terms of their prior
% covariance. The full model should be inverted prior to post hoc
% optimization. If there are more than 16 free-parameters, this routine
% will implement a greedy search: This entails searching over all
% permutations of the 8 parameters whose removal (shrinking the prior
% variance to zero) produces the smallest reduction (greatest increase)
% in model evidence. This procedure is repeated until all 8 parameters
% are retained in the best model or there are no more parameters to
% consider. When several DCMs are optimized together (as in group studies),
% they are checked to ensure the same free parameters have been specified
% and the log-evidences are pooled in a fixed effects fashion.
%
% This application of post hoc optimization assumes the DCMs that are
% optimized are the same model of different data. Normally, this would be
% a full model, in the sense of having the maximum number of free
% parameters, such that the set of reduced models is as large as possible.
% In contrast spm_dcm_search operates on different DCMs of the same data
% to identify the best model, after inverting the full(est) model
%
% The outputs of this routine are graphics reporting the model reduction
% (optimisation) and a DCM_opt_??? for every specified DCM that contains
% reduced conditional parameters estimates (for simplicity, the original
% kernels and predicted states are retained). The structural and functional
% (spectral embedding) graphs are based on Bayesian parameter averages
% over multiple DCMs, which are stored in DCM_BPA.mat. This DCM also
% contains the posterior probability of models partitioned according to
% whether a particular parameter exists or not:
%
% DCM.Pp - Model posterior over parameters (with and without)
% DCM.Ep - Bayesian parameter average under selected model
% DCM.Cp - Bayesian parameter covariance under selected model
% DCM.Pf - Model posteriors over user specified families
% DCM.fun - User-specified family definition function
% DCM.files - List of DCM files used for Bayesian averaging
%
%__________________________________________________________________________
% Copyright (C) 2010-2012 Wellcome Trust Centre for Neuroimaging
% Karl Friston
% $Id: spm_dcm_post_hoc.m 4807 2012-07-26 16:15:49Z guillaume $
spm_dcm_post_hoc: Post hoc optimization (under Laplace
approximation).
This routine searches over all possible reduced models of a full
model (DCM) and uses post hoc model selection to select the best.
Reduced models mean all permutations of free parameters (parameters
with a non-zero prior covariance), where models are defined in
terms of their prior covariance. The full model should be inverted
prior to post hoc optimization. If there are more than 16 free parameters,
this routine will implement a greedy search: This entails
searching over all permutations of the 8 parameters whose removal
(shrinking the prior variance to zero) produces the smallest reduction
(greatest increase) in model evidence. This procedure is repeated
until all 8 parameters are retained in the best model or there are no
more parameters to consider. When several DCMs are optimized
together (as in group studies), they are checked to ensure the same
free parameters have been specified and the log-evidences are pooled
in a fixed effects fashion. The outputs of this routine are graphics
reporting the model reduction (optimization) and an optimized DCM
(for every input DCM) that contains reduced conditional parameters
estimates.
This application of post hoc optimization assumes the DCMs that
are optimized are the same model of different data. Normally, this
would be a full model, in the sense of having the maximum number of
free parameters, such that the set of reduced models is as large as
possible. In contrast spm_dcm_search operates on different DCMs of
the same data to identify the best model:
spm_dcm_search: Post hoc selection (under Laplace approximation)
spm_dcm_search operates on different DCMs of the same data to
identify the best model. It will invert the full model, whose free parameters
are the union (superset) of all free parameters in each
model specified. The routine then uses post hoc selection to evaluate
the log-evidence (reduced free-energy) and conditional density
over free-parameters of each model specified. The DCM specified
does not need to be estimated: spm_dcm_search will invert the
requisite (full DCM) automatically. The outputs of this routine are
graphics reporting the model space search (optimization) and a
structure containing the fields:
DCM.P—character/cell array of DCM filenames
DCM.PF—their associated (reduced) free-energies
DCM.PP—and posterior (model) probabilities
In addition, the reduced free-energies and posterior estimates of
each model in DCM.P are saved for subsequent searches over different
partitions of model space.
spm_dcm_optimise: Optimizes the priors of a model (under Laplace
approximation)
This routine optimizes the prior covariance on the free parameters
of any model (DCM) under the Laplace approximation. In other words,
it assumes that the prior means are fixed and will maximize model
evidence with respect to the hyperparameters of a function that
returns the prior covariance. This optimization uses the reduced free energy,
based upon the posterior and prior densities of the full model
supplied. If the prior covariance function is not specified, this routine
will assume a simple diagonal form with a single hyperparameter. In
principle, this routine can be used in a flexible and powerful way to
emulate hierarchical modeling by using suitable prior covariance
functions with unknown hyperparameters. The outputs are the prior
moments (mean and covariance) of the optimum model.
Subject: DCM network discovery
Date: Tue, 18 Dec 2012 17:02:51 +0100
From: marco tettamanti <[log in to unmask]>
To: SPM (Statistical Parametric Mapping) <[log in to unmask]>
Dear Karl and DCM coders/users,
I would like to apply DCM network discovery to analyze some fMRI data.
I have been trying to understand whether the algorithms are already available
within SPM8 (respectively, within the alpha version SPM12_r4782 [[[and within
the newly released spm12b]]]).
Can you please confirm that the function spm_dcm_diagnose.m does the inversion
of a full connectivity model to select the best reduced model, as described in
your Neuroimage 2011 paper?
Could you please provide some basic information on how to use this script and
how to interpret its output?
E.g. what happens if I choose the A and C matrices within DCM.Ep as parameters
to be considered (provided this does make any sense):
>> spm_dcm_diagnose(DCM,'A','C')
How do I find out how the best reduced model looks like? Is this info stored
anywhere?
Thank you and very best wishes,
Marco
--
Marco Tettamanti, Ph.D.
Nuclear Medicine Department & Division of Neuroscience
San Raffaele Scientific Institute
Via Olgettina 58
I-20132 Milano, Italy
Tel. ++39-02-26434888
Fax ++39-02-26434892
Email: [log in to unmask]
Skype: mtettamanti