stats

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: MIT Imports: 19 Imported by: 1

Documentation

Overview

`stats` package provides functions for statistical analysis.

Index

Constants

View Source
const (
	KNNUniformWeighting  KNNWeighting = "uniform"
	KNNDistanceWeighting KNNWeighting = "distance"

	KNNAuto       KNNAlgorithm = "auto"
	KNNBruteForce KNNAlgorithm = "brute"
	KNNKDTree     KNNAlgorithm = "kd_tree"
	KNNBallTree   KNNAlgorithm = "ball_tree"
)

Variables

This section is empty.

Functions

func BartlettSphericity added in v0.2.2

func BartlettSphericity(dataTable insyra.IDataTable) (chiSquare float64, pValue float64, df int, err error)

BartlettSphericity performs Bartlett's test of sphericity.

func CalculateMoment added in v0.0.3

func CalculateMoment(dl insyra.IDataList, n int, central bool) (float64, error)

CalculateMoment calculates the n-th moment of the DataList. If central is true, it computes the central moment; otherwise, raw moment.

func CorrelationAnalysis added in v0.2.2

func CorrelationAnalysis(dataTable insyra.IDataTable, method CorrelationMethod) (corrMatrix *insyra.DataTable, pMatrix *insyra.DataTable, chiSquare float64, pValue float64, df int, err error)

CorrelationAnalysis calculates correlation matrix, p-value matrix and Bartlett test.

func CorrelationMatrix added in v0.2.2

func CorrelationMatrix(dataTable insyra.IDataTable, method CorrelationMethod) (corrMatrix *insyra.DataTable, pMatrix *insyra.DataTable, err error)

CorrelationMatrix calculates the correlation coefficient matrix and p-value matrix.

Performance notes: extracts every column's float64 slice exactly once (dropping the previous O(C²) ToF64Slice + AtomicDo work), pre-computes per-column ranks for Spearman, then computes the C(C-1)/2 unique pairs in parallel on those cached slices. Result is bit-identical to the previous serial path: the underlying primitives are the same, only the order / granularity of work differs.

func Covariance added in v0.0.4

func Covariance(dlX, dlY insyra.IDataList) (float64, error)

func CutTreeByHeight added in v0.2.17

func CutTreeByHeight(tree *HierarchicalResult, h float64) ([]int, error)

func CutTreeByK added in v0.2.17

func CutTreeByK(tree *HierarchicalResult, k int) ([]int, error)

func Diag added in v0.2.6

func Diag(x any, dims ...int) (any, error)

Diag creates a diagonal matrix or extracts the diagonal of a matrix.

func Kurtosis

func Kurtosis(data any, method ...KurtosisMethod) (float64, error)

Kurtosis calculates the kurtosis of the input data.

func Skewness added in v0.0.3

func Skewness(sample any, method ...SkewnessMethod) (float64, error)

Skewness calculates the skewness of a sample using the specified method.

Types

type ANOVAResultComponent added in v0.2.0

type ANOVAResultComponent struct {
	SumOfSquares float64
	DF           int
	F            float64
	P            float64
	EtaSquared   float64
}

type AgglomerativeMethod added in v0.2.17

type AgglomerativeMethod string
const (
	AggloComplete AgglomerativeMethod = "complete"
	AggloSingle   AgglomerativeMethod = "single"
	AggloAverage  AgglomerativeMethod = "average"
	AggloWardD    AgglomerativeMethod = "ward.D"
	AggloWardD2   AgglomerativeMethod = "ward.D2"
	AggloMcQuitty AgglomerativeMethod = "mcquitty"
	AggloMedian   AgglomerativeMethod = "median"
	AggloCentroid AgglomerativeMethod = "centroid"
)

type AlternativeHypothesis added in v0.2.0

type AlternativeHypothesis string
const (
	TwoSided AlternativeHypothesis = "two-sided"
	Greater  AlternativeHypothesis = "greater"
	Less     AlternativeHypothesis = "less"
)

type BartlettTestResult added in v0.2.6

type BartlettTestResult struct {
	ChiSquare        float64 // Chi-square statistic
	DegreesOfFreedom int     // Degrees of freedom
	PValue           float64 // P-value
	SampleSize       int     // Sample size
}

BartlettTestResult contains the results of Bartlett's test of sphericity

type ChiSquareTestResult added in v0.0.6

type ChiSquareTestResult struct {

	// a DataTable representing the contingency table([2]float64{observed, expected})
	ContingencyTable *insyra.DataTable
	// contains filtered or unexported fields
}

func ChiSquareGoodnessOfFit added in v0.2.0

func ChiSquareGoodnessOfFit(input insyra.IDataList, p []float64, rescaleP bool) (*ChiSquareTestResult, error)

ChiSquareGoodnessOfFit performs a one-dimensional chi-square goodness of fit test.

input: A DataList containing categorical data (e.g., ["A", "B", "A"]). p: Expected probabilities (e.g., []float64{0.5, 0.5}). If nil, assumes uniform distribution. rescaleP: Whether to rescale p to sum to 1.

func ChiSquareIndependenceTest added in v0.2.0

func ChiSquareIndependenceTest(rowData, colData insyra.IDataList) (*ChiSquareTestResult, error)

ChiSquareIndependenceTest performs a chi-square test of independence.

func (*ChiSquareTestResult) Show added in v0.2.6

func (r *ChiSquareTestResult) Show()

type CorrelationMethod added in v0.0.4

type CorrelationMethod int

CorrelationMethod specifies which correlation coefficient to compute.

const (
	PearsonCorrelation CorrelationMethod = iota
	KendallCorrelation
	SpearmanCorrelation
)

type CorrelationResult added in v0.2.0

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

func Correlation added in v0.0.4

func Correlation(dlX, dlY insyra.IDataList, method CorrelationMethod) (*CorrelationResult, error)

Correlation calculates correlation between two IDataLists.

type DBSCANOptions added in v0.2.17

type DBSCANOptions struct {
	BorderPoints *bool
}

type DBSCANResult added in v0.2.17

type DBSCANResult struct {
	Cluster []int
	IsSeed  []bool
}

func DBSCAN added in v0.2.17

func DBSCAN(dataTable insyra.IDataTable, eps float64, minPts int, opts ...DBSCANOptions) (*DBSCANResult, error)

type EffectSizeEntry added in v0.2.0

type EffectSizeEntry struct {
	Type  string  // "cohen_d", "hedges_g", "glass_delta", etc.
	Value float64 // Effect size value
}

type ExponentialRegressionResult added in v0.2.2

type ExponentialRegressionResult struct {
	Intercept              float64
	Slope                  float64
	Residuals              []float64
	RSquared               float64
	AdjustedRSquared       float64
	StandardErrorIntercept float64
	StandardErrorSlope     float64
	TValueIntercept        float64
	TValueSlope            float64
	PValueIntercept        float64
	PValueSlope            float64

	ConfidenceIntervalIntercept [2]float64
	ConfidenceIntervalSlope     [2]float64
}

ExponentialRegressionResult holds the result of exponential regression y = a*e^(b*x).

func ExponentialRegression added in v0.2.2

func ExponentialRegression(dlY, dlX insyra.IDataList) (*ExponentialRegressionResult, error)

ExponentialRegression performs y = a*e^(b*x) regression.

type FTestResult added in v0.0.6

type FTestResult struct {
	DF2 float64 // degree of freedom for the second group
	// contains filtered or unexported fields
}

func BartlettTest added in v0.2.0

func BartlettTest(groups []insyra.IDataList) (*FTestResult, error)

BartlettTest performs Bartlett's test for equality of variances.

func FTestForNestedModels added in v0.2.0

func FTestForNestedModels(rssReduced, rssFull float64, dfReduced, dfFull int) (*FTestResult, error)

FTestForNestedModels compares two nested regression models.

func FTestForRegression added in v0.2.0

func FTestForRegression(ssr, sse float64, df1, df2 int) (*FTestResult, error)

FTestForRegression performs an overall F-test for a regression model.

func FTestForVarianceEquality added in v0.0.6

func FTestForVarianceEquality(data1, data2 insyra.IDataList) (*FTestResult, error)

FTestForVarianceEquality performs an F-test for variance equality.

func LeveneTest added in v0.2.0

func LeveneTest(groups []insyra.IDataList) (*FTestResult, error)

LeveneTest performs Levene's test for equality of variances across groups.

type FactorAnalysisOptions added in v0.2.6

type FactorAnalysisOptions struct {
	Count      FactorCountSpec
	Extraction FactorExtractionMethod
	Rotation   FactorRotationOptions
	Scoring    FactorScoreMethod
	MaxIter    int     // Optional: default 100
	MinErr     float64 // Optional: default 0.001 (R's min.err)

	// OptimFactr controls the L-BFGS-B convergence tolerance used by ML
	// and MINRES factor extraction: the optimizer terminates when the
	// relative function change drops below OptimFactr * machine epsilon.
	// Defaults to 1e7 (≈2.2e-9 absolute), matching R psych::fa /
	// stats::optim's "moderate accuracy" default. Use 1 for machine
	// precision (≈2.2e-16) when you want the true stationary point on
	// near-Heywood / flat objective surfaces; the default terminates
	// prematurely on those problems and settles at a non-stationary
	// boundary point. Use 1e12 for low precision (faster).
	OptimFactr float64

	// OptimMaxIter caps L-BFGS-B iterations for ML / MINRES extraction.
	// Defaults to 100 (matching R stats::optim default). Increase for
	// ill-conditioned problems where the optimizer would otherwise hit
	// the iteration cap before converging.
	OptimMaxIter int
}

FactorAnalysisOptions contains all options for factor analysis

func DefaultFactorAnalysisOptions added in v0.2.6

func DefaultFactorAnalysisOptions() FactorAnalysisOptions

DefaultFactorAnalysisOptions returns default options for factor analysis. Defaults align with R's psych::fa function defaults.

type FactorAnalysisResult added in v0.2.6

type FactorAnalysisResult struct {
	Loadings             insyra.IDataTable   // Loading matrix (variables x factors)
	UnrotatedLoadings    insyra.IDataTable   // Unrotated loading matrix (variables x factors)
	Structure            insyra.IDataTable   // Structure matrix (variables x factors)
	Uniquenesses         insyra.IDataTable   // Uniqueness vector (p x 1)
	Communalities        insyra.IDataTable   // Communality table (p x 1: Extraction)
	SamplingAdequacy     insyra.IDataTable   // KMO overall index and per-variable MSA values
	BartlettTest         *BartlettTestResult // Bartlett's test of sphericity summary
	Phi                  insyra.IDataTable   // Factor correlation matrix (m x m), nil for orthogonal
	RotationMatrix       insyra.IDataTable   // Rotation matrix (m x m), nil if no rotation
	Eigenvalues          insyra.IDataTable   // Eigenvalues vector (p x 1)
	ExplainedProportion  insyra.IDataTable   // Proportion explained by each factor (m x 1)
	CumulativeProportion insyra.IDataTable   // Cumulative proportion explained (m x 1)
	Scores               insyra.IDataTable   // Factor scores (n x m), nil if not computed
	ScoreCoefficients    insyra.IDataTable   // Factor score coefficient matrix (variables x factors)
	ScoreCovariance      insyra.IDataTable   // Factor score covariance matrix (factors x factors)

	Converged         bool
	RotationConverged bool
	Iterations        int
	CountUsed         int
	Messages          []string
}

FactorAnalysisResult contains the output of factor analysis

func (*FactorAnalysisResult) Show added in v0.2.6

func (r *FactorAnalysisResult) Show(startEndRange ...any)

Show prints everything in the FactorAnalysisResult

type FactorCountMethod added in v0.2.6

type FactorCountMethod string

FactorCountMethod defines the method for determining number of factors

const (
	FactorCountFixed  FactorCountMethod = "fixed"
	FactorCountKaiser FactorCountMethod = "kaiser"
)

type FactorCountSpec added in v0.2.6

type FactorCountSpec struct {
	Method         FactorCountMethod
	FixedK         int     // Optional: used when Method is CountFixed
	EigenThreshold float64 // Optional: default 1.0 for CountKaiser
	MaxFactors     int     // Optional: 0 means no limit
}

FactorCountSpec specifies how to determine the number of factors

type FactorExtractionMethod added in v0.2.6

type FactorExtractionMethod string

FactorExtractionMethod defines the method for extracting factors. See Docs/stats.md (Factor Analysis - Extraction Methods) for algorithmic details.

const (
	FactorExtractionPCA    FactorExtractionMethod = "pca"
	FactorExtractionPAF    FactorExtractionMethod = "paf"
	FactorExtractionML     FactorExtractionMethod = "ml"
	FactorExtractionMINRES FactorExtractionMethod = "minres"
)

type FactorModel added in v0.2.6

type FactorModel struct {
	FactorAnalysisResult
}

FactorModel holds the factor analysis model

func FactorAnalysis added in v0.2.6

func FactorAnalysis(dt insyra.IDataTable, opt FactorAnalysisOptions) (*FactorModel, error)

FactorAnalysis performs factor analysis on a DataTable.

type FactorRotationMethod added in v0.2.6

type FactorRotationMethod string

FactorRotationMethod defines the method for rotating factors. Rotation families and their properties are documented in Docs/stats.md.

const (
	FactorRotationNone      FactorRotationMethod = "none"
	FactorRotationVarimax   FactorRotationMethod = "varimax"
	FactorRotationQuartimax FactorRotationMethod = "quartimax"
	FactorRotationQuartimin FactorRotationMethod = "quartimin"
	FactorRotationOblimin   FactorRotationMethod = "oblimin"
	FactorRotationGeominT   FactorRotationMethod = "geominT"
	FactorRotationBentlerT  FactorRotationMethod = "bentlerT"
	FactorRotationSimplimax FactorRotationMethod = "simplimax"
	FactorRotationGeominQ   FactorRotationMethod = "geominQ"
	FactorRotationBentlerQ  FactorRotationMethod = "bentlerQ"
	FactorRotationPromax    FactorRotationMethod = "promax"
)

type FactorRotationOptions added in v0.2.6

type FactorRotationOptions struct {
	Method           FactorRotationMethod
	Kappa            float64          // Optional: Promax power (default 4)
	Delta            float64          // Optional: Oblimin gamma (default 0)
	GeominEpsilon    float64          // Optional: Geomin delta (default 0.01)
	Restarts         int              // Optional: random orthonormal starts for GPA rotations (default 10)
	VarimaxAlgorithm VarimaxAlgorithm // Optional: "kaiser" (psych default) or "gparotation"
}

FactorRotationOptions specifies rotation parameters

type FactorScoreMethod added in v0.2.6

type FactorScoreMethod string

FactorScoreMethod defines the method for computing factor scores. Scoring equations and trade-offs are outlined in Docs/stats.md.

const (
	FactorScoreNone          FactorScoreMethod = "none"
	FactorScoreRegression    FactorScoreMethod = "regression"
	FactorScoreBartlett      FactorScoreMethod = "bartlett"
	FactorScoreAndersonRubin FactorScoreMethod = "anderson-rubin"
)

type HierarchicalResult added in v0.2.17

type HierarchicalResult struct {
	Merge      [][2]int
	Height     []float64
	Order      []int
	Labels     []string
	Method     AgglomerativeMethod
	DistMethod string
}

func HierarchicalAgglomerative added in v0.2.17

func HierarchicalAgglomerative(dataTable insyra.IDataTable, method AgglomerativeMethod) (*HierarchicalResult, error)

type KMeansOptions added in v0.2.17

type KMeansOptions struct {
	NStart  int
	IterMax int
	Seed    *int64
}

type KMeansResult added in v0.2.17

type KMeansResult struct {
	Cluster     []int
	Centers     insyra.IDataTable
	TotSS       float64
	WithinSS    []float64
	TotWithinSS float64
	BetweenSS   float64
	Size        []int
	Iter        int
	IFault      int
}

func KMeans added in v0.2.17

func KMeans(dataTable insyra.IDataTable, centers int, opts ...KMeansOptions) (*KMeansResult, error)

type KNNAlgorithm added in v0.2.17

type KNNAlgorithm string

type KNNClassificationResult added in v0.2.17

type KNNClassificationResult struct {
	Predictions   insyra.IDataList
	Classes       insyra.IDataList
	Probabilities insyra.IDataTable
}

func KNNClassify added in v0.2.17

func KNNClassify(trainData insyra.IDataTable, trainLabels insyra.IDataList, testData insyra.IDataTable, k int, opts ...KNNOptions) (*KNNClassificationResult, error)

type KNNNeighborsResult added in v0.2.17

type KNNNeighborsResult struct {
	Indices   [][]int
	Distances [][]float64
}

func KNearestNeighbors added in v0.2.17

func KNearestNeighbors(trainData insyra.IDataTable, testData insyra.IDataTable, k int, opts ...KNNOptions) (*KNNNeighborsResult, error)

type KNNOptions added in v0.2.17

type KNNOptions struct {
	Weighting KNNWeighting
	Algorithm KNNAlgorithm
	LeafSize  int
}

type KNNRegressionResult added in v0.2.17

type KNNRegressionResult struct {
	Predictions []float64
}

func KNNRegress added in v0.2.17

func KNNRegress(trainData insyra.IDataTable, trainTargets insyra.IDataList, testData insyra.IDataTable, k int, opts ...KNNOptions) (*KNNRegressionResult, error)

type KNNWeighting added in v0.2.17

type KNNWeighting string

type KurtosisMethod added in v0.2.0

type KurtosisMethod int

KurtosisMethod defines available kurtosis calculation methods.

const (
	KurtosisG2           KurtosisMethod = iota + 1 // Type 1: g2 (default)
	KurtosisAdjusted                               // Type 2: adjusted Fisher kurtosis
	KurtosisBiasAdjusted                           // Type 3: bias-adjusted
)

type LinearRegressionResult added in v0.0.4

type LinearRegressionResult struct {
	Slope                  float64
	Intercept              float64
	StandardError          float64
	StandardErrorIntercept float64
	TValue                 float64
	TValueIntercept        float64
	PValue                 float64
	PValueIntercept        float64

	ConfidenceIntervalIntercept [2]float64
	ConfidenceIntervalSlope     [2]float64

	Coefficients        []float64
	StandardErrors      []float64
	TValues             []float64
	PValues             []float64
	ConfidenceIntervals [][2]float64

	Residuals        []float64
	RSquared         float64
	AdjustedRSquared float64
}

LinearRegressionResult holds the result of both simple and multiple linear regression. For simple regression: Coefficients[0] = intercept, Coefficients[1] = slope. For multiple regression: Coefficients[0] = intercept, Coefficients[1:] = slopes.

func LinearRegression added in v0.0.4

func LinearRegression(dlY insyra.IDataList, dlXs ...insyra.IDataList) (*LinearRegressionResult, error)

LinearRegression performs ordinary least-squares linear regression.

type LogarithmicRegressionResult added in v0.2.2

type LogarithmicRegressionResult struct {
	Intercept              float64
	Slope                  float64
	Residuals              []float64
	RSquared               float64
	AdjustedRSquared       float64
	StandardErrorIntercept float64
	StandardErrorSlope     float64
	TValueIntercept        float64
	TValueSlope            float64
	PValueIntercept        float64
	PValueSlope            float64

	ConfidenceIntervalIntercept [2]float64
	ConfidenceIntervalSlope     [2]float64
}

LogarithmicRegressionResult holds the result of logarithmic regression y = a + b*ln(x).

func LogarithmicRegression added in v0.2.2

func LogarithmicRegression(dlY, dlX insyra.IDataList) (*LogarithmicRegressionResult, error)

LogarithmicRegression performs y = a + b*ln(x) regression.

type OneWayANOVAResult added in v0.0.7

type OneWayANOVAResult struct {
	Factor  ANOVAResultComponent
	Within  ANOVAResultComponent
	TotalSS float64
}

func OneWayANOVA added in v0.0.6

func OneWayANOVA(groups ...insyra.IDataList) (*OneWayANOVAResult, error)

type PCAResult added in v0.0.8

type PCAResult struct {
	Components        insyra.IDataTable // component loadings matrix
	Eigenvalues       []float64
	ExplainedVariance []float64
}

PCAResult contains the results of a Principal Component Analysis.

func PCA added in v0.0.8

func PCA(dataTable insyra.IDataTable, nComponents ...int) (*PCAResult, error)

PCA calculates the Principal Component Analysis of a DataTable.

type PolynomialRegressionResult added in v0.2.2

type PolynomialRegressionResult struct {
	Coefficients        []float64
	Degree              int
	Residuals           []float64
	RSquared            float64
	AdjustedRSquared    float64
	StandardErrors      []float64
	TValues             []float64
	PValues             []float64
	ConfidenceIntervals [][2]float64
}

PolynomialRegressionResult holds the result of polynomial regression.

func PolynomialRegression added in v0.2.2

func PolynomialRegression(dlY, dlX insyra.IDataList, degree int) (*PolynomialRegressionResult, error)

PolynomialRegression performs polynomial regression of given degree.

type RepeatedMeasuresANOVAResult added in v0.0.8

type RepeatedMeasuresANOVAResult struct {
	Factor  ANOVAResultComponent
	Subject ANOVAResultComponent
	Within  ANOVAResultComponent
	TotalSS float64
}

func RepeatedMeasuresANOVA added in v0.2.0

func RepeatedMeasuresANOVA(subjects ...insyra.IDataList) (*RepeatedMeasuresANOVAResult, error)

type SilhouettePoint added in v0.2.17

type SilhouettePoint struct {
	Cluster  int
	Neighbor int
	SilWidth float64
}

type SilhouetteResult added in v0.2.17

type SilhouetteResult struct {
	Points            []SilhouettePoint
	AverageSilhouette float64
}

func Silhouette added in v0.2.17

func Silhouette(dataTable insyra.IDataTable, labels insyra.IDataList) (*SilhouetteResult, error)

type SkewnessMethod added in v0.2.0

type SkewnessMethod int

SkewnessMethod defines available skewness calculation methods.

const (
	SkewnessG1           SkewnessMethod = iota + 1 // Type 1: G1 (default)
	SkewnessAdjusted                               // Type 2: Adjusted Fisher-Pearson
	SkewnessBiasAdjusted                           // Type 3: Bias-adjusted
)

type TTestResult added in v0.0.4

type TTestResult struct {
	Mean     *float64 // mean of the first group (or the only group)
	Mean2    *float64 // mean of the second group (nil if not applicable)
	MeanDiff *float64 // mean difference (only for paired t-test)
	N        int      // sample size of the first group (or the only group or paired group)
	N2       *int     // sample size of the second group (nil if not applicable)
	// contains filtered or unexported fields
}

func PairedTTest added in v0.0.4

func PairedTTest(data1, data2 insyra.IDataList, confidenceLevel ...float64) (*TTestResult, error)

PairedTTest performs a paired-samples t-test comparing the means of two related groups. The data must be paired observations (same subjects measured twice). Parameters:

  • data1, data2: The paired data groups to compare (must have same length)
  • confidenceLevel: (Optional) Confidence level for the confidence interval (e.g., 0.95 for 95%, 0.99 for 99%) Must be between 0 and 1. If not provided or invalid, defaults to 0.95

** Verified using R **

func SingleSampleTTest added in v0.0.4

func SingleSampleTTest(data insyra.IDataList, mu float64, confidenceLevel ...float64) (*TTestResult, error)

SingleSampleTTest performs a one-sample t-test comparing the sample mean to a known population mean. Parameters:

  • data: The sample data to test
  • mu: The hypothesized population mean to compare against
  • confidenceLevel: (Optional) Confidence level for the confidence interval (e.g., 0.95 for 95%, 0.99 for 99%) Must be between 0 and 1. If not provided or invalid, defaults to 0.95

** Verified using R **

func TwoSampleTTest added in v0.0.4

func TwoSampleTTest(data1, data2 insyra.IDataList, equalVariance bool, confidenceLevel ...float64) (*TTestResult, error)

TwoSampleTTest performs a two-sample t-test comparing the means of two independent groups. Parameters:

  • data1, data2: The two data groups to compare
  • equalVariance: Whether to assume equal variances between groups
  • confidenceLevel: (Optional) Confidence level for the confidence interval (e.g., 0.95 for 95%, 0.99 for 99%) Must be between 0 and 1. If not provided or invalid, defaults to 0.95

** Verified using R **

type TwoWayANOVAResult added in v0.0.7

type TwoWayANOVAResult struct {
	FactorA     ANOVAResultComponent
	FactorB     ANOVAResultComponent
	Interaction ANOVAResultComponent
	Within      ANOVAResultComponent
	TotalSS     float64
}

func TwoWayANOVA added in v0.2.0

func TwoWayANOVA(factorALevels, factorBLevels int, cells ...insyra.IDataList) (*TwoWayANOVAResult, error)

type VarimaxAlgorithm added in v0.2.6

type VarimaxAlgorithm string

VarimaxAlgorithm specifies which Varimax implementation to use

const (
	VarimaxGPArotation VarimaxAlgorithm = "gparotation" // GPArotation::Varimax
	VarimaxKaiser      VarimaxAlgorithm = "kaiser"      // stats::varimax / psych::fa rotate="varimax"
)

type ZTestResult added in v0.2.0

type ZTestResult struct {
	Mean  float64  // mean of the first group (or the only group)
	Mean2 *float64 // mean of the second group (nil if not applicable)
	N     int      // sample size of the first group (or the only group)
	N2    *int     // sample size of the second group (nil if not applicable)
	// contains filtered or unexported fields
}

func SingleSampleZTest added in v0.2.0

func SingleSampleZTest(data insyra.IDataList, mu float64, sigma float64, alternative AlternativeHypothesis, confidenceLevel float64) (*ZTestResult, error)

func TwoSampleZTest added in v0.2.0

func TwoSampleZTest(data1, data2 insyra.IDataList, sigma1, sigma2 float64, alternative AlternativeHypothesis, confidenceLevel float64) (*ZTestResult, error)

Directories

Path Synopsis
internal
fa
fa/GPArotation_GPFoblq.go
fa/GPArotation_GPFoblq.go
knn
parutil
Package parutil provides lightweight parallel-for primitives used inside the stats package's internal compute paths.
Package parutil provides lightweight parallel-for primitives used inside the stats package's internal compute paths.

Jump to

Keyboard shortcuts

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