estimate: estimate

Description Usage Arguments Value Examples

Description

estimate would estimate the parameters and print the details of estimation.

Usage

1
estimate(X, RNA, E, init, tol = 0.001, detail = TRUE, ...)

Arguments

X

list of vectors of observed chain x.

RNA

list of 0-1 vectors. 1 if next 3-base is stop codon.

E

vector of normalizing constant for observed chain x.

init

list of initial parameters. 3 variables: v, m, trans.

tol

scalar of tolerance. Default is 0.001.

detail

logical; if TRUE, the details of estimation are printed.

...

user can put a list of control parameters that would be passed to optim(). E.g.: control=list(maxit=1e4, reltol=1e-9)

Value

A list containing:

Print the class: res

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
k <- 5  # number of transcripts from each group (see data ?uORF)
ii <- c()
for (i in 1:5){
  ii <- c(ii, ((i-1)*100+1):((i-1)*100+k))
}
print(ii)

df <- uORF[ii]
X <- RNA <- list(); E <- c()
for (i in 1:length(df)){
  X[[i]] <-  df[[i]]$x
  RNA[[i]] <- df[[i]]$RNA
  E[i] <- df[[i]]$E
}

init <- init_generate(df, cutoff=10, r=4)
res <- estimate(X, RNA, E, init, tol=0.001, detail=TRUE)
print(res)
print(df[[1]]$trans)

m <- df[[1]]$m; v <- df[[1]]$v
m_hat <- res$m_hat
v_hat <- res$v_hat

cbind(c(m[1:10],NA), c(m_hat[1:10],NA), c(m_hat[1:10],NA)-c(m[1:10],NA),
      m[11:21],      m_hat[11:21],      m_hat[11:21]-m[11:21])

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