stats

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package stats registers MCP tools that compute aggregates over arrays of numbers. Implementations come from gonum/stat and gonum/floats.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(s *mcp.Server)

Register adds all stats tools to the server.

Types

type ArrayIn

type ArrayIn struct {
	Values []float64 `json:"values" jsonschema:"the data points to aggregate (must be non-empty)"`
}

ArrayIn is the input shape for tools that take a single array of values.

type CorrelationIn

type CorrelationIn struct {
	X []float64 `json:"x" jsonschema:"first series; must be non-empty and same length as y"`
	Y []float64 `json:"y" jsonschema:"second series; must be non-empty and same length as x"`
}

CorrelationIn is the input for the Pearson correlation tool.

type CorrelationOut

type CorrelationOut struct {
	Function string    `json:"function"`
	N        int       `json:"n"`
	X        []float64 `json:"x"`
	Y        []float64 `json:"y"`
	Result   float64   `json:"result" jsonschema:"Pearson correlation coefficient in [-1, 1]"`
}

CorrelationOut is the output for the Pearson correlation tool.

type PercentileIn

type PercentileIn struct {
	Values     []float64 `json:"values" jsonschema:"the data points to aggregate (must be non-empty)"`
	Percentile float64   `json:"percentile" jsonschema:"the percentile to compute, in [0, 100]"`
}

PercentileIn is the input for percentile queries.

type Result

type Result struct {
	Function string    `json:"function" jsonschema:"name of the aggregate that was computed"`
	N        int       `json:"n" jsonschema:"number of input values"`
	Inputs   []float64 `json:"inputs" jsonschema:"the input array (echoed back)"`
	Result   float64   `json:"result" jsonschema:"computed aggregate value"`
}

Result is the output shape for stats tools.

Jump to

Keyboard shortcuts

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