R/pn2pw.R

Defines functions pn2pw

Documented in pn2pw

pn2pw = function(N,probs,gamma,delta,stationary){
  tprobs = c()
  for(i in 1:N){
    tprobs = c(tprobs,log(probs[-1,i]/probs[1,i]))
  }
  foo = log(gamma/diag(gamma))
  tgamma = as.vector(foo[!diag(N)])
  if(stationary){
    tdelta = NULL
  }else{
    tdelta = log(delta[-1]/delta[1])
  }
  parvect = c(tprobs,tgamma,tdelta)
  return(parvect)
}

Try the countHMM package in your browser

Any scripts or data that you put into this service are public.

countHMM documentation built on May 2, 2019, 1:06 p.m.