Data boundary fitting using a generalized least-squares method