lowess

package
v0.27.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Lowess

type Lowess struct {
	X            []float64 // X data (ie. Capacity)
	Y            []float64 // Y data (ie. Voltage)
	Z            []float64 // intermediate smoothing result (ie. previous iteration)
	Result       []float64 // final smoothing reuslt (ie. latest iteration)
	Iterations   int       // number of iterations
	Points       int       // Lowess window size = 2 * Points
	Lowesswindow           // Calculated values for Lowess window
}

func NewLowess

func NewLowess(x, y []float64, frac float64, iterations int) *Lowess

Does the local weighted scatterplot smoothing using linear regression. Based on article 'Robust Locally Weighted Regression and Smoothing Scatterplots' by William S. Cleveland 1979 frac determines how much data is used for a single linear regression. If frac <=1, it takes the given fraction of the total number of data points, rounded down If frac > 1, then the value is the actual number of points used in the given Iterations tells how many times the y weighting is done. If 0, y weighting is not done. Result is given as l.Result NOTE: Function assumes x to be in ascending order !!

func (*Lowess) Solve

func (l *Lowess) Solve() []float64

Executes Lowess smoothing. NOTE: Special case: If the median of the residuals is 0, then the weight is 1.

type Lowesswindow

type Lowesswindow struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL