Skip to content

Questions regarding to JohnSonFit() in the R package Johnson {SuppDists}

2 messages · Shiner Yang, William Dunlap

#
Hello,

I was trying to fit a Johnson curve by first figuring out the parameter
estimates using JohosnFit of a vector by a group ID using the aggregate
function. I.E.

aggregate(x, by = list(ID), JohnsonFit)

where x is the variable I am trying to perform JohnsonFit on. It is a
continuous random variable. However, I keep getting the following error:

Error in JohnsonFit(x) :
Unbounded solution intermediate values out of range

When I run the fit individually by group ID, it works fine. However I do
not want to do that manually as there are a large number of groups that
would be too laborious to do so.

If possible, could you shed some light on this error?

Thanks!
#
This happens for some inputs, e.g.,
   > JohnsonFit(c(2,3,4,5,6,7,8,30,50,300))
   Error in JohnsonFit(c(2, 3, 4, 5, 6, 7, 8, 30, 50, 300)) :
   Unbounded solution intermediate values out of range
The usual recommendation is to contact the maintainer of the package but
that isn't possible in this case
   > maintainer("SuppDists")
   [1] "ORPHANED"

You can work around the problem to some extent by replacing
   JohnsonFit
with a function that detects errrors in JohnsonFit and returns an indicator
that JohnsonFit fails and lets you move on to the next subset of data.
E.g.,
   function(x) tryCatch(JohnsonFit(x),
                                    error=function(e)
structure(conditionMessage(e), x=x))


Bill Dunlap
TIBCO Software
wdunlap tibco.com
On Fri, Jun 30, 2017 at 9:16 AM, Shiner Yang <shineryang1 at gmail.com> wrote: