Hi adam-haber. Thanks for reporting those bugs! I will take a look. For which model did the initialization fail? This tended to happen to me for the weibull model, and for this you can pass in an initialization function which will set the random initial values to more reasonable ranges.
For other models, this can sometimes happen if your data look different from the test data. You can try giving pystan a more narrow init value range, using the parameter init_r
. I would try a value of 1 or 0.5 (the default is 2).
Rejecting initial value: [1283/1880]
Error evaluating the log probability at the initial value.
validate transformed params: Sigma_baseline_hazard is not positive definite.
Rejecting initial value:
Error evaluating the log probability at the initial value.
validate transformed params: Sigma_baseline_hazard is not positive definite.
Rejecting initial value:
Error evaluating the log probability at the initial value.
validate transformed params: Sigma_baseline_hazard is not positive definite.
Rejecting initial value:
Error evaluating the log probability at the initial value.
validate transformed params: Sigma_baseline_hazard is not positive definite.
Rejecting initial value:
Error evaluating the log probability at the initial value.
validate transformed params: Sigma_baseline_hazard is not positive definite.
Rejecting initial value:
Error evaluating the log probability at the initial value.
validate transformed params: Sigma_baseline_hazard is not positive definite.
Rejecting initial value:
Error evaluating the log probability at the initial value.
validate transformed params: Sigma_baseline_hazard is not positive definite.
Rejecting initial value:
Error evaluating the log probability at the initial value.
validate transformed params: Sigma_baseline_hazard is not positive definite.
Rejecting initial value:
Error evaluating the log probability at the initial value.
validate transformed params: Sigma_baseline_hazard is not positive definite.
Rejecting initial value:
Error evaluating the log probability at the initial value.
validate transformed params: Sigma_baseline_hazard is not positive definite.
Rejecting initial value:
Rejecting initial value:
Error evaluating the log probability at the initial value.
Error evaluating the log probability at the initial value.
head()
, number of samples, number of events, typical follow-up time, and covariates. Rejecting initial value:
Log probability evaluates to log(0), i.e. negative infinity.
Stan can't start sampling from this initial value.
Rejecting initial value:
Log probability evaluates to log(0), i.e. negative infinity.
Stan can't start sampling from this initial value.
Initialization between (-2, 2) failed after 100 attempts.
Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
prep_data_long_surv
first.dlong = survivalstan.prep_data_long_surv(df=d, event_col='event', time_col='t')
fit = survivalstan.fit_stan_survival_model(
model_code = survivalstan.models.pem_survival_model,
df = dlong,
sample_col = 'index',
timepoint_end_col = 'end_time',
event_col = 'end_failure',
formula = '~ age_centered + sex'
)
OSError: [Errno 12] Cannot allocate memory
htop
shows I have more than 10G to spare...