What is the difference between 'smooth' and 'smoothdata' function?

21 views (last 30 days)
I known that the 'smooth' function deals with response data while the 'smoothdata' function deals with noisy data.
Is there any difference bewteen response data and noisy data?
Are 'smooth' and 'smoothdata' repetitive functions?
  4 Comments
dpb
dpb on 19 Apr 2020
Not really...the differences should be minor as it is really only the end effects that can't make same.
You'll end up trying several different types to find what works well in a given situation, they'll undoubtedly have far more differences between them than the relatively minor differences of the implementation differences.
If you didn't have the SP TB you'd not know about smooth, anyways, and be just as happy with smoothdata... :)

Sign in to comment.

Accepted Answer

John D'Errico
John D'Errico on 19 Apr 2020
Edited: John D'Errico on 19 Apr 2020
These are very similar codes, doing similar things. smooth came eariler. But not everybody has the same toolboxes, nor can you be forced to get all toolboxes. Yet many people will want to do the same things as are found in both codes.
Smooth came out in 2006, smoothdata in 2017. Smoothdata is a little more sophisticated, with more options, as you might expect, since it was introduced many years later. It can work on multidimensional arrays. Smooth seems to be for vectors only. The interface is slightly different between them, but not by that much.
Which one is "better"? Neither, really. Both offer a similar set of methods, though smoothdata is a littler broader in your choices. If you need one of the options in smoothdata, then your choice is made for you. If they both offer the same method, and you want to use that method, then just flip a coin. I'm pretty confident the author made sure the code is valid, by crosstesting the results.
Don't get too hung up on the wording in the documentation. They both do essentially the same thing. It would be more important for you to choose intelligently from the various methods offered as options, as that can significantly impact your results. Different methods can be useful for different kinds of noise, different noise structures, so understanding what choices you make is important.
For example, suppose your noise is in the form of rare but very large outliers? In that case, some sort of median smooth makes a lot of sense. Other smoothing operations (moving mean, Savitsky-Golay, etc.) will get draggd around massively by a rare but significant outlier. Again, it is really important to understand the methods in those tools.
  3 Comments
Miguel Inserni
Miguel Inserni on 5 Oct 2020
For anyone out there using the LOESS and RLOESS functions, for long window (400+ pts) sizes the smoothdata implementation appears to be dramatically faster than the older smooth. I'm not sure why this is and haven't validated, but those are my initial results using them.

Sign in to comment.

More Answers (0)

Products


Release

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!