Nonparametric Methods with Total Variation Type Regularization