Closed williamlai2 closed 1 month ago
Hi @williamlai2 , thanks for pointing this out. The issue is not with the part of the code you experimented with (if else
statements do not work as you would expect if you are running them from the console). The default behavior of egammaAltCensored
is to estimate the MLE (method="mle"
) and if ci=TRUE
the default method for computing the confidence interval is to use the Profile Likelihood (ci.method="profile.likelihood"
). The error is occurring because of machine arithmetic because the values you are giving the function are "close" to 0. If you change the units by multiplying by say 1000 the issue disappears. There is also an issue with elnormAltCensored
in that it produces warnings using your data. I am about to upload fixed versions of these functions that take care of the problem and then create a pull request.
I have this data. It works with
elnormAltCensored()
but produces an error withegammaAltCensored()
.I had a look at the
egammaAltCensored.R
file and it seems to run and did produce the output, but didn't like this section:Where the output in the console is:
Though this
if_else()
structure is throughout the other files includingelnormAltCensored()
and doesn't stop it from running.The warnings are all for
stats::dgamma()
andstats::pgamma()
but don't seem to be that much of an issue as it runs.