Dear R Experts,

I hope that you are doing well.

I am facing a problem to find out the value of the following function. I
need help in this regard.

#####
a=rnorm(1000, 110, 5)
b = rnorm(1000, -0.3, 0.4)
s = length(a)
lam=0.15
thr=70
r= 10

ff = function(zz){
  inner = vector("numeric", length = s)
     for(k in 1:s){
      inner[k]=(1- lam*((1+b[k]*((zz-thr)/a[k]))^(-1/b[k])))
          }
  answer = mean(inner)- (1- (1/r))
  return(answer)
  }
########
out=uniroot(ff, lower = 0, upper = 10000 )$root
out

########### Error ########
Error in uniroot(ff, lower = 0, upper = 10000) :
  f.upper = f(upper) is NA

Please help me. Thanks in advance.

Take care.

Hossain

-- 
Best Regards,
Md. Moyazzem Hossain
Associate Professor
Department of Statistics
Jahangirnagar University
Savar, Dhaka-1342, Bangladesh

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to