An option-theoretic valuation model for residential mortgages with stochastic conditions and discount factors