Dear All

I am trying 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.8
}

rho <- 0.5
alpha <- 0.0125
diff <- 0.5

n1 <- uniroot(inter,lower=1,upper=100000)$root


--
View this message in context: http://r.789695.n4.nabble.com/Uniroot-error-tp4539816p4539816.html
Sent from the R help mailing list archive at Nabble.com.
	[[alternative HTML version deleted]]

