sg()

Read(33) Label: vector, matrix, sg smoothing,

Description:

Perform SG smoothing on each row of a vector or a matrix.

Syntax:

sg(A,n,m,d)

Note:

The function performs SG smoothing on each row of vector A or matrix A and calculates the nth order derivative by fitting the degree of a polynomial n to a specific number data points m. It returns the smoothing coefficient if A is null, which is a vector of the length of m.

Parameters:

A

A vector or a matrix

n

Degree of a polynomial that satisfies n<m-1

m

A set of data points, which is an odd number greater than 1 and will automatically plus 1 if it isn’t an odd number

d

The nth order derivative, which satisfies d<n

Return value:

A sequence

Example:

 

A

 

1

[[1,2,3,4],[2,3,1,2],[1,1,1,-1],[1,0,-2,-6]]

 

2

=sg(A1,2,3,3)

3

=sg(A1,2,3)

4

=sg(,2,3)