RNA modeling with Matlab - Chemistry 694 - Summer 2007
The links below are outdated. Download the zip file above and use
the instructions there.
Note: some browsers display the Matlab program files below as if they had
no carriage returns; in this case, either save the page to view it locally
or use View, Page Source.
show(S,N) uses letters N to show states S
rando(x) returns a random integer distributed according
to probability vector x
rna_iid(n) generates n independent, identically
distributed RNA bases
rna_mar(n) generates n RNA bases with Markov dependence
transition_count(x,N) makes a table of
transitions of x and labels the states using letters in the string N
Hidden Markov models
die_mar alternates between fair and loaded die
hmmsim(mu,A,n) generates n states of a Markov chain
with initial distribution mu and transition matrix A.
obssim(Pi,E) generates emitted states based on hidden
sequence Pi using emission probabilities E.
viterbi(mu,A,E,X) uses the Viterbi algorithm to
find the most likely hidden state sequence associated with the data in
matrix X, where mu is the initial distribution of hidden states, A is the
transition matrix, and E is the matrix of emission probabilities.
dice(n,r) alternates between fair and loaded dice,
runs r simulations of length n each, and estimates the hidden sequence.
The actual hidden sequence is shown first, then the observed sequences,
then the estimated sequence, with errors marked below.