public double convexityBias(final double futurePrice,final double t,final double T,final double sigma,final double a){
  QL.require(futurePrice >= 0.0,"negative futures price not allowed");
  QL.require(t >= 0.0,"negative t not allowed");
  QL.require(T >= t,"T must not be less than t");
  QL.require(a >= 0.0,"negative a not allowed");
  final double deltaT=(T - t);
  final double tempDeltaT=(1. - Math.exp(-a * deltaT)) / a;
  final double halfSigmaSquare=sigma * sigma / 2.0;
  final double lambda=halfSigmaSquare * (1. - Math.exp(-2.0 * a * t)) / a * tempDeltaT * tempDeltaT;
  final double tempT=(1.0 - Math.exp(-a * t)) / a;
  final double phi=halfSigmaSquare * tempDeltaT * tempT* tempT;
  final double z=lambda + phi;
  final double futureRate=(100.0 - futurePrice) / 100.0;
  return (1.0 - Math.exp(-z)) * (futureRate + 1.0 / (T - t));
}

public double convexityBias ( final double futurePrice , final double t , final double T , final double sigma , final double a ) { QL . require ( futurePrice >= 0.0 , "negative futures price not allowed" ) ; QL . require ( t >= 0.0 , "negative t not allowed" ) ; QL . require ( T >= t , "T must not be less than t" ) ; QL . require ( a >= 0.0 , "negative a not allowed" ) ; final double deltaT = ( T - t ) ; final double tempDeltaT = ( 1. - Math . exp ( - a * deltaT ) ) / a ; final double halfSigmaSquare = sigma * sigma / 2.0 ; final double lambda = halfSigmaSquare * ( 1. - Math . exp ( - 2.0 * a * t ) ) / a * tempDeltaT * tempDeltaT ; final double tempT = ( 1.0 - Math . exp ( - a * t ) ) / a ; final double phi = halfSigmaSquare * tempDeltaT * tempT * tempT ; final double z = lambda + phi ; final double futureRate = ( 100.0 - futurePrice ) / 100.0 ; return ( 1.0 - Math . exp ( - z ) ) * ( futureRate + 1.0 / ( T - t ) ) ; }
futures convexity bias ( i . e . , the difference between futures implied rate and forward rate ) calculated as in < p > g . kirikos , d . novak , " convexity conundrums " , risk magazine , march 1997 .
