R: Smooth the time series using Savitsky-Golay filter

sits_sgolay {sits} | R Documentation

## Smooth the time series using Savitsky-Golay filter

### Description

An optimal polynomial for warping a time series. The degree of smoothing depends on the filter order (usually 3.0). The order of the polynomial uses the parameter 'order' (default = 3), the size of the temporal window uses the parameter 'length' (default = 5), and the temporal expansion uses the parameter 'scaling'.

### Usage

    sits_sgolay(
      data = NULL,
      order = 3,
      length = 5,
      scaling = 1,
      bands_suffix = "sg"
    )

### Arguments

`data` | A tibble with time series data and metadata.
`order` | Filter order (integer).
`length` | Filter length (must be odd)
`scaling` | Time scaling (integer).
`bands_suffix` | Suffix to be appended to the smoothed filters.

### Value

A tibble with smoothed sits time series.

### References

A. Savitzky, M. Golay, "Smoothing and Differentiation of Data by Simplified Least Squares Procedures". Analytical Chemistry, 36 (8): 1627–39, 1964.

### Examples

    #' # Retrieve a time series with values of NDVI
    point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI")
    # Filter the point using the Savitsky Golay smoother
    point_sg <- sits_filter(point_ndvi, sits_sgolay(order = 3, length = 5))
    # Plot the two points to see the smoothing effect
    plot(sits_merge(point_ndvi, point_sg))

[Package sits version 0.15.0 Index]