function obj = Vasicek(T,a,b,sigma,r0)

e = exp(-a*T);

Rinf = b - sigma^2/(2*a^2);

obj = (1 - e)*r0/(a*T) + Rinf * (1 - (1 - e)/(a*T)) + sigma^2/(4*a^3) ...
      * (1 - e)^2/T;

endfunction