Code for joint self-localization and parameter estimation in a sensor network