Non Homogeneous Markov and Semi-Markov Models for pricing derivative securities