AIC_Mk: AIC (Markov model)

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/AIC_Mk.R

Description

AIC

Usage

1
AIC_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 Markov model

Details

AIC(M) = -2*log{L} + 2*M, where L is the log-likelihood, M is the number of parameters of the model.

Value

AIC

List: value of AIC for each sequence

Author(s)

Vlad Stefan Barbu, barbu@univ-rouen.fr
Caroline Berard, caroline.berard@univ-rouen.fr
Dominique Cellier, dominique.cellier@laposte.net
Mathilde Sautreuil, mathilde.sautreuil@etu.univ-rouen.fr
Nicolas Vergne, nicolas.vergne@univ-rouen.fr

See Also

simulSM, estimMk, simulMk, estimSM, LoglikelihoodSM, LoglikelihoodMk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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 AIC
#################################
AIC_Mk(seq = seq2, E = alphabet, mu = rep(1/4,4), Ptrans = Pij, k = 1)

#[[1]]
#[1] 60.20263
#
#[[2]]
#[1] 115.7674

Example output

Loading required package: seqinr
Loading required package: DiscreteWeibull
Loading required package: Rsolnp
[[1]]
[1] 54.69786

[[2]]
[1] 114.0324

SMM documentation built on Jan. 31, 2020, 5:07 p.m.