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

Ensure model matrices are full-rank #99

Closed
wlandau opened this issue Apr 29, 2024 · 1 comment
Closed

Ensure model matrices are full-rank #99

wlandau opened this issue Apr 29, 2024 · 1 comment
Labels

Comments

@wlandau
Copy link
Collaborator

wlandau commented Apr 29, 2024

It is easy to create a rank-deficient model in R:

data(fev_data, package = "mmrm")
formula <- FEV1 ~ ARMCD:AVISIT + RACE
matrix <- model.matrix(object = formula, data = fev_data)
ncol(matrix)
#> [1] 11
as.integer(Matrix::rankMatrix(matrix))
#> [1] 10

As part of #96, I would like to add a new check_rank argument to brm_formula() which checks the rank if TRUE and throws an error for rank-deficient models. I think TRUE is a good default.

For the informative prior scenarios in #96, we can prevent most cases of rank deficiency by dropping nuisance columns until the model matrix is full-rank.

wlandau-lilly pushed a commit that referenced this issue Apr 29, 2024
@wlandau
Copy link
Collaborator Author

wlandau commented Apr 30, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant