Hello,

i got an warning message in the following code:

f<-1:100
t<-1:100
b<-100

ll2 <- function(b,f,t) {
  t<-cumsum(t)
  tn<-t[length(t)]
  i<-seq(along=f)
  s1<-(tn*exp(-b*tn)*sum(f[i]))/(1-exp(-b*tn))
  
s2<-sum((f[i]*(t[i]*exp(-b*t[i])-t[i-1]*exp(b*t[i-1])))/(exp(-b*t[i-1])-exp(-b*t[i])))
  s1-s2
}

ll2(b,f,t)

i think, the problem here is, that t[0] doesn't exist and so i got 
different length of objects. want can i do to avoid this error?
the assumption is that t[0] should be 0.

best regards
andreas

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to