Term structure of interest rates with regime shifts