% function [Fh, Fcr, Fhminus, Fcrminus] 
function sol_function_refi =  ...
    getRefiRates(etah,etacr,muetah,sigmaetah,muetacr,sigmaetacr,num_eq_refi)
    Fh = normcdf(etah, muetah,sigmaetah);
    etahnorm = (etah-muetah)./sigmaetah;
    Fhminus =normcdf(etahnorm).*muetah ...
        - sigmaetah.*normpdf(etahnorm);
    Fcr = normcdf(etacr, muetacr,sigmaetacr);
    etacrnorm = (etacr-muetacr)./sigmaetacr;
    Fcrminus =normcdf(etacrnorm).*muetacr ...
        - sigmaetacr.*normpdf(etacrnorm);

     if num_eq_refi == 1
         sol_function_refi = Fh;
     elseif num_eq_refi == 2
         sol_function_refi = Fhminus;
     elseif num_eq_refi == 3
         sol_function_refi = Fcr;
     elseif num_eq_refi == 4
         sol_function_refi = Fcrminus;
     end
     
end
