I am trying to compute this integral :
"A" and "Beta" are constants, "PHI" capital is the marginal distribution function of the Normal Law N(0,1), and "phi" is the density of the Normal Law N(0,1) and P(tau <= t) = 1/2
Here is my implementation :
integral <- function(A, beta) {
f <- function(x) {
# We have P(tau <= t) = 1/2
pnorm(qnorm(1/2,0,1) - beta*x / (sqrt(1-(beta^2))), 0, 1)*(1/sqrt(2*pi)*exp(-x^2 / 2)
}
integrate(f,lower=-Inf, upper = A)$value
}
I am not really sure about the qnorm function.. Is there a better way to do the computation?
