Open fboehm opened 4 years ago
qtl2 also has a C++ function for calculating RSS with a three-dimensional genoprobs array: https://github.com/rqtl/qtl2/blob/c915c04b9e3fa848202fe81ebcb91a2c254e62a6/src/linreg.cpp#L45
R/qtl2 already has C++ functions for multivariate Y: https://github.com/rqtl/qtl2/blob/68883790388f996639f81b1bb2b7c244f5492164/src/linreg_eigen.cpp#L421
I would still need to get RSS for a generalized least squares-type problem... or, I can first rotate the X matrix and Y matrix by the matrix sqrt of the inverse Sigma. I would then need to input the appropriately rotated X and Y into a function like that for multivariate regression (linked in previous comment)
Draw on C++ functions that rqtl/qtl2 uses. Also, for one-QTL, multivariate scan, use Eigen package functions: https://eigen.tuxfamily.org/dox/unsupported/group__KroneckerProduct__Module.html
Note that we need to structure d-variate, d-QTL scan differently because design matrix can't easily be written as a kronecker product of two matrices. However, for d-variate, one-QTL scan, we can write X matrix I_d \otimes genoprobs