Displaying 1 result from an estimated 1 matches for "integral2".
Did you mean:
integral
2007 Jan 19
3
integrate and quadratic forms
...ways that, for me,
should give the same answer:
#more legible
integral1 = function(u) {
o=(1/2)*sum(h*atan(lambda*u)+sigma^2*lambda*u/(1+lambda^2*u^2)) - q*u/2
rho=prod((1+lambda^2*u^2)^(h/4))*exp( (1/2)*sum((sigma*lambda*u)^2/(1+lambda^2*u^2)) )
integrand = sin(o)/(u*rho)
}
#same as above
integral2= function(u) {
((1/2)*sum(h*atan(lambda*u)+sigma^2*lambda*u/(1+lambda^2*u^2)) - q*u/2)/
(u*(prod((1+lambda^2*u^2)^(h/4))*
exp( (1/2)*sum((sigma*lambda*u)^2/(1+lambda^2*u^2)) )))
}
The following should be near 0.18. However, nor the answers are near this
value neither they agree each other!
> 1...