metric

package
v0.0.0-...-583d1ee Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mean

func Mean(values []float64) float64

Mean calculates the arithmetic mean of the values.

func Payoff

func Payoff(values []float64) float64

Payoff calculates the ratio of average wins to average losses. Returns the absolute value of the ratio.

func ProfitFactor

func ProfitFactor(values []float64) float64

ProfitFactor calculates the ratio of total profits to total losses. Returns the absolute value of the ratio.

Types

type BootstrapInterval

type BootstrapInterval struct {
	Lower  float64 // Lower bound of the confidence interval
	Upper  float64 // Upper bound of the confidence interval
	StdDev float64 // Standard deviation of the bootstrap samples
	Mean   float64 // Mean of the bootstrap samples
}

BootstrapInterval represents the confidence interval calculated by the bootstrap method.

func Bootstrap

func Bootstrap(values []float64, measure func([]float64) float64, sampleSize int,
	confidence float64) BootstrapInterval

Bootstrap calculates the confidence interval of a sample using the bootstrap method. Parameters:

  • values: The original sample data
  • measure: The statistical function to apply to each bootstrap sample
  • sampleSize: Number of bootstrap samples to generate
  • confidence: Confidence level (e.g., 0.95 for 95% confidence)

Jump to

Keyboard shortcuts

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