Skip to content

Commit

Permalink
uweights up
Browse files Browse the repository at this point in the history
  • Loading branch information
tedenamorado committed Apr 19, 2020
1 parent b852455 commit de52555
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions R/emlinkMARmov.R
Original file line number Diff line number Diff line change
Expand Up @@ -312,11 +312,11 @@ emlinkMARmov <- function(patterns, nobs.a, nobs.b,
}
}

weights <- log(p.gamma.j.m) - log(p.gamma.j.u)

p.gamma.j.m <- p.gamma.j.m/sum(p.gamma.j.m)
p.gamma.j.u <- p.gamma.j.u/sum(p.gamma.j.u)

weights <- log(p.gamma.j.m) - log(p.gamma.j.u)

data.w <- cbind(patterns, weights, p.gamma.j.m, p.gamma.j.u)
nc <- ncol(data.w)
colnames(data.w)[nc-2] <- "weights"
Expand Down Expand Up @@ -478,11 +478,12 @@ emlinkRS <- function(patterns.out, em.out, nobs.a, nobs.b){
log(p.u))
zeta.j <- exp(log.prod - log.sum)

weights <- log(p.gamma.j.m) - log(p.gamma.j.u)

## Renormalize
p.gamma.j.m <- p.gamma.j.m/sum(p.gamma.j.m)
p.gamma.j.u <- p.gamma.j.u/sum(p.gamma.j.u)

weights <- log(p.gamma.j.m) - log(p.gamma.j.u)
data.w <- cbind(patterns.out, weights, p.gamma.j.m, p.gamma.j.u)
nc <- ncol(data.w)
colnames(data.w)[nc - 3] <- "counts"
Expand Down

0 comments on commit de52555

Please sign in to comment.