Version 4.0.0
Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

Markov Class Reference

Markov modelling, estimation and simulation. More...

#include <seqpp/Markov.h>

Inheritance diagram for Markov:

PhasedMarkov MTDMarkov PMarkov VLMarkov List of all members.

Public Member Functions

 Markov (const char *ConfFile, bool calc_rank=false)
 Constructor 1 : read a configuration file.
 Markov (const SequenceSet &seqset, bool calc_rank=false)
 Constructor 2 : Estimate the transition matrices on the sequences of seqset.
 Markov (const Sequence &seq, bool calc_rank=false)
 Constructor 3 : Estimate the transition matrices on the sequence seq.
 Markov (const Markov &)
 Constructor 4 : Copy constructor.
 Markov ()
 Constructor 5 : Default constructor.
 Markov (short size, short order)
 Constructor 6 : Minimal Constructor.
 Markov (const Markov &M1, const Markov &M2, const float p)
 Constructor 7 : Creation of a "mixed" Markov chain M = p*M1 + (1-p)*M2 */.
 Markov (const gsl_rng *r, short size, short order, bool calc_rank=false)
 Constructor 8 : random markov matrices.
 Markov (unsigned long *count, short size, short order, bool calc_rank=false)
 Constructor 9 : Estimate the transition matrices on a word-count.
virtual ~Markov ()
 Destructor.
template<class TSeq>
void estimate (const TSeq &tseq, unsigned long beg, unsigned long end, bool calc_rank)
 Estimate the transition matrices on the sequence/sequenceset tseq.
const double * markov_matrix () const
 access to the markov matrix
void draw_markov_matrix (const gsl_rng *r)
 draw at random the markov matrix
void free_markov_matrix ()
 free the memory allocated for markov matrix
void compute_stat_law (bool force)
 Compute the stationnary laws.
void free_stat_law ()
 free the memory allocated for stationnary law
const double * stat_law () const
 access to the stationnary distrib
virtual int compute_rank ()
 Computes the rank of convergence of the Markov Chain.
void compute_power ()
 Initialisation the _rank powers of the markov matrix.
int free_power ()
 free the memory allocated for the power
double proba_step (long w1, long w2, int step)
 transition from word w1 to word w2 in step steps
bool isPi () const
bool isPow () const
bool isMu () const
double & operator() (int i)
 () operator for Markov matrix Pi elements
double Mu (int i) const
 Access to stationnary vector Mu elements.

Protected Attributes

double * _Pi
 "Matrix" (in a vector format) of transition probabilities (=_Pis[0])
double * _Mu
 Vector of stationnary probabilities (=_Mus[0]).
double *** _PowPi
 Power of the _Pi matrix.

Detailed Description

Markov modelling, estimation and simulation.

This is a special case of a phased Markov [PhasedMarkov] model when only one phase is considered.


Constructor & Destructor Documentation

Markov::Markov const SequenceSet seqset,
bool  calc_rank = false
 

Constructor 2 : Estimate the transition matrices on the sequences of seqset.

Parameters:
seqset set of sequences for estimation
calc_rank calculus of the convergence rank if true

Markov::Markov const Sequence seq,
bool  calc_rank = false
 

Constructor 3 : Estimate the transition matrices on the sequence seq.

Parameters:
seq sequence for estimation
calc_rank calculus of the convergence rank if true

Markov::Markov short  size,
short  order
[inline]
 

Constructor 6 : Minimal Constructor.

Initialises the constants of the model but not the matrix nor the stat law

Parameters:
size alphabet size
order markovian order

Markov::Markov const Markov M1,
const Markov M2,
const float  p
 

Constructor 7 : Creation of a "mixed" Markov chain M = p*M1 + (1-p)*M2 */.

Parameters:
M1 first Markov chain object
M2 second Markov chain object
p weight of M1 in the resulting M(with 0<=p<=1)

Markov::Markov const gsl_rng *  r,
short  size,
short  order,
bool  calc_rank = false
[inline]
 

Constructor 8 : random markov matrices.

Parameters:
r gsl random generator
size alphabet size
order markovian order
calc_rank calculus of the convergence rank if true
GSL use exple:
    const gsl_rng_type * T;
    // Choice a default generator and seed
    // from environment variables
    gsl_rng_env_setup();
    // New created instance of the generator
    T = gsl_rng_default;
    gsl_rng * r = gsl_rng_alloc (T);
    // Initialize/Seeds the random number generator
    gsl_rng_set( r, (long)(time( NULL )) );

Markov::Markov unsigned long *  count,
short  size,
short  order,
bool  calc_rank = false
 

Constructor 9 : Estimate the transition matrices on a word-count.

Parameters:
count count of all the coded word(base size) of size order+1 for estimation
size alphabet size
order markovian order
calc_rank calculus of the convergence rank if true


Member Function Documentation

void Markov::draw_markov_matrix const gsl_rng *  r  )  [inline]
 

draw at random the markov matrix

Parameters:
r gsl random generator
GSL use exple:
    const gsl_rng_type * T;
    // Choice a default generator and seed
    // from environment variables
    gsl_rng_env_setup();
    // New created instance of the generator
    T = gsl_rng_default;
    gsl_rng * r = gsl_rng_alloc (T);
    // Initialize/Seeds the random number generator
    gsl_rng_set( r, (long)(time( NULL )) );
    ...
    ...
    gsl_rng_free( r );

template<class TSeq>
void Markov::estimate const TSeq &  tseq,
unsigned long  beg,
unsigned long  end,
bool  calc_rank
[inline]
 

Estimate the transition matrices on the sequence/sequenceset tseq.

Parameters:
tseq sequence/sequenceset for estimation
beg begin position in sequence(s) if subsequences
end end position in sequence(s) if subsequences
calc_rank calculus of the convergence rank if true

bool Markov::isMu  )  const [inline]
 

_Mu == NULL ?

bool Markov::isPi  )  const [inline]
 

_Pi == NULL ?

bool Markov::isPow  )  const [inline]
 

_PowPi == NULL ?

double Markov::Mu int  i  )  const [inline]
 

Access to stationnary vector Mu elements.

Parameters:
i index of the word

double& Markov::operator() int  i  )  [inline]
 

() operator for Markov matrix Pi elements

Parameters:
i index of the word

double Markov::proba_step long  w1,
long  w2,
int  step
[inline]
 

transition from word w1 to word w2 in step steps

if step > _rank, give stat_law(w2). You must have w1-jump, w2-jump < _nMu

Parameters:
w1 first word (of length order) as a Sequence-coded-like integer (see Sequence)
w2 second word (of length order) as a Sequence-coded-like integer (see Sequence)
step number of steps between w1 and w2


The documentation for this class was generated from the following files:



Download seq++ 4.0.0
Download previous versions
Statistique & Genome Home


Generated on Wed Mar 23 09:25:58 2005 for seqpp by doxygen 1.3.9.1