Displaying 1 result from an estimated 1 matches for "chazard2".
Did you mean:
hazard2
2006 Nov 11
2
Bayesian question (problem using adapt)
...ion undefined")}
param[1]*x^param[2] / param[2]
}
hazard2 <-function(x, theta, param) {
if(min(x, theta, param) <= 0) {return("function undefined")}
ratio = 1/(theta[1]*exp(-chazard1(x, param)) +
theta[2]*(1-exp(-chazard1(x, param))))
return(ratio*hazard1(x, param))
}
chazard2 <- function(x, theta, param) {
if(min(x, theta, param) <=0) {return("function undefined")}
val=c()
for (i in 1:length(x)) {
val=c(val, integrate(hazard2, lower=0, upper=x, theta=theta,
param=param)$value)}
return(val)
}
param0 = c(1.11, .833)
theta0 = c(1.11, .833)
yn1...