normal.HMM.likelihood.NH.C {RJaCGH}R Documentation

Likelihood for non-homogeneous hidden Markov model

Description

This function returns the log-likelihood for RJaCGH model, a hidden Markov model with normal distributed emissions and a non-homogeneous transition matrix as computed by Q.NH.

Usage

normal.HMM.likelihood.NH.C(y, x, mu, sigma.2, beta, stat = NULL)

Arguments

y Log Ratios observed
x Vector of distances between genes
mu Vector of means for the hidden states
sigma.2 Vector of variances for the hidden states
beta beta in transition matrix
stat Vector of initial probabilities. If NULL, a uniforma distribution is assumed.

Details

This function is just an interface for the C routine to compute log-likelihood in RJaCGH model.

Value

It returns a list with the same components passed plus:

loglik Log-likelihood

Author(s)

Oscar M. Rueda and Ramon Diaz-Uriarte

References

Rueda OM, Diaz-Uriarte R. Flexible and Accurate Detection of Genomic Copy-Number Changes from aCGH. PLoS Comput Biol. 2007;3(6):e122

Examples


## create data
y <- c(rnorm(100, 0, 1), rnorm(50, 3, 1), rnorm(20, -3, 1),
rnorm(60, 0, 1))
x <- sample(1:1000, 229, replace=FALSE)
x <- x/max(x)
Chrom <- rep(1:23, rep(10, 23))
## same model for all genome
loglik <- 0
for (i in 1:23) {
loglik <- loglik + normal.HMM.likelihood.NH.C(y=y, x =x, mu=c(-3, 0, 3),
sigma.2=c(1,1,1), beta=matrix(c(0, 1, 1, 1, 0, 1, 1, 1, 0), 3))$loglik
}
loglik

[Package RJaCGH version 2.0.0 Index]