Skip to content

problems with package 'segmented'

2 messages · Benedikt Drosse, Rolf Turner

14 days later
#
In view of our private communication on this matter (to the effect that
you had not been able to elicit a response from Vito Muggeo) I did a
little delving into the code of segmented.lm().  I ***think*** I have found
the problem.  On line 243 (of the code as seen from loading the package)
the construction:

     initial <- unlist(mapply(function(x, y) {

should read:

     initial <- as.vector(mapply(function(x, y) {

(The unlist() construction  has no effect.)

Once this change is made, the function runs on the example
without throwing an error (or warning).

I have not investigated as to whether the result returned is sensible.

It is also possible that the "fix" I have suggested will induce other 
problems
in other contexts; I don't really understand what's going on well enough to
be certain.

I hope that this is of some help, but.

     cheers,

             Rolf Turner
On 01/12/2010 12:32 AM, Benedikt Drosse wrote:
(BTW --- shouldn't that date read "01/12/2012"?  I don't *think*
your posting sat in my inbox for two *years*!!!)