|
From: Conrad C. <con...@gm...> - 2021-08-14 15:45:38
|
Hello,
Please note I am new to quantitative finance and more so to stochastic
calculus.
I have what should be a relatively simple problem using the *Vasicek*
model for estimating future parameters of the short rate.
dr(t)=0.2(0.05−r(t))dt+0.1dW(t),r(0)=5%,
where W(t)W(t)is a standard Brownian motion under the *objective
probability measure* P\mathbb{P}.
I am trying to calculate the expected value of short rate, the standard
deviation and the probability of having a negative short rate all at t = 1.
I have successfully calculated the standard deviation/volatility but
cannot seem to get the other two values.
I know the parameters of the process have to be modified via Girsanov
Theorem but how exactly does that change the expressions for the
*analytical* and *simulated* short rate?
Is it sufficient to just assume the market price of interest rate risk
is -1.2 and reducing the drift term accordingly?
Below are the methods I am currently using to predict the short rate
over the time interval and estimate future values.
*(Simulated)
*
*for t in range(1, M + 1):**
*
* xh[t] = xh[t - 1] + kappa * ((theta - sigma/kappa) - xh[t - 1]) *dt
+ sigma * np.standard_normal(I)*
*(Analytical)
*
*temp1 = np.exp(-self.kappa*(dt))
temp2 = (self.sigma**2) * (1 - temp1**2) / (2*self.kappa)
result = np.mean(self.r0*temp1 + (self.theta -
self.sigma/self.kappa)*(1-temp1) +
np.sqrt(temp2)*npr.standard_normal(1000))*
I also used the code below attempting to do the same using Quantlib but
am not sure exactly how to go about extracting the relevant parameters.
All the examples I have seen involve calibrating such short-rate models
using historic market data but this is not the case for my problem.
**
*today = ql.Date().todaysDate()
# ql.Settings.instance().evaluationDate = today
# crv = ql.ZeroCurve([today, settlement], [0.05, 0.05], ql.Actual365Fixed())
crv = ql.FlatForward(today, 0.05, ql.Actual365Fixed())
yts = ql.YieldTermStructureHandle(crv)
vol = ql.QuoteHandle(ql.SimpleQuote(0.1))
model = ql.Vasicek(r0=0.05, a=0.2, b=0.05, sigma=0.1)
engine = ql.BlackCallableFixedRateBondEngine(vol, yts)*
Thanks,
Conrad
|