Hi all,

I am encountering the same error that I have noticed others on this list have received. I tried different priors and still get this message. I couldn’t figure out what’s wrong. The code is below this message.

Appreciate it.

Ruizhe

SAMPLING FOR MODEL ‘anon_model’ NOW (CHAIN 1).

Chain 1: Rejecting initial value:

Chain 1: Log probability evaluates to log(0), i.e. negative infinity.

Chain 1: Stan can’t start sampling from this initial value.

Chain 1: Rejecting initial value:

Chain 1: Log probability evaluates to log(0), i.e. negative infinity.

Chain 1: Stan can’t start sampling from this initial value.

Chain 1: Rejecting initial value:

Chain 1: Log probability evaluates to log(0), i.e. negative infinity.

Chain 1: Stan can’t start sampling from this initial value.

Chain 1: Rejecting initial value:

Chain 1: Log probability evaluates to log(0), i.e. negative infinity.

Chain 1: Stan can’t start sampling from this initial value.

code:

```
stan_model <- "
data {
int<lower=0> N; // Number of observations
vector[N] T1;
vector[N] T2;
vector[N] T3;
int<lower=0, upper=1> censor1[N]; // Censoring indicator for T1
int<lower=0, upper=1> censor2[N]; // Censoring indicator for T2
int<lower=0, upper=1> censor3[N]; // Censoring indicator for T3
}
parameters {
real<lower=0> theta1;
real<lower=0> theta2;
real<lower=0> theta3;
real<lower=0> xi1;
real<lower=0> xi2;
real<lower=0> xi3;
real<lower=0> lambda1;
real<lower=0> lambda2;
real<lower=0> lambda3;
real<lower=0, upper=1> alpha;
}
model {
// Noninformative improper priors
xi1 ~ gamma(1, 0.01);
xi2 ~ gamma(1, 0.01);
xi3 ~ gamma(1, 0.01);
lambda1 ~ normal(0, 10000);
lambda2 ~ normal(0, 10000);
lambda3 ~ normal(0, 10000);
alpha ~ uniform(0, 1);
// Likelihood
for (i in 1:N) {
if (censor1[i] + censor2[i] + censor3[i] == 0) {
target += censor1[i]*weibull_lpdf(T1[i]|xi1,lambda1) + censor2[i]*weibull_lpdf(T2[i]|xi2,lambda2) + censor3[i]*weibull_lpdf(T3[i]|xi3,lambda3) + log(exp(-(theta1*weibull_lcdf(T1[i]|xi1,lambda1)+theta2*weibull_lcdf(T2[i]|xi2,lambda2)+theta3*weibull_lcdf(T3[i]|xi3,lambda3))^alpha));
}
else if (censor1[i] + censor2[i] + censor3[i] == 1) {
target += censor1[i]*weibull_lpdf(T1[i]|xi1,lambda1) + censor2[i]*weibull_lpdf(T2[i]|xi2,lambda2) + censor3[i]*weibull_lpdf(T3[i]|xi3,lambda3) + log(alpha * exp(-(theta1*weibull_lcdf(T1[i]|xi1,lambda1)+theta2*weibull_lcdf(T2[i]|xi2,lambda2)+theta1*weibull_lcdf(T3[i]|xi3,lambda3))^alpha) * (theta1*weibull_lcdf(T1[i]|xi1,lambda1)+theta2*weibull_lcdf(T2[i]|xi2,lambda2)+theta3*weibull_lcdf(T3[i]|xi3,lambda3))^(alpha-1));
}
else if (censor1[i] + censor2[i] + censor3[i] == 2) {
target += censor1[i]*weibull_lpdf(T1[i]|xi1,lambda1) + censor2[i]*weibull_lpdf(T2[i]|xi2,lambda2) + censor3[i]*weibull_lpdf(T3[i]|xi3,lambda3) + log(exp(-(theta1*weibull_lcdf(T1[i]|xi1,lambda1)+theta2*weibull_lcdf(T2[i]|xi2,lambda2)+theta3*weibull_lcdf(T3[i]|xi3,lambda3))^alpha) * (alpha * (1-alpha) * (theta1*weibull_lcdf(T1[i]|xi1,lambda1)+theta2*weibull_lcdf(T2[i]|xi2,lambda2)+theta3*weibull_lcdf(T3[i]|xi3,lambda3))^(alpha-2) + alpha^2 * (theta1*weibull_lcdf(T1[i]|xi1,lambda1)+theta2*weibull_lcdf(T2[i]|xi2,lambda2)+theta3*weibull_lcdf(T3[i]|xi3,lambda3))^(2*alpha-2)));
}
else if (censor1[i] + censor2[i] + censor3[i] == 3) {
target += censor1[i]*weibull_lpdf(T1[i]|xi1,lambda1) + censor2[i]*weibull_lpdf(T2[i]|xi2,lambda2) + censor3[i]*weibull_lpdf(T3[i]|xi3,lambda3) + log(exp(-(theta1*weibull_lcdf(T1[i]|xi1,lambda1)+theta2*weibull_lcdf(T2[i]|xi2,lambda2)+theta3*weibull_lcdf(T3[i]|xi3,lambda3))^alpha) * (alpha * (alpha-1) * (alpha -2) * (theta1*weibull_lcdf(T1[i]|xi1,lambda1)+theta2*weibull_lcdf(T2[i]|xi2,lambda2)+theta3*weibull_lcdf(T3[i]|xi3,lambda3))^(alpha-3) + 3*alpha^2 * (1-alpha) * (theta1*weibull_lcdf(T1[i]|xi1,lambda1)+theta2*weibull_lcdf(T2[i]|xi2,lambda2)+theta3*weibull_lcdf(T3[i]|xi3,lambda3))^(2*alpha-3) + alpha^3 * (theta1*weibull_lcdf(T1[i]|xi1,lambda1)+theta2*weibull_lcdf(T2[i]|xi2,lambda2)+theta3*weibull_lcdf(T3[i]|xi3,lambda3))^(3*alpha-3)));
}
}
}
"
```