SavitzkyGolayMatrix[r,k]
gives a matrix corresponding to a smoothing kernel of radius r for performing polynomial regression of degree k.
SavitzkyGolayMatrix[{r1,r2},{k1,k2}]
gives a matrix for performing polynomial regression of degree k1 over a window of radius r1 along rows, and degree k2 over a window of radius r2 along columns.
SavitzkyGolayMatrix[r,k,n]
gives a matrix for performing the n
derivative of a polynomial regression of degree k.
SavitzkyGolayMatrix[{r1,r2… },{k1,k2,…},…]
gives an array using the specified parameters for each direction i.
SavitzkyGolayMatrix
SavitzkyGolayMatrix[r,k]
gives a matrix corresponding to a smoothing kernel of radius r for performing polynomial regression of degree k.
SavitzkyGolayMatrix[{r1,r2},{k1,k2}]
gives a matrix for performing polynomial regression of degree k1 over a window of radius r1 along rows, and degree k2 over a window of radius r2 along columns.
SavitzkyGolayMatrix[r,k,n]
gives a matrix for performing the n
derivative of a polynomial regression of degree k.
SavitzkyGolayMatrix[{r1,r2… },{k1,k2,…},…]
gives an array using the specified parameters for each direction i.
Details and Options
- SavitzkyGolayMatrix[r,k] can be used to smooth data using a local polynomial regression.
- SavitzkyGolayMatrix[r,k,n] can be used to compute the derivatives of data using a local polynomial regression.
- The elements of SavitzkyGolayMatrix[r,k] sum to 1.
- SavitzkyGolayMatrix allows any of r, k, and n to be lists, specifying different values for different directions.
- For integer r, SavitzkyGolayMatrix[r,…] yields a
×
matrix. - For noninteger r, the value of r is effectively rounded to an integer.
- SavitzkyGolayMatrix accepts a WorkingPrecision option. The default setting is WorkingPrecision->MachinePrecision.
- SavitzkyGolayMatrix can be used in functions such as ListConvolve and ImageConvolve.
Examples
open all close allBasic Examples (3)
Compute a matrix kernel for quadratic interpolation over a window of radius 5:
SavitzkyGolayMatrix[5, 2]//MatrixPlotCompute a smoothing kernel of length 11 using a cubic interpolation:
SavitzkyGolayMatrix[{5}, 3]ListPlot[%, Filling -> 0]A Savitzky–Golay matrix to compute first derivatives in the horizontal dimension:
SavitzkyGolayMatrix[5, 2, {0, 1}]//MatrixPlotScope (3)
SavitzkyGolayMatrix[{5, 5, 5}, 2]//Image3D//ImageAdjustSavitzkyGolayMatrix[{5, 5, 5}, 2, 1]//Image3D//ImageAdjustA 3D derivative kernel along the first dimension:
SavitzkyGolayMatrix[{5, 5, 5}, 2, {1, 0, 0}]//Image3D//ImageAdjustOptions (1)
Applications (2)
Use a 2D SavitzkyGolayMatrix as a smoothing kernel in ImageConvolve:
ImageConvolve[[image], SavitzkyGolayMatrix[5, 2]]Compute the horizontal derivative of an image:
ImageConvolve[[image], SavitzkyGolayMatrix[5, 2, {1, 0}]]//ImageAdjustSee Also
Related Guides
History
Text
Wolfram Research (2014), SavitzkyGolayMatrix, Wolfram Language function, https://reference.wolfram.com/language/ref/SavitzkyGolayMatrix.html.
CMS
Wolfram Language. 2014. "SavitzkyGolayMatrix." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SavitzkyGolayMatrix.html.
APA
Wolfram Language. (2014). SavitzkyGolayMatrix. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SavitzkyGolayMatrix.html
BibTeX
@misc{reference.wolfram_2026_savitzkygolaymatrix, author="Wolfram Research", title="{SavitzkyGolayMatrix}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/SavitzkyGolayMatrix.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_savitzkygolaymatrix, organization={Wolfram Research}, title={SavitzkyGolayMatrix}, year={2014}, url={https://reference.wolfram.com/language/ref/SavitzkyGolayMatrix.html}, note=[Accessed: 13-June-2026]}