Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Smooth ¶
Smooth performs Whittaker-Eilers smoothing on a slice of float64. It applies a smoothing operation to the input data using the given lambda (smoothing parameter), order of differences, and spacing between data points.
Parameters: data - A slice of float64 representing the data to be smoothed. lambda - A float64 representing the smoothing parameter. Higher values increase smoothness. order - An int specifying the order of differences to be used in smoothing. spacing - A slice of float64 representing the spacing between consecutive data points.
Pass nil if the data is equally spaced. In this case, the function assumes a unit spacing.
Returns: A slice of float64 containing the smoothed data. The length of this slice will be the same as the input data. An error is returned if the function encounters issues in creating the penalty matrix or solving the system.
Example: smoothedData, err := Smooth([]float64{1, 2, 3, 4, 5}, 10.0, 2, nil)
if err != nil { // handle error }
fmt.Println(smoothedData) // Output: [Smoothed Data]
Types ¶
This section is empty.