negLogLike(exomeCopy)
negLogLike()所属R语言包:exomeCopy
Generalized negative log likelihood and Viterbi algorithms
广义的负对数似然和Viterbi算法
译者:生物统计家园网 机器人LoveR
描述----------Description----------
negLogLike: Returns the negative log likelihood calculated with the forward equations.
negLogLike:返回与向前方程计算的负面记录的可能性。
viterbiPath: Calculates the most likely sequence of hidden states for the Markov model given the current parameters.
viterbiPath:计算最可能的序列,鉴于当前的参数马尔可夫模型的隐藏状态。
用法----------Usage----------
negLogLike(par,fx.par,data,nstates,stFn,trFn,emFn)
viterbiPath(par,fx.par,data,nstates,stFn,trFn,emFn)
参数----------Arguments----------
参数:par
A list of parameters, over which the likelihood will be optimized.
一个参数列表,将优化的可能性。
参数:fx.par
A list of fixed parameters.
一个固定的参数列表。
参数:data
A list of data objects, which must contain a vector O, which represents the observed sequence of the HMM.
一个数据对象的名单,其中必须包含向量O,这代表了观测序列的HMM。
参数:nstates
The number of states of the HMM.
HMM的状态数。
参数:stFn
A function which takes arguments par, fx.par, data, and nstates, and returns a vector of length nstates of starting probabilities.
参数不相上下,fx.par,数据,nstates,函数返回一个长度nstates开始的概率向量。
参数:trFn
A function which takes arguments par, fx.par, data, and nstates, and returns a matrix of dimension (nstates,nstates) of the transition probabilities.
参数不相上下,fx.par,数据,nstates,函数返回过渡概率(nstates,nstates)的一维矩阵。
参数:emFn
A function which takes arguments par, fx.par, data, and nstates, and returns a matrix of dimension (nstates,length(O)) of the emission probabilities.
函数参数不相上下,fx.par,数据,nstates,并返回一维矩阵发射概率(nstates(海外),长度)。
值----------Value----------
negLogLike: The negative log likelihood of the HMM. The likelihood is slightly modified to account for ranges with read counts which have zero probability of originating from any of the states. In this case the likelihood is lowered and the range is skipped.
negLogLike:HMM的负面记录的可能性。帐户有任何国家的零概率与读计数的范围略作修改的可能性。在这种情况下,下调的可能性和范围将被跳过。
viterbiPath: The Viterbi path through the states given the parameters.
viterbiPath:通过给定的参数状态维特路径。
参考文献----------References----------
selected applications in speech recognition," Proceedings of the IEEE, 77, 257, 286, http://dx.doi.org/10.1109/5.18626.
举例----------Examples----------
## functions for starting, transition, and emission probabilities[#开始,过渡和发射概率]
stFn <- function(par,fx.par,data,nstates) rep(1/nstates,nstates)
trFn <- function(par,fx.par,data,nstates) {
A <- matrix(1/(nstates*10),ncol=nstates,nrow=nstates)
diag(A) <- 1 - rowSums(A)
A
}
emFn <- function(par,fx.par,data,nstates) {
t(sapply(1:nstates,function(j) dnorm(data$O,par$means[j],fx.par$sdev)))
}
## simulate some observations from two states[#模拟从两个国家的一些看法]
Q <- c(rep(1,100),rep(2,100),rep(1,100),rep(2,100))
T <- length(Q)
means <- c(-0.5,0.5)
sdev <- 1
O <- rnorm(T,means[Q],sdev)
## use viterbiPath() to recover the state chain using parameters[#使用viterbiPath的()使用参数恢复状态链]
viterbi.path <- viterbiPath(par=list(means=means),fx.par=list(sdev=sdev),data=list(O=O),nstates=2,stFn,trFn,emFn)
plot(O,pch=Q,col=c("darkgreen","orange")[viterbi.path])
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|