qfun: qfun

Description Usage Arguments Value Examples

Description

qfun is the Q function in E-step (with negative sign).

Usage

1
qfun(pars, X, E, L, H)

Arguments

pars

a vector of length 45. c(alpha, beta, trans)

X

a list of vectors of observed states x

E

a vector of normalizing constant for each observed chain in X

L

a list of matrix L from computeL

H

a list of matrix H from computeH

Value

A scalar, the (negative) value of the target function that would later be minimized.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
df <- uORF
X <- L <- H <- list()
E <- c()
for (i in 1:2){
  X[[i]] <- df[[i]]$x
  RNA <- df[[i]]$RNA
  E[i]=df[[i]]$E;   trans=df[[i]]$trans;
  a=df[[i]]$v;      b=df[[i]]$v/df[[i]]$m
  la <- forwardAlg(X[[i]], RNA, trans, a, b, E[i])
  lb <- backwardAlg(X[[i]], RNA, trans, a, b, E[i])
  L[[i]] <- computeL(la, lb)
  H[[i]] <- computeH(X[[i]], RNA, trans, a, b, E[i], la, lb)
}
pars <- c(df[[1]]$v, df[[1]]$v/df[[1]]$m, df[[1]]$trans)

qfun(pars,X,E,L,H)

shimlab/riboHMM2 documentation built on May 19, 2019, 6:23 p.m.