Print

Print


Dear Guillaume,

I ran the spm_reml.m with a very simple example but it gave me an error message saying

Error in ==> spm_reml at 101
            h     = h - dh;

after ReML iteration 3. I generated one voxel time series of length 600 which is called Y assuming periodic stimuli. I simply ran

[V,h] = spm_reml(Cy, xX.X, xVi.Vi);

as similar to that in spm_spm.m, where Cy is the sample covariance matrix (i.e., Y*Y'), xX.X is the convolution between stimulus-canonical hrf, and xVi.Vi was obtained using [xVi.Vi]=spm_Ce.m(v=600,a=1) (I assumed AR(1) error).

I followed the same logics as in spm_spm.m so I am confused why I am getting an error. I suspect that perhaps spm_Ce.m does not return h(1)*Q{1} + h(2)*Q{2} but something else and it might occur a problem during the execution of spm_reml.

Could you or anybody advise me at which part I got lost?
I truly appreciate your help on this! Thanks!

Best,
Hana


On Tue, Mar 15, 2011 at 7:42 AM, Guillaume Flandin <[log in to unmask]> wrote:
Dear Hana,

you will see that spm_reml.m is called in spm_spm.m in a way that D is 0
so the loop where those variables seem to be used before being defined
isn't actually used.
D would be different than 0 with the call at l.176 in spm_reml.m but in
this case the other test "if min(real(eig(full(C)))) < 0" could only be
true after the first iteration of the loop over K so the variables dh,
dFdhh, and dFdh will have then be defined (later in the loop over K).

I hope this helps,
Guillaume.


On 14/03/11 19:57, Hana Lee wrote:
> Dear SPMers,
>
> When I was playing around with the function spm_reml.m, which is
> relavant to ReML estimation of a GLM,  I found some parts that do
> not seem right to me.
> In the function spm_reml.m, variables dh, dFdhh, and dFdh are not
> defined before they are being used. I also looked through spm_spm.m
> since the spm_spm.m calls the spm_reml.m, but did not find those
> variables neither.
>
> Can someone please advise me how come this is possible? Any comments are
> truly appreciated!
>
> Thanks,
> Hana
>
> --
> Lee, Hana
> Biostatistics Ph.D student
> School of Public Health
> The University of North Carolina at Chapel Hill
> [log in to unmask] <mailto:[log in to unmask]>
>
> Brass bands are all very well in their place- outdoors and several miles
> away.
>
>


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



--
Lee, Hana
Biostatistics Ph.D student
School of Public Health
The University of North Carolina at Chapel Hill
[log in to unmask]

Brass bands are all very well in their place- outdoors and several miles away.