JiscMail Logo
Email discussion lists for the UK Education and Research communities

Help for SPM Archives


SPM Archives

SPM Archives


SPM@JISCMAIL.AC.UK


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

SPM Home

SPM Home

SPM  March 2015

SPM March 2015

Options

Subscribe or Unsubscribe

Subscribe or Unsubscribe

Log In

Log In

Get Password

Get Password

Subject:

Re: Bayesian 2nd level

From:

Guillaume Flandin <[log in to unmask]>

Reply-To:

Guillaume Flandin <[log in to unmask]>

Date:

Tue, 17 Mar 2015 12:08:15 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (221 lines)

Hi Rodolphe and Glad,

the error you observed has been fixed in SPM12 (it was one of the first
bugs that surfaced after the release) and will be available in the next
set of updates. In the meantime, you can simply edit spm_getSPM.m such
that l.548 reads:

Gamma = full(sqrt(xCon(Ic).c'*SPM.PPM.Cb*xCon(Ic).c));

Best regards,
Guillaume.


On 17/03/15 08:49, Paul Glad Mihai wrote:
> Hi Rodolphe,
> 
> You can of course do a classical first level analysis and use Bayes at
> the second level. However, I would try to estimate the model on the
> first level using Bayesian inference, since there are more advantages,
> one of which is the spatial prior. The "smoothing" is then automatic and
> based on the activation. Unfortunately it will take a very long time.
> 
> 1) I have not used spm12 yet. Did you first do a classical estimation
> and then a Bayesian estimation? I assume you did, otherwise you wouldn't
> have had the Bayesian option. Apparently the sprintf function doesn't
> allow sparse matrices (most of its elements are zero). It would need to
> be a full matrix. If you go to line 549 you will see this just above it:
> % If Bayesian then get effect size threshold (Gamma) stored in xCon(Ic).eidf
> % The default is one conditional s.d. of the contrast
> 
> How did you define the contrast?
> 
> 2) The default effect size threshold should be one conditional standard
> deviation of the contrast. It's computed on line 548
>  Gamma         = sqrt(xCon(Ic).c'*SPM.PPM.Cb*xCon(Ic).c);
> 
> You cold also choose something else as the threshold.
> 
> Regards,
> Glad
> 
> 
> On 16.03.2015 21:32, Rodolphe Nenert wrote:
>> Dear Glad and Bayesian lovers, 
>>
>> I had a few questions regarding Bayesian 2nd level inference.
>> As suggested, I first did my group level analysis using classical method
>> of estimation, then the bayesian 2nd level.
>>
>> 1) When i specify my contrast then click on bayesian option I got this
>> error: 
>>
>> SPM12: spm_results_ui (v6200)                      15:20:19 - 16/03/2015
>> ========================================================================
>> Error using sprintf
>> Function is not defined for sparse inputs.
>>
>> Error in spm_getSPM (line 549)
>>                 xCon(Ic).eidf =
>> spm_input(str,'+1','e',sprintf('%0.2f',Gamma));
>>
>> Error in spm_results_ui (line 261)
>>         [SPM,xSPM] = spm_getSPM;
>>  
>> Error while evaluating UIControl Callback
>>
>> 2)  In the SPM12 manual, 1st level bayesian “threshold” is found using
>> this formula : sf = max(SPM.xBF.bf <http://SPM.xBF.bf>(:,1))/SPM.xBF.dt
>> since xBF field doesn’t exist in 2nd level analysis, how is it done?
>>
>> Any help would be greatly appreciated. thanks a lot, 
>>
>> Rodolphe.
>>
>>
>>> On Mar 9, 2015, at 8:30 AM, Paul Glad Mihai
>>> <[log in to unmask]
>>> <mailto:[log in to unmask]>> wrote:
>>>
>>> Hi Anders,
>>>
>>> that's right, if you only have a contrast for the first regressor, then
>>> you can just use the Cbeta_0001.img.
>>>
>>> There is no spatial prior for the 2nd level, as I understand it. I'll
>>> just paste here what Will Penny wrote some time ago:
>>>
>>> "Briefly,
>>> 2nd level PPMs use a prior over the regression coefficients, beta, with
>>> zero mean and (co)variance Cb. The quantity SPM.PPM.Cb is an empirical
>>> estimate of Cb. The rest of the formula computes how much of this
>>> variance projects onto the contrast you are testing."
>>> https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=SPM;41144d5.1403
>>>
>>> "The procedure here is to Specify a 2nd level model - t-tests, ANOVA etc
>>> - then estimate it with the Classical option
>>> (you can also play with some contrasts here).  Then estimate the model
>>> again using the Bayesian 2nd level option and you can create parameter
>>> inference and model comparison maps [1] by specifying contrasts in the
>>> usual way.
>>> Its perfectly valid to compare parameters to a threshold of zero."
>>> https://www.jiscmail.ac.uk/cgi-bin/webadmin?A2=SPM;5f9a54e5.1405
>>>
>>> I hope this helps.
>>>
>>> Regards,
>>> Glad
>>>
>>> On 09.03.2015 13:46, Anders Eklund wrote:
>>>> Dear Glad,
>>>>
>>>> since I'm interested only in the first regressor, I assume that a
>>>> contrast of [1 0 0 0 0 0 0 0] will give a file con_0001.img that is
>>>> identical to Cbeta_0001.img ?
>>>>
>>>> No I did not smooth the fMRI data, since SPM uses a spatial prior. I,
>>>> however, assumed that a spatial prior was also used for the group
>>>> analysis, and that the posterior variance was also included.
>>>>
>>>> - Anders
>>>>
>>>>
>>>> 2015-03-09 10:08 GMT+01:00 Paul Glad Mihai
>>>> <[log in to unmask]
>>>> <mailto:[log in to unmask]>
>>>> <mailto:[log in to unmask]>>:
>>>>
>>>>    Dear Anders,
>>>>
>>>>    Why don't you calculate the contrasts on the 1st level? You will then
>>>>    get an idea of what the activation looks like. I hope you didn't
>>>> smooth
>>>>    your EPIs prior to the 1st level Bayesian analysis.
>>>>
>>>>    After you have your 1st level contrasts you will have to smooth
>>>> them in
>>>>    order to increase the chance of overlap between subjects. The
>>>> smoothing
>>>>    factor depends on what you want to look at. Here's a paper about
>>>>    smoothing:
>>>>
>>>>    Ball, T., Breckel, T. P. K., Mutschler, I., Aertsen, A.,
>>>>    Schulze-Bonhage, A., Hennig, J., & Speck, O. (2011). Variability of
>>>>    fMRI-response patterns at different spatial observation scales. Human
>>>>    Brain Mapping, 1171(January 2011), 1155–1171. doi:10.1002/hbm.21274
>>>>
>>>>    At the 2nd level you will take the smoothed con images, do a classical
>>>>    estimation and then do a Bayesian estimation. I usually use the batch
>>>>    editor and estimate on the prior dependency for the classical way,
>>>> then
>>>>    create another dependency from the classical to do the Bayesian
>>>>    estimation. The standard deviation from each subject is not used
>>>> in the
>>>>    2nd level analysis, since you only plug in the contrasts.
>>>>
>>>>    I hope this helps.
>>>>
>>>>    Regards,
>>>>    Glad
>>>>
>>>>    On 08.03.2015 10:54, Anders Eklund wrote:
>>>>> Dear SPM users,
>>>>>
>>>>> I'm trying to do a Bayesian group analysis in SPM8. I have looked
>>>>    at the
>>>>> SPM8 manual but it is still a bit unclear to me.
>>>>>
>>>>> I have gone through each subject with a Bayesian first level analysis,
>>>>> so I have Cbeta_* and SD_beta* for all regressors. I would like to
>>>>> obtain a group level PPM of the first beta weight being larger
>>>>    than 0. I
>>>>> used "Specify 2nd-level" and selected the Cbeta_0001.img for each
>>>>> subject. I then first do a classical estimation (which seems to be
>>>>> required prior to a 2nd level Bayesian estimation) and then do the
>>>>> Bayesian 2nd-level estimation. Does this procedure seem correct?
>>>>>
>>>>> If the procedure is correct, is the standard deviation from each
>>>>> subject, i.e. SDbeta_0001.img, used in the group analysis, or is only
>>>>> the posterior mean of each subject used?
>>>>>
>>>>> Regards,
>>>>> Anders
>>>>>
>>>>>
>>>>
>>>>    --
>>>>    P. Glad MIHAI, M.Sc. Biomedical Physics
>>>>    Functional Imaging | University Clinic Greifswald
>>>>    Walther-Rathenau-Straße 46 | 17475 Greifswald | Germany
>>>>    Tel: +49 3834 86 69 44 <tel:%2B49%203834%2086%2069%2044>
>>>> <tel:%2B49%203834%2086%2069%2044> | Fax: +49
>>>>    3834 86 68 98 <tel:%2B49%203834%2086%2068%2098>
>>>>    www.baltic-imaging-center.de
>>>> <http://www.baltic-imaging-center.de/> <http://www.baltic-imaging-center.de
>>>> <http://www.baltic-imaging-center.de/>>
>>>>
>>>>
>>>>
>>>>
>>>> -- 
>>>> Anders Eklund, PhD
>>>>
>>>>
>>>
>>> -- 
>>> P. Glad MIHAI, M.Sc. Biomedical Physics
>>> Functional Imaging | University Clinic Greifswald
>>> Walther-Rathenau-Straße 46 | 17475 Greifswald | Germany
>>> Tel: +49 3834 86 69 44 <tel:%2B49%203834%2086%2069%2044> | Fax: +49
>>> 3834 86 68 98 <tel:%2B49%203834%2086%2068%2098>
>>> www.baltic-imaging-center.de <http://www.baltic-imaging-center.de/>
>>
> 

-- 
Guillaume Flandin, PhD
Wellcome Trust Centre for Neuroimaging
University College London
12 Queen Square
London WC1N 3BG

Top of Message | Previous Page | Permalink

JiscMail Tools


RSS Feeds and Sharing


Advanced Options


Archives

April 2024
March 2024
February 2024
January 2024
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
2006
2005
2004
2003
2002
2001
2000
1999
1998


JiscMail is a Jisc service.

View our service policies at https://www.jiscmail.ac.uk/policyandsecurity/ and Jisc's privacy policy at https://www.jisc.ac.uk/website/privacy-notice

For help and support help@jisc.ac.uk

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager