237 Commits

Author SHA1 Message Date
Fumin
a9119bd313 distuv: add non-central t distribution 2025-11-02 11:43:05 +10:30
Shieldine
672aa59ec6 stat: implement Wasserstein distance calculation 2025-04-23 07:35:14 +09:30
Sebastien Binet
4408afacd1 stat: add an example to compute a confidence interval
This CL adds an example showing how to compute the confidence
interval of the mean for a small sample.

Signed-off-by: Sebastien Binet <binet@cern.ch>
2025-03-31 09:53:22 +02:00
Dan Kortschak
bc349ecfab all: replace internal rand shim with math/rand/v2 2025-02-01 22:18:04 +10:30
Dan Kortschak
cf3307fa63 all: partially migrate to math/rand/v2
This is not intended to be a completed transition since it leaves the
libraries unusable to external client code, but rather as a step towards
use of math/rand/v2. This initial step allows repair of sequence change
failures without having to worry about API difference.
2025-02-01 22:18:04 +10:30
Dan Kortschak
f42c07e8cb all: fix typos 2025-01-01 08:26:48 +10:30
argusdusty
1dd194f95b stat/distuv: correct Gamma Mode doc comment 2024-06-12 18:09:49 +09:30
argusdusty
35bb474ac5 stat/distuv: correct Gamma Mode() and LogProb(0)/Prob(0) for alpha <= 1 2024-06-12 18:09:49 +09:30
Jonathan Bluett-Duncan
d0ddef96f2 stat: replace custom reverse logic with slices.Reverse 2024-05-11 21:50:29 +09:30
Jonathan Bluett-Duncan
7708557332 stat: add benchmarks for ROC 2024-05-11 21:50:29 +09:30
kindhuge
91de1fff89 spatial/r3,stat: remove repeated words in comments 2024-04-07 04:58:03 +09:30
Eng Zer Jun
e44948ca04 all: replace min/max helpers with min/max builtins 2024-04-06 20:24:32 +10:30
Vladimir Chalupecky
606793d439 stat/distmv: add EigenSym interface 2023-10-24 12:38:34 +02:00
Vladimir Chalupecky
ff24a548a0 stat/distmv: add special case in NormalRandCov for mat.EigenSym 2023-10-24 12:38:34 +02:00
Vladimir Chalupecky
7c4c9d2eac stat/distmv: clean up reuse of output slices 2023-10-10 10:02:53 +02:00
Vladimir Chalupecky
f560d5cba2 stat/distmv: add NormalRandCov
Closes #1717
2023-10-10 10:02:53 +02:00
Jes Cok
bd727a9e14 all: fix typos 2023-07-16 13:37:17 +09:30
Bulat Khasanov
59e6100a8c stat/sampleuv: fix oob panic in Weighted.Take due to accumulated float errors 2023-06-20 13:14:34 +09:30
Chris Nobody
45b800a8c6 all: add pkg.go.dev reference README badges
As discussed during the review of the immediately preceding changesets.
2023-03-16 06:40:50 +10:30
Chris Nobody
f040f6bd07 all: replace godoc.org README badges with godocs.io ones
The links have been redirecting to `pkg.go.dev` for a while now. In the
case of the main README, that made the badge a virtual duplicate of the
"go.dev reference" one.
2023-03-16 06:40:50 +10:30
ynm3n
9b1a85bc89 stat/combin: fix typos
The four functions explained by the modified comments panic if n or k
of parameters are "negative", not "non-negative".
2022-10-27 16:35:48 +10:30
Dan Kortschak
a4dda6a99c all: make tests pass when -count is greater than 1
Tests run repeatedly do not reinitialise state, meaning that a second run
of the tests will have leftover state from the previous run. This ensures
that repeated runs are identical with the exception of map iteration order.
2022-08-06 15:52:53 +09:30
Dan Kortschak
5f0141ca4c all: run gofmt and generate all packages
Changes made in dsp/fourier/internal/fftpack break the formatting used
there, so these are reverted. There will be complaints in CI.

[git-generate]
gofmt -w .
go generate gonum.org/v1/gonum/blas
go generate gonum.org/v1/gonum/blas/gonum
go generate gonum.org/v1/gonum/unit
go generate gonum.org/v1/gonum/unit/constant
go generate gonum.org/v1/gonum/graph/formats/dot
go generate gonum.org/v1/gonum/graph/formats/rdf
go generate gonum.org/v1/gonum/stat/card

git checkout -- dsp/fourier/internal/fftpack
2022-08-06 07:05:17 +09:30
Dan Kortschak
d8ad7756b6 all: fix spelling and typos 2022-03-14 21:32:06 +10:30
gudvinr
855d38ebe8 stat/distuv: add logistic distribution 2021-11-04 19:38:21 +10:30
Argusdusty
ce6167c3f2 stat/distuv: improve Pareto.Rand performance, also adding Pareto.Rand benchmark 2021-09-20 06:39:06 +09:30
Vladimir Chalupecky
5c9be58381 mat,stat: refer to SymmetricDim in docs 2021-09-11 23:11:30 +02:00
Dan Kortschak
3d32334f97 mat: rename Symmetric method to SymmetricDim 2021-08-23 07:02:27 +09:30
Dan Kortschak
85ca8969b8 all: remove or clarify repeated words in comments 2021-08-08 16:39:38 +09:30
tekulvw
5155b5f60e stat: correct slope/offset in ExampleLinearRegression 2021-07-02 16:33:46 +09:30
Dan Kortschak
0acd6516a6 stat/distuv: add chi distribution 2021-06-11 19:40:21 +09:30
Dan Kortschak
086421b9b6 stat/disuv: make helpers and disambiguate case indexes 2021-06-11 18:10:45 +09:30
Dan Kortschak
571f6ffe3c stat: explicitly panic when calling CDF with empty x 2021-05-21 18:19:16 +09:30
Dan Kortschak
87c72c1b85 stat: explicitly panic when calling Quantile with empty x 2021-05-21 18:19:16 +09:30
Dan Kortschak
03398562de all: clean up lint identified by ruleguard
Ruleguard run with ruleguard -c=0 -rules ruleguard.rules.go ./... from
https://github.com/dgryski/semgrep-go with the following rules inactivated
to reduce noise:

- unconvert for floating point values
- oddcomparisons
- floateq
2021-05-19 05:44:58 +09:30
Dan Kortschak
60db4fc847 stat: fix TOC formula in documentation 2021-04-13 06:59:28 +09:30
Dan Kortschak
11e9fee16c stat: add TOC function 2021-04-12 18:31:26 +09:30
Vladimir Chalupecky
3c19fa0bbc stat/mds: adjust expectation in TorgersonScaling test 2021-03-20 09:49:59 +01:00
Vladimir Chalupecky
7a88995ca8 lapack/gonum: rewrite Dlartg to use safe scaling from https://doi.org/10.1145/3061665 2021-03-20 09:49:59 +01:00
Dan Kortschak
163f1af942 stat/mds: add warning about ED numerical stability 2021-03-17 20:51:41 +10:30
Dan Kortschak
42babc578e stat: bring ROC doc comment into line with logic inversion
This was missed in 50ee437.
2021-02-23 19:25:12 +10:30
Roman Werpachowski
aeb04daafe stat: add population (biased) variants of Variance, StdDev, MeanVariance and MeanStdDev (#1570)
* Add population (biased) variants of Variance, StdDev, MeanVariance and
MeanStdDev.
* Add my employer as copyright owner.
2021-02-21 11:04:30 +01:00
Dan Kortschak
4dcdeab5d5 stat: add panic notice to ROC and fix typo 2021-02-10 17:53:25 +10:30
Lyron Winderbaum
8c54bb4d20 stat: fix ROC cutoffs 2021-02-08 16:03:02 +10:30
Dan Kortschak
3b44281dc5 stat/samplemv: don't let Halton overflow on 32 bit architectures 2020-11-26 10:17:13 +10:30
Dan Kortschak
1f99927858 stat/distuv: don't use global rand state for test 2020-10-21 09:51:28 +10:30
Dan Kortschak
bd0b526fee mat: fix GrowSym behaviour for Reset matrices
Also fix CovarianceMatrix benchmarks in stat that found this.
2020-10-08 18:25:37 +10:30
Dan Kortschak
cf53c4b1dd stat: fix typo 2020-10-08 09:06:01 +10:30
Mark Canning
5aa97b339c stat/distuv: improve Poisson.Rand performance for Lambda >= 10
name                old time/op  new time/op  delta
PoissonRand/case_0   297ns ± 5%    76ns ±10%  -74.56%  (p=0.000 n=10+10)
PoissonRand/case_1   284ns ± 6%   107ns ± 7%  -62.21%  (p=0.000 n=10+10)
PoissonRand/case_2   284ns ± 6%   118ns ± 4%  -58.34%  (p=0.000 n=10+10)
PoissonRand/case_3   236ns ± 3%   239ns ± 6%     ~     (p=0.381 n=10+10)
PoissonRand/case_4   105ns ± 6%   107ns ± 8%     ~     (p=0.236 n=10+10)
PoissonRand/case_5  73.8ns ± 4%  75.1ns ± 4%     ~     (p=0.148 n=10+10)
PoissonRand/case_6  60.3ns ± 5%  60.9ns ± 5%     ~     (p=0.307 n=10+10)
2020-09-21 20:08:50 +02:00
Mark Canning
abbcebec78 stat/distuv: improve Gamma.Rand performances for 0.2 <= alpha < 1
The paper cited in the comment for the a > 1 (now a >= smallAlphaThresh) case mentions this approach as a small note on the final page, so there is no need to update the comments.

I also looked into numpy's logic for this case, but a) couldn't determine a source for it, except for what appears to be a more complex variant (Algorithm GS), and b) it's slightly slower than this method, at least for a >= 0.2.

benchstat:

```
name              old time/op  new time/op  delta
GammaRand/case_0  89.4ns ± 5%  90.2ns ± 3%     ~     (p=0.084 n=20+20)
GammaRand/case_1   212ns ± 3%   101ns ± 5%  -52.28%  (p=0.000 n=20+20)
GammaRand/case_2  25.4ns ± 3%  25.3ns ± 4%     ~     (p=0.369 n=20+20)
GammaRand/case_3  48.6ns ± 6%  48.8ns ± 6%     ~     (p=0.702 n=20+20)
GammaRand/case_4  47.1ns ± 6%  47.6ns ± 3%     ~     (p=0.147 n=20+20)
```
2020-09-18 14:34:07 +02:00