projects
/
morpheus.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix accuracy.R + add postTreatment draft
[morpheus.git]
/
reports
/
accuracy.R
diff --git
a/reports/accuracy.R
b/reports/accuracy.R
index
9a9d21d
..
63cd5aa
100644
(file)
--- a/
reports/accuracy.R
+++ b/
reports/accuracy.R
@@
-27,9
+27,9
@@
optimBeta <- function(N, n, p, beta, b, link, ncores)
dat <- as.data.frame( cbind(fargs$Y,fargs$X) )
res2 <- NULL
tryCatch({
dat <- as.data.frame( cbind(fargs$Y,fargs$X) )
res2 <- NULL
tryCatch({
- fm <- flexmix( cbind(V1, 1-V1) ~ .
-V1
, data=dat, k=K,
+ fm <- flexmix( cbind(V1, 1-V1) ~ ., data=dat, k=K,
model = FLXMRglm(family = binomial(link = link)) )
model = FLXMRglm(family = binomial(link = link)) )
- pf <-
mean(fm@posterior[["scaled"]][,1
])
+ pf <-
colMeans(fm@posterior[["scaled"]
])
out <- refit(fm)
beta_b <- sapply( seq_len(K), function(i) {
as.double( out@components[[1]][[i]][,1] )
out <- refit(fm)
beta_b <- sapply( seq_len(K), function(i) {
as.double( out@components[[1]][[i]][,1] )