projects
/
morpheus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify data sampling + cosmetics + draft unit test for W matrix in optim
[morpheus.git]
/
pkg
/
R
/
computeMu.R
diff --git
a/pkg/R/computeMu.R
b/pkg/R/computeMu.R
index
f7f82ad
..
ea931d2
100644
(file)
--- a/
pkg/R/computeMu.R
+++ b/
pkg/R/computeMu.R
@@
-66,9
+66,8
@@
computeMu = function(X, Y, optargs=list())
jd_method = ifelse(!is.null(optargs$jd_method), optargs$jd_method, "uwedge")
V =
if (jd_nvects > 1) {
jd_method = ifelse(!is.null(optargs$jd_method), optargs$jd_method, "uwedge")
V =
if (jd_nvects > 1) {
- #NOTE: increasing itermax does not help to converge, thus we suppress warnings
+ #
NOTE: increasing itermax does not help to converge, thus we suppress warnings
suppressWarnings({jd = jointDiag::ajd(M2_t, method=jd_method)})
suppressWarnings({jd = jointDiag::ajd(M2_t, method=jd_method)})
-# if (jd_method=="uwedge") jd$B else solve(jd$A)
if (jd_method=="uwedge") jd$B else MASS::ginv(jd$A)
}
else
if (jd_method=="uwedge") jd$B else MASS::ginv(jd$A)
}
else
@@
-79,7
+78,6
@@
computeMu = function(X, Y, optargs=list())
for (i in seq_len(K))
M2_t[,,i] = .T_I_I_w(M[[3]],V[,i])
suppressWarnings({jd = jointDiag::ajd(M2_t, method=jd_method)})
for (i in seq_len(K))
M2_t[,,i] = .T_I_I_w(M[[3]],V[,i])
suppressWarnings({jd = jointDiag::ajd(M2_t, method=jd_method)})
-# U = if (jd_method=="uwedge") solve(jd$B) else jd$A
U = if (jd_method=="uwedge") MASS::ginv(jd$B) else jd$A
μ = normalize(U[,1:K])
U = if (jd_method=="uwedge") MASS::ginv(jd$B) else jd$A
μ = normalize(U[,1:K])