search for: intergrale

Displaying 1 result from an estimated 1 matches for "intergrale".

2012 Apr 07
1
Uniroot error
...to find a uniroot of a function within another function (see example) but I am getting an error message (f()values at end points not of opposite sign). I was wondering if you would be able to advise how redefine my function so that I can find the solution. In short my first function calculates the intergrale which is function of "t" , I need to find the uniroot of n defined in the second function. y <- function(t){ (dnorm(t,mean=(diff*sqrt(n/2)),sd=sqrt(rho)))*(pnorm((qnorm((1-alpha),mean=0,sd=1)-t)/(sqrt(1-rho))))^2 } inter <- function(n){ integrate(y,lower=-Inf,upper=Inf)$value-0....