StdErr

function StdErr(int std, int sampleSize, uint8 precision) returns the standard error in the mean

function StdErr(int std, int sampleSize, uint8 precision) external returns (int)

Precision representes the number of decimal places between 0 and 18. It is applied to x, weights and the output. Under the hood, the following functions are utilized directly in the Neural client.

func (con *NeuralMath) StdErr(gas *big.Int, std, sampleSize *big.Int, precision uint8) (*big.Int, error, *big.Int) {
	mul, err := validatePrecision(precision)
	if err != nil {
		return nil, err, nil
	}
	stdf, err := toFloat(std, mul)
	if err != nil {
		return nil, err, nil
	}
	szf, err := toFloat(sampleSize, mul)
	if err != nil {
		return nil, err, nil
	}
	stdErr := stat.StdErr(stdf, szf)
	return toBig(stdErr, mul), nil, nil
}

Last updated