Description Usage Arguments Details Value Author(s) References Examples
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.
1 | normal.HMM.likelihood.NH.C(y, x, mu, sigma.2, beta, stat = NULL)
|
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. |
This function is just an interface for the C routine to compute log-likelihood in RJaCGH model.
It returns a list with the same components passed plus:
loglik |
Log-likelihood |
Oscar M. Rueda and Ramon Diaz-Uriarte
Rueda OM, Diaz-Uriarte R. Flexible and Accurate Detection of Genomic Copy-Number Changes from aCGH. PLoS Comput Biol. 2007;3(6):e122
1 2 3 4 5 6 7 8 9 10 11 12 13 | ## 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
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.