Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cdf ¶
Return the x array sorted and the y array containing empirical CDF value foreach x's value. len(x)=len(y)
Example ¶
sortedX := []float64{2.5, 2.98, 3, 3, 3.14, 5, 10} x, y := Cdf(sortedX) for i := range x { fmt.Println("x:", x[i], "y:", y[i]) }
Output: x: 2.5 y: 0.14285714285714285 x: 2.98 y: 0.2857142857142857 x: 3 y: 0.5714285714285714 x: 3 y: 0.5714285714285714 x: 3.14 y: 0.7142857142857143 x: 5 y: 0.8571428571428571 x: 10 y: 1
Types ¶
type RegressionModel ¶
type RegressionModel struct {
Intercept, Slope float64
}
Model is a LinearRegression model
func Fit ¶
func Fit(x, y []float64) *RegressionModel
Fit return a Model structure fitted with alpha and beta of a LinearRegression applied on x. Y is the CDF value
func (*RegressionModel) Predict ¶
func (m *RegressionModel) Predict(x float64) (predCDF float64)
Predict the CDF result of a given x
Click to show internal directories.
Click to hide internal directories.