How can I incorporate spatially correlated data into linear mixed effect model which is fitlmematrix method I am trying to use?
3 次查看(过去 30 天)
显示 更早的评论
lme = fitlmematrix(X,y,Z,G,'CovariancePattern','isotrophic','FitMethod','REML')
Here the covariance pattern is for random effect as much as I know. But I want to incorporate spatially correlated data into the model where my error variance would be ~N(0,R). Here R may b Gaussian Correlation function. The model fitlme assumed that error~N(0,sigma^2). So how can I incorporate Gaussian correlation function as error variance matrix here?
0 个评论
采纳的回答
Gautam Pendse
2018-2-6
Hi Mithun,
One way to approach this problem would be to use fitrgp but with a kernel function that combines Z and R. So if your model is y = X*beta + Z*b + epsilon, you could define Z*b + epsilon as a combined error term with covariance function Z*D*Z' + R which can be coded as a custom kernel function.
I am attaching an example that illustrates this using D = sigmaB^2*I and R as the squared exponential covariance.
Hope this helps,
Gautam
更多回答(1 个)
Bernhard Suhm
2018-1-26
The covariance matrix of the response in a linear mixed effects model has 2 components – a random effects component ( sigma^2)*sum_i{ Z_i*D_i*Z_i’} and an error component (sigma^2)*R, where D_i and R are typically block diagonal. These two components can compete in the sense that the same overall covariance can result from a complex random effects component + a simpler error component or a simpler random effects component + a complex error component. In fitlmematrix and fitlme, correlation between groups and observations is modelled by specifying Z_i and D_i whereas R is assumed to be the identity matrix. Depending on the structure of R, the same model could be obtained by selecting appropriate Z_i and D_i. Can you say more about the structure of R in the model? An alternative to modeling spatially correlated data would be to use Gaussian processes (see function fitrgp).
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Gaussian Process Regression 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!