bilinear regression code (developed for the Azimuth project)