Example: Adaptive Smoothing
Use the
supsmooth function to smooth a data set.
1. Create a cloud-like data set by corrupting a cosine curve.
2. Use the supsmooth function to perform adaptive smoothing on the data set.
3. Use the
ksmooth function to perform kernel smoothing on the data set.
4. Plot the data set before and after smoothing. Compare the super-smoothed data set to the kernel-smoothed data set.