Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a spatial covariance structure implementing patient level random effects induced covariance #480

Open
danielinteractive opened this issue Nov 9, 2024 · 0 comments
Labels
enhancement New feature or request SP8

Comments

@danielinteractive
Copy link
Collaborator

As a step towards supporting random effects in this package, the first simplest step could be to support a spatial covariance structure which provides a patient level random effects induced covariance structure.

The syntax could be sp_ref(cov1, cov2, ... | group / subject) where cov1 is the first covariate to use (potentially a factor which leads to multiple design matrix columns), etc.

This will be possible because we can marginalize over the random coefficients in closed form, such that the induced covariance matrix for the $i$th patient is a quadratic form like $Z_i \Sigma_r Z_i^\top + \sigma^2 I$ when the residuals are homoskedastic with variance $\sigma^2$ and $Z_i$ is the design matrix induced by the specified covariates and $\Sigma_r$ is the covariance matrix of the random coefficients. Here $\sigma^2$ and $\Sigma_r$ can be estimated as variance parameters from the data. For the beginning we could just assume an unstructured covariance model for $\Sigma_r$

As long as we only have subject level random effects, then the overall covariance matrix is still blockdiagonal with these entries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request SP8
Projects
Status: Issue To start
Development

No branches or pull requests

1 participant