How to calculate $\int_{S}^{T} \Phi \Big(\frac{l_0-f(t)}{\sigma}\Big)g(t)dt$?

30 Views Asked by At

How can I calculate the integral- $\int_{S}^{T} \Phi \Big(\frac{l_0-f(t)}{\sigma}\Big)g(t)dt$ where $f(t)= \mu_0+\mu_1 e^{-\gamma (7+logt)^\delta}$ and $g(t)= \frac{1}{(t+h)^k}$ .

Here $\Phi \Big(\frac{l_0-f(t)}{\sigma}\Big)= \frac{1}{\sigma \sqrt{2 \pi} } \int_{-\infty}^{l_0} e^{\frac{(m-f(t))^2}{2 \sigma^2}} dm$; and $l_0,\mu_0,\mu_1,\gamma,\delta,h,k$ are constants.

1

There are 1 best solutions below

4
On

Use the integrate() command in R.

I = function(mu0, mu1, L0, gamma, d, h, k, sigma, S, T) 
{
  f = function(t) mu0 + mu1*exp(-gamma*(7 + log(t))^d) 
  g = function(t) 1/( (t+h)^k ) 
  z = function(t) dnorm( (L0-f(t))/sigma ) * g(t) 
  return( integrate(z, S, T)$val ) 
}

I(0,1,0,1,1,0,1,1,1,2)

Make sure the arguments result in defined function values for the integrand (e.g. S$\geq$0).