Open joethorley opened 3 years ago
Note if switch off check then get the following
library(ssdtools)
data <- ssdtools::boron_data
data$right <- data$Conc
data$right[1] <- Inf
ssd_fit_dists(data, dists = "lnorm", right = "right")
#> Warning: Distribution 'lnorm' failed to fit (try rescaling data): Error in optim(model$par, model$fn, model$gr, method = "L-BFGS-B", lower = lower, :
#> non-finite value supplied by optim
#> .
#> Error: All distributions failed to fit.
Created on 2021-08-02 by the reprex package (v2.0.0)
The issue is handling the infinite values in the TMB C++ code.
Really just need to replace existing code
pright = pnorm(log(right(i)), meanlog, sdlog);
with
pright = 1;
if(isfinite(right(i))){ pright=pnorm(log(right(i)), meanlog, sdlog);};
Hi Joe, I'm playing around with a data set with right censored values, is this still on the list of things to implement?
Yes it is. I'll try and find some time to scope out how much time it would take and see whether the maintenance budget would cover it. What are your time scales?
Created on 2021-08-02 by the reprex package (v2.0.0)