Detection of atypical patterns of occupancy and mobility in smart homes and offices with a network of motion detectors