nlmefit compound symmetry covariance pattern?
2 次查看(过去 30 天)
显示 更早的评论
Hi, I am using nlmefit to fit a model of a "repeated measures" kind. The function provides very powerful control over the covariance matrix, but I could not find how to set compound symmetry. I have four measures, indicated in the design matrix as separate columns:
X = [ measure==1 measure==2 measure==3 measure==4 ]
I would like the form
[ x y y y
y x y y
y y x y
y y y x ]
Such that there is a fixed correlation between the four measures. But if I use
'covpattern', eye(4)+1
It doesn't constrain the `y` variances to be constant. When I examine `psi`, they are all free/estimated.
0 个评论
回答(1 个)
the cyclist
2016-2-15
My understanding of the "CovPattern" input is that zero/nonzero entries merely indicate which terms can have covariance with each. For example, one of the documentation examples is
P =
1 1 0
1 1 0
0 0 1
nlmefit(...,'CovPattern',P)
and the output covariance is
PSI =
0.5180 0.1069 0
0.1069 0.0221 0
0 0 0.0454
In your case, you put all nonzero entries -- the magnitudes are irrelevant, I think -- and you got covariance entries for all terms.
I don't know of a way to specify the covariance structure you want.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!