editted inference to include to read in data file and include regularization option that penalizes first derivative