In this article, we construct a general model, which considers the borrower's financial and non-financial termination behavior, to derive the closed-form formula of the mortgage value for analyzing the yield, duration and convexity of the risky mortgage. Since the risks of prepayment and default are reasonably expounded in our model, our formulae are more appropriate than traditional mortgage formulae. We also analyze the effects of the prepayment penalty and partial prepayment on the yield, duration and convexity of a mortgage, and provide lenders with an upper-bound for the mortgage default insurance rate. Our model provides portfolio managers a useful framework to more appropriately appraise the mortgage and more effectively hedge their mortgage holdings. From the results of sensitivity analyses, we find that higher interest-rate, prepayment and default risks will increase the mortgage yield and reduce the duration and convexity of the mortgage.