Least Squares Approximation for a Distributed System