ecoinformatic / SCRG

Materials broadly related to the SU2024 Statewide Coastal Restoration Guide (SCRG) project
0 stars 0 forks source link

Recompile R package `metafor` with alternative matrix solver #7

Open georgeomics opened 3 months ago

georgeomics commented 3 months ago

Because of the reqirements of the solve() matrix solver in the metafor package, and its inability to handle large padded variances well, we may need to replace the solver with an alternative. On potential solver is pd.solve() in the ctmm package. A description of this solver is below:

For ctmm::pd.solve(), the padded variances can be infinite, and there are many features beyond qr.solve() for positive-definite matrices. There is also ctmm::pd.logdet() if det() has trouble, but det() is slightly more robust than qr.solve().

We may need to recompile the metafor package to work with the ctmm::pd.solve() matrix solver. This will enable us to run matrix calculations for matrices generated from the betas (slopes) of our predictors within metafor. As of 06/27/2024, ctmm::pd.solve and ctmm::pd.logdet are exported functions available on GitHub.