Skip to content

Commit

Permalink
revert to Lawson and Hanson NNLS solver instead of RcppML
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDMorgan committed Sep 11, 2024
1 parent 58d5661 commit 51bccaa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/paramEst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ arma::vec estHasemanElstonConstrained(const arma::mat& Z, const arma::mat& PREML
arma::vec _he_update(c+1);

// use RcppML NNLS (needs casting Eigen <-> arma)
_he_update = solveQP(vecZ, Ybig, _he_update);
// _he_update = solveQP(vecZ, Ybig, _he_update);
_he_update = nnlsSolve(vecZ, Ybig, _he_update, Iters);

return _he_update;
}
Expand Down Expand Up @@ -388,7 +389,8 @@ arma::vec estHasemanElstonConstrainedML(const arma::mat& Z, const Rcpp::List& u_

// solve by linear least squares
arma::vec _he_update(c+1);
_he_update = solveQP(vecZ, Ybig, _he_update);
// _he_update = solveQP(vecZ, Ybig, _he_update);
_he_update = nnlsSolve(vecZ, Ybig, _he_update, Iters);

return _he_update;
}
Expand Down Expand Up @@ -421,7 +423,8 @@ arma::vec estHasemanElstonConstrainedGenetic(const arma::mat& Z, const arma::mat
arma::mat vecZ = vectoriseZGenetic(Z, u_indices, PREML, PZ, Kin); // projection already applied

arma::vec _he_update(c+1);
_he_update = solveQP(vecZ, Ybig, _he_update);
// _he_update = solveQP(vecZ, Ybig, _he_update);
_he_update = nnlsSolve(vecZ, Ybig, _he_update, Iters);

return _he_update;
}
Expand Down Expand Up @@ -451,7 +454,8 @@ arma::vec estHasemanElstonConstrainedGeneticML(const arma::mat& Z,
arma::mat vecZ = vectoriseZGeneticML(Z, u_indices, Kin); // projection already applied

arma::vec _he_update(c+1);
_he_update = solveQP(vecZ, Ybig, _he_update);
// _he_update = solveQP(vecZ, Ybig, _he_update);
_he_update = nnlsSolve(vecZ, Ybig, _he_update, Iters);

return _he_update;
}
Expand Down
2 changes: 1 addition & 1 deletion vignettes/milo_glmm.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ set.seed(42)
rownames(pbmc.design) <- pbmc.design$ObsID
da_results <- testNhoods(pbmc.milo, design = ~ adjmfc.time + (1|tenx_lane), design.df = pbmc.design, fdr.weighting="graph-overlap",
glmm.solver="Fisher", REML=TRUE, norm.method="TMM", BPPARAM = bpparam, fail.on.error=FALSE, intercept.type="fixed")
glmm.solver="Fisher", REML=TRUE, norm.method="TMM", BPPARAM = bpparam, fail.on.error=FALSE)
table(da_results$SpatialFDR < 0.1)
```

Expand Down

0 comments on commit 51bccaa

Please sign in to comment.