Calculating Integral using R

I am needing to calculate this simple integral below:

insert the description of the image here This is the quantile function of the standardized normal, where we know that, q_0.5(z) = 0, for example.

That is, for each Theta (percentile) it gives me a number in the standardized normal density. Theta goes from 0 to 1.

I generated this function in R and arranged in an array:

thau=1:99/100
qnorm(thau,0,1)

matrix=matrix(0,99,2)
matrix[,1]=thau
matrix[,2]=qnorm(thau,0,1)

colnames(mattrix)=c("theta","q(z)")

How do I calculate this interal in R, Given that I already have the q function??

I I thought I'd calculate the two integrals using the Basic Rules of integral. Can I do this for this function? I think I can

insert the description of the image here

Would that be correct? For me gave -1.170456.

I would love your help.

Thank you.

 5
Author: Laorie, 2016-10-26

1 answers

According to what I understand about your problem, I believe it cannot be solved. Note that

eq1

Thus, the integral is undefined between 0 and 0.5. It diverges in this interval. It would be like integrating 1 / x between 0 and 1, for example.

Your account arrives at a result because it is not correct. Generalizing your result, it is equivalent to

eq2

If we assume that f(x)=1, according to your formula, we have

eq3

But this is an indetermination, because we have 0/0. Therefore, there would be no solution to this problem. But just see that if f (x)=1, we have

eq4

Which is a clearly well-defined integral in the range we are interested in. Therefore, the derivation of your result is not true and your answer is not -1.170456. Even your integral is divergent and your problem has no solution.

It would be interesting to go back to original problem and see where this integral came from to understand what the reason for calculating it.

 2
Author: Marcus Nunes, 2016-10-26 19:09:07