def q_2_b_i(hmm_model, observation): """ calculating the log probability of observing chrom17.fasta given the model. :return: """ f = forward_algorithm(hmm_model, observation) print(f[1, -1])
def q_2_b_ii(hmm_model, observation): """ calculating the log probability of observing chrom17.fasta given the model. :return: """ random_observation = ''.join(np.random.choice(a=list(set(observation)), size=len(observation), replace=True)) f = forward_algorithm(hmm_model, random_observation) print(f[1, -1])