A Cross Validation Framework for Signal Denoising with Applications to Trend Filtering, Dyadic CART and Beyond