As an input for option pricing models (e.g. GBSOption from fOption), how's the risk-free rate of return usually calculated? Shall we just find any T-bill whose maturity date matches the option expiration date and use its value to calculate the compound yield? Are there any existing functions for doing this?
Dear Xian, as per the Hull's book you should consider a T-Bill with same maturity as the underlying option contract (as you also said correctly.) However just make sure that, that rate is expressed in continuous compounding.
I can also remember that this topic was previously discussed in details here (just make a search.)