Statistics for Regular Pattern Detection and Analysis Using Shapelets