mt.hmm<-function(lfdr, q) { ## USAGE # mt.hmm(lfdr, q) ## ARGUMENTS # lfdr: local false discovery rate sequence # q: the FDR level ## DETAILS # mt1.hmm gives a multiple testing rule in a hidden markov model # --that controls the FDR at level q, based on sequence of lfdr ## VALUES # nr: the number of rejected hypotheses # th: the threshold # re: the rejected hypotheses # ac: the accepted hypotheses # de: the decision rule m=length(lfdr) st.lfdr<-sort(lfdr) hps<-rep(0, m) if (min(lfdr)>q) { k<-0 threshold<-1 reject<-NULL accept<-1:m } else { k=1 while(kthreshold) hps[reject]<-1 } y<-list(nr=k, th=threshold, re=reject, ac=accept, de=hps) return (y) }