@juliantaylor very good point. The weights should first be normalized to sum to N (the unweighted number of observations) right? I am looking at http://stats.stackexchange.com/a/61298/29084