This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||
|
The contents of the Numerical smoothing and differentiation page were merged into Savitzky–Golay filter on October 2013. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
The title of this article is wrong. S-G 's paper also gave coefficients for numerical differentiation Petergans 16:48, 24 March 2007 (UTC)
I've done a significant amount of work on optimal computation and could use some help in getting it into wikipedia. First I'd like someone to review it! I do have a copy of the paper somewhere, and might add a synopsis of it to the main page if I can dig it up. Either of you interested enough to talk with me? Prenatal ( talk) 02:34, 16 July 2008 (UTC)
The article says "Methods are also provided for calculating the first up to the fifth derivatives." Is there any particular reason this is limited to 5th derivatives? I would expect ill-conditioning at some order, but I would expect that to be hardware dependent, rather than a hard limit of 5. There are also limits where you should pick a higher-order fit polynomial for higher derivatives, but again, that's not a hard limit. My intro to this filter was from "Numerical Recipes in C", 2nd ed., sec 14.8. —Preceding unsigned comment added by 70.234.254.126 ( talk) 18:44, 14 October 2009 (UTC)
I looked at the fundamentals of statisitcs link; incomprehensible The anal chem papers are paywalled — Preceding unsigned comment added by 68.236.121.54 ( talk) 17:09, 23 April 2012 (UTC)
You might look at BRL Report 863 by L.S. Dederick, 1953. It describes the same algorithm. It is on the DTIC website. — Preceding unsigned comment added by 69.251.18.149 ( talk) 17:32, 15 May 2012 (UTC)
Many might well come here for the explicit formulas. As it stands the article is lacking the most important aspects. The remark on Dederick's paper is interesting, direct link: http://www.dtic.mil/docs/citations/AD0021009. — Preceding unsigned comment added by 94.196.247.207 ( talk) 23:24, 17 November 2012 (UTC)
Firstly, S&G did not invent the process. It goes back into the 19th. century, described in the first edition of Whittaker&Robinson which I have seen, but cannot verify precisely. Guest has tables of convolution coefficients. I have removed reference to the moving average because it's just the same as a SG filter - a n-point linear smoothing filter has coefficients 1/n. I assume that S&G regarded this as too trivial to include in their paper. I've also removed reference to "advantages" because the comparison with moving average is irrelevant, for the reason mentioned in the last paragraph. There are some interesting properties, decribed and proved in appendix 7 of my book "Data fitting in the Chemical Sciences", including the property that smoothing leaves the area under a function unchanged. These properties might well go into the body of the article. Petergans ( talk) 12:30, 6 May 2013 (UTC)
A minus sign in non- TeX mathematical notation looks different from a stubby little hyphen:
I fixed a bunch of these. See WP:MOSMATH. Michael Hardy ( talk) 14:49, 2 June 2013 (UTC)
The article has been merged with Numerical smoothing and differentiation. After a week or two, I shall ask for that article to be deleted. In the meantime, any comments will be welcome.
Please check for spelling errors and typos. Petergans ( talk) 20:30, 30 July 2013 (UTC)
The article says: "When weights are not all the same the normal equations become
These equations do not have an analytical solution. To use non-unit weights, the coefficients of the fitting polynomial must be calculated individually for each data sub-set, using local regression."
While technically true, this seems to imply that weighted SG is a "nonlinear" filter (coefficients depend on data, e.g. like the bilateral filter) ... which is misleading. If we write a = Chat*y , then the weighted SG filter is directly analogous (isomorphic) to the standard version, just with Hat Matrix Chat instead of 'C', the matrix mentioned above in the article (i.e C = Chat[ I ], I = identity matrix). In other words the convolution coefficients are the elements of Chat (more precisely, the filter-bank = rows of Chat, 1 for each polynomial coefficient).
Since dChat/dy = 0, the filter is still linear. If the x data is regularly spaced, as in SG, then the W matrix is typically independent of window-position x0 (e.g. for standard moving least squares weight kernels, where w=w[x-x0]). Hence Chat can be formed numerically once, before seeing the data. Therefore weighted SG is much more efficient than the general case of local regression, where the x data is irregularly spaced, and hence Chat=Chat[x0].
I tried to edit the article yesterday to reflect this, but my edit was then removed. I am not sure why, but perhaps my (much more concise) edit was unclear? If this comment makes sense ... then perhaps the article can be updated now to reflect the above? (I am open to alternative wording, the main point is to prevent any misunderstanding.)
BTW I can provide Matlab code to demonstrate the Chat computation if desired ...
An interesting aside: weighting can help make higher-order SG filters less ill-conditioned ( Runge's phenomenon ) ... I've used e.g. 9th order, but regularized with a Gaussian weighting kernel. — Preceding unsigned comment added by 99.119.88.209 ( talk) 13:57, 24 October 2013 (UTC)
Please.
I found a huge number of instances of "Savitzky-Golay" (with a hyphen) instead of "Savitzky–Golay" (with an en-dash). And many many cases of things like -7 (with a hyphen) instead of −7 (with a minus sign). And lots of other things just as bad. Please look at WP:MOS and apply common sense. Michael Hardy ( talk) 05:13, 2 January 2014 (UTC)
The table of Savitzky-Golay coefficients at the bottom of the article is all correct, except for the last two columns of "Coefficients for 2nd derivative". In particular, the normalization factors are incorrect: instead of 99 and 4719, they should be 1188 and 56628. — Preceding unsigned comment added by 184.9.20.9 ( talk) 22:42, 6 April 2014 (UTC)
I agree with this comment. Based on ['General Least-Squares Smoothing and Differentiation by the Convolution (Savitzky-Golay) Method' in Analytical Chemistry, Vol. 62, No. 6, Mar. 15, 1990.], the last two columns are incorrect. The third column can also take a factor of 3 out. I am going to make the change and add a reference for where these numbers are calculated from (ie. the said paper above). -- Gwiz42 ( talk) 16:10, 10 May 2014 (UTC)
Lacking access to S-G's original paper, it would be a kindness to extend the table at the bottom of the article to show the convolution kernels for smoothing and derivatives for window sizes 5 to 25. — Preceding unsigned comment added by Shg4421 ( talk • contribs) 16:55, 24 September 2014 (UTC)
Fair enough, thank you. Then perhaps we could have the same formulas for the linear/quadratic case? (And if I may, why "linear/quadratic" and "quadratic/cubic" instead of just quadratic and cubic?) Thanks again.
"It arises because the sum of odd powers of z is always zero." Eureka -- thank you. — Preceding unsigned comment added by Shg4421 ( talk • contribs) 21:24, 29 September 2014 (UTC)
I'm working on an Excel add-in that provides user-defined functions for S-G filtering (free, unprotected workbook, with source code). I could put that on a file sharing site and post a link, but don't recall seeing any such links in other articles. Is that not done on Wikipedia? Thanks. — Preceding unsigned comment added by Shg4421 ( talk • contribs) 21:30, 29 September 2014 (UTC)
"Personal websites are not normally considered suitable external links, ..." That's fine, when it's fully cooked, I will do as Petergans did and invite people to send me an email if they're interested. "... only if you are a recognised expert in the field" Don't know what defines an expert, but I am a Microsoft MVP for Excel. Thanks to all for responding. — Preceding unsigned comment added by Shg4421 ( talk • contribs) 15:16, 30 September 2014 (UTC)
Using the formula for smoothing the second derivative (polynomial degree 2-3) results in values exactly half the ones listed in the table. I'd tend to believe the tables, since the formula for the m=3 case results in 1/2 of the standard central difference formula for the second derivative. But one of them - the formula or the table - should be corrected. I had no trouble implementing the other formulas up to polynomial degree 3, for values or first derivative. (I didn't check the 3rd derivative formula shown). Gmstanley ( talk) 06:04, 5 August 2015 (UTC)
The Savitzky–Golay filter fits a curve by "by the method of linear least squares," which means that it minimizes the mean square error between the polynomial and the observations; this is however sensitive to outliers and might therefore not be suitable in all cases. Is there a robust variant of the Savitzky–Golay filter that instead minimizes the mean absolute error, or a Huber loss (or some other loss function with bounded derivatives), and what is that filter called in that case? I have found a paper called " Robust Savitzky-Golay filters," but that is behind a paywall so I cannot access it. — Kri ( talk) 12:35, 23 October 2023 (UTC)
This article is rated C-class on Wikipedia's
content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||||||||||||||||||
|
The contents of the Numerical smoothing and differentiation page were merged into Savitzky–Golay filter on October 2013. For the contribution history and old versions of the redirected page, please see its history; for the discussion at that location, see its talk page. |
The title of this article is wrong. S-G 's paper also gave coefficients for numerical differentiation Petergans 16:48, 24 March 2007 (UTC)
I've done a significant amount of work on optimal computation and could use some help in getting it into wikipedia. First I'd like someone to review it! I do have a copy of the paper somewhere, and might add a synopsis of it to the main page if I can dig it up. Either of you interested enough to talk with me? Prenatal ( talk) 02:34, 16 July 2008 (UTC)
The article says "Methods are also provided for calculating the first up to the fifth derivatives." Is there any particular reason this is limited to 5th derivatives? I would expect ill-conditioning at some order, but I would expect that to be hardware dependent, rather than a hard limit of 5. There are also limits where you should pick a higher-order fit polynomial for higher derivatives, but again, that's not a hard limit. My intro to this filter was from "Numerical Recipes in C", 2nd ed., sec 14.8. —Preceding unsigned comment added by 70.234.254.126 ( talk) 18:44, 14 October 2009 (UTC)
I looked at the fundamentals of statisitcs link; incomprehensible The anal chem papers are paywalled — Preceding unsigned comment added by 68.236.121.54 ( talk) 17:09, 23 April 2012 (UTC)
You might look at BRL Report 863 by L.S. Dederick, 1953. It describes the same algorithm. It is on the DTIC website. — Preceding unsigned comment added by 69.251.18.149 ( talk) 17:32, 15 May 2012 (UTC)
Many might well come here for the explicit formulas. As it stands the article is lacking the most important aspects. The remark on Dederick's paper is interesting, direct link: http://www.dtic.mil/docs/citations/AD0021009. — Preceding unsigned comment added by 94.196.247.207 ( talk) 23:24, 17 November 2012 (UTC)
Firstly, S&G did not invent the process. It goes back into the 19th. century, described in the first edition of Whittaker&Robinson which I have seen, but cannot verify precisely. Guest has tables of convolution coefficients. I have removed reference to the moving average because it's just the same as a SG filter - a n-point linear smoothing filter has coefficients 1/n. I assume that S&G regarded this as too trivial to include in their paper. I've also removed reference to "advantages" because the comparison with moving average is irrelevant, for the reason mentioned in the last paragraph. There are some interesting properties, decribed and proved in appendix 7 of my book "Data fitting in the Chemical Sciences", including the property that smoothing leaves the area under a function unchanged. These properties might well go into the body of the article. Petergans ( talk) 12:30, 6 May 2013 (UTC)
A minus sign in non- TeX mathematical notation looks different from a stubby little hyphen:
I fixed a bunch of these. See WP:MOSMATH. Michael Hardy ( talk) 14:49, 2 June 2013 (UTC)
The article has been merged with Numerical smoothing and differentiation. After a week or two, I shall ask for that article to be deleted. In the meantime, any comments will be welcome.
Please check for spelling errors and typos. Petergans ( talk) 20:30, 30 July 2013 (UTC)
The article says: "When weights are not all the same the normal equations become
These equations do not have an analytical solution. To use non-unit weights, the coefficients of the fitting polynomial must be calculated individually for each data sub-set, using local regression."
While technically true, this seems to imply that weighted SG is a "nonlinear" filter (coefficients depend on data, e.g. like the bilateral filter) ... which is misleading. If we write a = Chat*y , then the weighted SG filter is directly analogous (isomorphic) to the standard version, just with Hat Matrix Chat instead of 'C', the matrix mentioned above in the article (i.e C = Chat[ I ], I = identity matrix). In other words the convolution coefficients are the elements of Chat (more precisely, the filter-bank = rows of Chat, 1 for each polynomial coefficient).
Since dChat/dy = 0, the filter is still linear. If the x data is regularly spaced, as in SG, then the W matrix is typically independent of window-position x0 (e.g. for standard moving least squares weight kernels, where w=w[x-x0]). Hence Chat can be formed numerically once, before seeing the data. Therefore weighted SG is much more efficient than the general case of local regression, where the x data is irregularly spaced, and hence Chat=Chat[x0].
I tried to edit the article yesterday to reflect this, but my edit was then removed. I am not sure why, but perhaps my (much more concise) edit was unclear? If this comment makes sense ... then perhaps the article can be updated now to reflect the above? (I am open to alternative wording, the main point is to prevent any misunderstanding.)
BTW I can provide Matlab code to demonstrate the Chat computation if desired ...
An interesting aside: weighting can help make higher-order SG filters less ill-conditioned ( Runge's phenomenon ) ... I've used e.g. 9th order, but regularized with a Gaussian weighting kernel. — Preceding unsigned comment added by 99.119.88.209 ( talk) 13:57, 24 October 2013 (UTC)
Please.
I found a huge number of instances of "Savitzky-Golay" (with a hyphen) instead of "Savitzky–Golay" (with an en-dash). And many many cases of things like -7 (with a hyphen) instead of −7 (with a minus sign). And lots of other things just as bad. Please look at WP:MOS and apply common sense. Michael Hardy ( talk) 05:13, 2 January 2014 (UTC)
The table of Savitzky-Golay coefficients at the bottom of the article is all correct, except for the last two columns of "Coefficients for 2nd derivative". In particular, the normalization factors are incorrect: instead of 99 and 4719, they should be 1188 and 56628. — Preceding unsigned comment added by 184.9.20.9 ( talk) 22:42, 6 April 2014 (UTC)
I agree with this comment. Based on ['General Least-Squares Smoothing and Differentiation by the Convolution (Savitzky-Golay) Method' in Analytical Chemistry, Vol. 62, No. 6, Mar. 15, 1990.], the last two columns are incorrect. The third column can also take a factor of 3 out. I am going to make the change and add a reference for where these numbers are calculated from (ie. the said paper above). -- Gwiz42 ( talk) 16:10, 10 May 2014 (UTC)
Lacking access to S-G's original paper, it would be a kindness to extend the table at the bottom of the article to show the convolution kernels for smoothing and derivatives for window sizes 5 to 25. — Preceding unsigned comment added by Shg4421 ( talk • contribs) 16:55, 24 September 2014 (UTC)
Fair enough, thank you. Then perhaps we could have the same formulas for the linear/quadratic case? (And if I may, why "linear/quadratic" and "quadratic/cubic" instead of just quadratic and cubic?) Thanks again.
"It arises because the sum of odd powers of z is always zero." Eureka -- thank you. — Preceding unsigned comment added by Shg4421 ( talk • contribs) 21:24, 29 September 2014 (UTC)
I'm working on an Excel add-in that provides user-defined functions for S-G filtering (free, unprotected workbook, with source code). I could put that on a file sharing site and post a link, but don't recall seeing any such links in other articles. Is that not done on Wikipedia? Thanks. — Preceding unsigned comment added by Shg4421 ( talk • contribs) 21:30, 29 September 2014 (UTC)
"Personal websites are not normally considered suitable external links, ..." That's fine, when it's fully cooked, I will do as Petergans did and invite people to send me an email if they're interested. "... only if you are a recognised expert in the field" Don't know what defines an expert, but I am a Microsoft MVP for Excel. Thanks to all for responding. — Preceding unsigned comment added by Shg4421 ( talk • contribs) 15:16, 30 September 2014 (UTC)
Using the formula for smoothing the second derivative (polynomial degree 2-3) results in values exactly half the ones listed in the table. I'd tend to believe the tables, since the formula for the m=3 case results in 1/2 of the standard central difference formula for the second derivative. But one of them - the formula or the table - should be corrected. I had no trouble implementing the other formulas up to polynomial degree 3, for values or first derivative. (I didn't check the 3rd derivative formula shown). Gmstanley ( talk) 06:04, 5 August 2015 (UTC)
The Savitzky–Golay filter fits a curve by "by the method of linear least squares," which means that it minimizes the mean square error between the polynomial and the observations; this is however sensitive to outliers and might therefore not be suitable in all cases. Is there a robust variant of the Savitzky–Golay filter that instead minimizes the mean absolute error, or a Huber loss (or some other loss function with bounded derivatives), and what is that filter called in that case? I have found a paper called " Robust Savitzky-Golay filters," but that is behind a paywall so I cannot access it. — Kri ( talk) 12:35, 23 October 2023 (UTC)