Skip to content

[RsR] Problem re-implementing whimed from package robustbase

3 messages · Andreas Alfons, Kaveh Vakili

#
I only had a quick look at the code and did not have time to try it
myself, but you made many more changes to the code besides swapping
the C arrays to C++ Eigen data types.

I would suggest one of the following approaches to go further:

1) The original C code has been used for a long time and is proved to
be reliable. If you need to use the EIgen data types for your
application, you could simply write a wrapper function.

2) If you really need to re-implement it, I would start by changing
only as little as necessary to make it work with the Eigen data types.
If you first have something that works, you can then incrementally make
more changes to take advantage of the Eigen library.

- Andreas


On Sat, Jun 23, 2012 at 9:27 PM, Kaveh Vakili
<Kaveh.Vakili at wis.kuleuven.be> wrote:

  
    
#
Dear Andreas,

Suggestion (1) is a very good solution for my problem:
  the part of my implementation causing the divergence
  (whimed) is a function i'm not interested in modifying
anyway.

Still, i'm parsing both codes through a debugger when
i'll get the time to get to the bottom of this (this problem
  enticed my curiosity  and is a good occasion to learn to
power use dbg).

Best Regards,
On 06/24/2012 11:05 PM, Andreas Alfons wrote:
4 days later
#
Replacing

     w_tot=w.sum();

by

     w_tot=w.head(n).sum();

in the whimed function did the trick.
(~a classic)
On 06/24/2012 11:05 PM, Andreas Alfons wrote: