Learn R Programming

SMM (version 1.0.2)

BIC_Mk: BIC (Markov model)

Description

BIC

Usage

BIC_Mk(seq, E, mu, Ptrans, k)

Arguments

seq

List of sequence(s)

E

Vector of state space

mu

Vector of initial distribution

Ptrans

Matrix of transition probabilities

k

Order of the Markov chain

Value

BIC

List: value of BIC for each sequence

Details

\(BIC(M) = -2*log{L} + log(n)*M\), where L is the log-likelihood, M is the number of parameters of the model and n is the size of the sequence.

See Also

simulSM, estimMk, simulMk, estimSM, LoglikelihoodSM, LoglikelihoodMk, AIC_Mk

Examples

Run this code
# NOT RUN {
alphabet = c("a","c","g","t")
S = length(alphabet)
# creation of the transition matrix
Pij = matrix(c(0,0.2,0.3,0.5,0.4,0,0.2,0.4,0.1,0.2,0,0.7,0.8,0.1,0.1,0),
 nrow = S, ncol = S, byrow = TRUE)

#Pij
#     [,1] [,2] [,3] [,4]
#[1,]  0.0  0.2  0.3  0.5
#[2,]  0.4  0.0  0.2  0.4
#[3,]  0.1  0.2  0.0  0.7
#[4,]  0.8  0.1  0.1  0.0


## Simulation of two sequences of length 20 and 50 respectively
seq2 = simulMk(E = alphabet, nbSeq = 2, lengthSeq = c(20,50), 
Ptrans = Pij, init = rep(1/4,4), k = 1)
                
#################################
## Computation of BIC
#################################
BIC_Mk(seq = seq2, E = alphabet, mu = rep(1/4,4), Ptrans = Pij, k = 1)

#[[1]]
#[1] 78.39401
#
#[[2]]
#[1] 133.7015
# }

Run the code above in your browser using DataLab