Documentation ¶
Overview ¶
Package polyfit models a polynomial y from sample points xs and ys, to minimizes the squared residuals.
See https://en.wikipedia.org/wiki/Least_squares#Linear_least_squares
Since 0.5.4
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fitting ¶
Fitting models a polynomial y from sample points xs and ys, to minimizes the squared residuals. It returns coefficients of the polynomial y:
y = β₁ + β₂x + β₃x² + ...
It use linear regression, which assumes y is in form of:
m y = ∑ βⱼ Φⱼ(x) j=1
In our case:
Φⱼ(x) = x^(j-1)
Then
(Xᵀ × X) βⱼ = Xᵀ × Y Xᵢⱼ = [ Φⱼ(xᵢ) ]
See https://en.wikipedia.org/wiki/Least_squares#Linear_least_squares
Since 0.5.4
func (*Fitting) Merge ¶
Merge Combines two sets of sample data.
This can be done because:
|X₁|ᵀ × |X₁| = X₁ᵀ × X₁ + X₂ᵀ × X₂ |X₂| |X₂|
Since 0.5.4
Click to show internal directories.
Click to hide internal directories.