parent
5b941443f1
commit
fe7b166df1
@ -1,29 +0,0 @@
|
|||||||
language: go
|
|
||||||
go:
|
|
||||||
- "1.7"
|
|
||||||
- "1.8"
|
|
||||||
- "1.9"
|
|
||||||
- "1.10"
|
|
||||||
- "1.11"
|
|
||||||
- "1.12"
|
|
||||||
- "1.13"
|
|
||||||
- "1.14"
|
|
||||||
- "1.15"
|
|
||||||
- "1.16"
|
|
||||||
- stable
|
|
||||||
- master
|
|
||||||
arch:
|
|
||||||
- amd64
|
|
||||||
- arm64
|
|
||||||
before_install:
|
|
||||||
- go get github.com/mattn/goveralls
|
|
||||||
script:
|
|
||||||
- go test -v -covermode=count -coverprofile=coverage.out
|
|
||||||
after_success:
|
|
||||||
- $GOPATH/bin/goveralls -coverprofile=coverage.out -service=travis-ci
|
|
||||||
notifications:
|
|
||||||
email:
|
|
||||||
recipients:
|
|
||||||
- montana@montanaflynn.me
|
|
||||||
on_success: change
|
|
||||||
on_failure: always
|
|
@ -1,598 +1,521 @@
|
|||||||
|
<a name="unreleased"></a>
|
||||||
|
## [Unreleased]
|
||||||
|
|
||||||
<a name="v0.6.6"></a>
|
|
||||||
## [v0.6.6](https://github.com/montanaflynn/stats/compare/v0.6.5...v0.6.6) (2021-04-26)
|
|
||||||
|
|
||||||
|
<a name="v0.7.0"></a>
|
||||||
|
## [v0.7.0] - 2023-01-08
|
||||||
### Add
|
### Add
|
||||||
|
- Add geometric distribution functions ([#75](https://github.com/montanaflynn/stats/issues/75))
|
||||||
|
- Add GitHub action go workflow
|
||||||
|
|
||||||
* Add support for string and io.Reader in LoadRawData (pr [#68](https://github.com/montanaflynn/stats/issues/68))
|
### Remove
|
||||||
* Add latest versions of Go to test against
|
- Remove travis CI config
|
||||||
|
|
||||||
### Use
|
|
||||||
|
|
||||||
* Use math.Sqrt in StandardDeviation (PR [#64](https://github.com/montanaflynn/stats/issues/64))
|
|
||||||
|
|
||||||
|
### Update
|
||||||
|
- Update changelog with v0.7.0 changes
|
||||||
|
- Update github action go workflow
|
||||||
|
- Update geometric distribution tests
|
||||||
|
|
||||||
<a name="v0.6.5"></a>
|
|
||||||
## [v0.6.5](https://github.com/montanaflynn/stats/compare/v0.6.4...v0.6.5) (2021-02-21)
|
|
||||||
|
|
||||||
|
<a name="v0.6.6"></a>
|
||||||
|
## [v0.6.6] - 2021-04-26
|
||||||
### Add
|
### Add
|
||||||
|
- Add support for string and io.Reader in LoadRawData (pr [#68](https://github.com/montanaflynn/stats/issues/68))
|
||||||
* Add Float64Data.Quartiles documentation
|
- Add latest versions of Go to test against
|
||||||
|
|
||||||
### Update
|
### Update
|
||||||
|
- Update changelog with v0.6.6 changes
|
||||||
|
|
||||||
* Update changelog with v0.6.5 changes
|
### Use
|
||||||
|
- Use math.Sqrt in StandardDeviation (PR [#64](https://github.com/montanaflynn/stats/issues/64))
|
||||||
|
|
||||||
<a name="v0.6.4"></a>
|
|
||||||
## [v0.6.4](https://github.com/montanaflynn/stats/compare/v0.6.3...v0.6.4) (2021-02-21)
|
|
||||||
|
|
||||||
|
<a name="v0.6.5"></a>
|
||||||
|
## [v0.6.5] - 2021-02-21
|
||||||
### Add
|
### Add
|
||||||
|
- Add Float64Data.Quartiles documentation
|
||||||
* Add Quartiles method to Float64Data type (issue [#60](https://github.com/montanaflynn/stats/issues/60))
|
- Add Quartiles method to Float64Data type (issue [#60](https://github.com/montanaflynn/stats/issues/60))
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
- Fix make release changelog command and add changelog history
|
||||||
* Fix make release changelog command and add changelog history
|
|
||||||
* Fix failing tests due to precision errors on arm64 ([#58](https://github.com/montanaflynn/stats/issues/58))
|
|
||||||
|
|
||||||
### Update
|
### Update
|
||||||
|
- Update changelog with v0.6.5 changes
|
||||||
|
- Update changelog with v0.6.4 changes
|
||||||
|
- Update README.md links to CHANGELOG.md and DOCUMENTATION.md
|
||||||
|
- Update README.md and Makefile with new release commands
|
||||||
|
|
||||||
* Update changelog with v0.6.4 changes
|
|
||||||
* Update README.md links to CHANGELOG.md and DOCUMENTATION.md
|
|
||||||
* Update README.md and Makefile with new release commands
|
|
||||||
* Update changelog with v0.6.4 changes
|
|
||||||
* Update examples directory to include a README.md used for synopsis
|
|
||||||
* Update go.mod to include go version where modules are enabled by default
|
|
||||||
* Update changelog with v0.6.3 changes
|
|
||||||
|
|
||||||
|
<a name="v0.6.4"></a>
|
||||||
|
## [v0.6.4] - 2021-01-13
|
||||||
|
### Fix
|
||||||
|
- Fix failing tests due to precision errors on arm64 ([#58](https://github.com/montanaflynn/stats/issues/58))
|
||||||
|
|
||||||
<a name="v0.6.3"></a>
|
### Update
|
||||||
## [v0.6.3](https://github.com/montanaflynn/stats/compare/v0.6.2...v0.6.3) (2020-02-18)
|
- Update changelog with v0.6.4 changes
|
||||||
|
- Update examples directory to include a README.md used for synopsis
|
||||||
|
- Update go.mod to include go version where modules are enabled by default
|
||||||
|
- Update changelog with v0.6.3 changes
|
||||||
|
|
||||||
### Add
|
|
||||||
|
|
||||||
* Add creating and committing changelog to Makefile release directive
|
<a name="v0.6.3"></a>
|
||||||
* Add release-notes.txt and .chglog directory to .gitignore
|
## [v0.6.3] - 2020-02-18
|
||||||
|
### Add
|
||||||
|
- Add creating and committing changelog to Makefile release directive
|
||||||
|
- Add release-notes.txt and .chglog directory to .gitignore
|
||||||
|
|
||||||
### Update
|
### Update
|
||||||
|
- Update exported tests to use import for better example documentation
|
||||||
* Update exported tests to use import for better example documentation
|
- Update documentation using godoc2md
|
||||||
* Update documentation using godoc2md
|
- Update changelog with v0.6.2 release
|
||||||
* Update changelog with v0.6.2 release
|
|
||||||
|
|
||||||
|
|
||||||
<a name="v0.6.2"></a>
|
<a name="v0.6.2"></a>
|
||||||
## [v0.6.2](https://github.com/montanaflynn/stats/compare/v0.6.1...v0.6.2) (2020-02-18)
|
## [v0.6.2] - 2020-02-18
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
- Fix linting errcheck warnings in go benchmarks
|
||||||
* Fix linting errcheck warnings in go benchmarks
|
|
||||||
|
|
||||||
### Update
|
### Update
|
||||||
|
- Update Makefile release directive to use correct release name
|
||||||
* Update Makefile release directive to use correct release name
|
|
||||||
|
|
||||||
|
|
||||||
<a name="v0.6.1"></a>
|
<a name="v0.6.1"></a>
|
||||||
## [v0.6.1](https://github.com/montanaflynn/stats/compare/v0.6.0...v0.6.1) (2020-02-18)
|
## [v0.6.1] - 2020-02-18
|
||||||
|
|
||||||
### Add
|
### Add
|
||||||
|
- Add StableSample function signature to readme
|
||||||
* Add StableSample function signature to readme
|
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
- Fix linting warnings for normal distribution functions formatting and tests
|
||||||
* Fix linting warnings for normal distribution functions formatting and tests
|
|
||||||
|
|
||||||
### Update
|
### Update
|
||||||
|
- Update documentation links and rename DOC.md to DOCUMENTATION.md
|
||||||
* Update documentation links and rename DOC.md to DOCUMENTATION.md
|
- Update README with link to pkg.go.dev reference and release section
|
||||||
* Update README with link to pkg.go.dev reference and release section
|
- Update Makefile with new changelog, docs, and release directives
|
||||||
* Update Makefile with new changelog, docs, and release directives
|
- Update DOC.md links to GitHub source code
|
||||||
* Update DOC.md links to GitHub source code
|
- Update doc.go comment and add DOC.md package reference file
|
||||||
* Update doc.go comment and add DOC.md package reference file
|
- Update changelog using git-chglog
|
||||||
* Update changelog using git-chglog
|
|
||||||
|
|
||||||
|
|
||||||
<a name="v0.6.0"></a>
|
<a name="v0.6.0"></a>
|
||||||
## [v0.6.0](https://github.com/montanaflynn/stats/compare/v0.5.0...v0.6.0) (2020-02-17)
|
## [v0.6.0] - 2020-02-17
|
||||||
|
|
||||||
### Add
|
### Add
|
||||||
|
- Add Normal Distribution Functions ([#56](https://github.com/montanaflynn/stats/issues/56))
|
||||||
* Add Normal Distribution Functions ([#56](https://github.com/montanaflynn/stats/issues/56))
|
- Add previous versions of Go to travis CI config
|
||||||
* Add previous versions of Go to travis CI config
|
- Add check for distinct values in Mode function ([#51](https://github.com/montanaflynn/stats/issues/51))
|
||||||
* Add check for distinct values in Mode function ([#51](https://github.com/montanaflynn/stats/issues/51))
|
- Add StableSample function ([#48](https://github.com/montanaflynn/stats/issues/48))
|
||||||
* Add StableSample function ([#48](https://github.com/montanaflynn/stats/issues/48))
|
- Add doc.go file to show description and usage on godoc.org
|
||||||
* Add doc.go file to show description and usage on godoc.org
|
- Add comments to new error and legacy error variables
|
||||||
* Add comments to new error and legacy error variables
|
- Add ExampleRound function to tests
|
||||||
* Add ExampleRound function to tests
|
- Add go.mod file for module support
|
||||||
* Add go.mod file for module support
|
- Add Sigmoid, SoftMax and Entropy methods and tests
|
||||||
* Add Sigmoid, SoftMax and Entropy methods and tests
|
- Add Entropy documentation, example and benchmarks
|
||||||
* Add Entropy documentation, example and benchmarks
|
- Add Entropy function ([#44](https://github.com/montanaflynn/stats/issues/44))
|
||||||
* Add Entropy function ([#44](https://github.com/montanaflynn/stats/issues/44))
|
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
- Fix percentile when only one element ([#47](https://github.com/montanaflynn/stats/issues/47))
|
||||||
* Fix percentile when only one element ([#47](https://github.com/montanaflynn/stats/issues/47))
|
- Fix AutoCorrelation name in comments and remove unneeded Sprintf
|
||||||
* Fix AutoCorrelation name in comments and remove unneeded Sprintf
|
|
||||||
|
|
||||||
### Improve
|
### Improve
|
||||||
|
- Improve documentation section with command comments
|
||||||
* Improve documentation section with command comments
|
|
||||||
|
|
||||||
### Remove
|
### Remove
|
||||||
|
- Remove very old versions of Go in travis CI config
|
||||||
* Remove very old versions of Go in travis CI config
|
- Remove boolean comparison to get rid of gometalinter warning
|
||||||
* Remove boolean comparison to get rid of gometalinter warning
|
|
||||||
|
|
||||||
### Update
|
### Update
|
||||||
|
- Update license dates
|
||||||
* Update license dates
|
- Update Distance functions signatures to use Float64Data
|
||||||
* Update Distance functions signatures to use Float64Data
|
- Update Sigmoid examples
|
||||||
* Update Sigmoid examples
|
- Update error names with backward compatibility
|
||||||
* Update error names with backward compatibility
|
|
||||||
|
|
||||||
### Use
|
### Use
|
||||||
|
- Use relative link to examples/main.go
|
||||||
* Use relative link to examples/main.go
|
- Use a single var block for exported errors
|
||||||
* Use a single var block for exported errors
|
|
||||||
|
|
||||||
|
|
||||||
<a name="v0.5.0"></a>
|
<a name="v0.5.0"></a>
|
||||||
## [v0.5.0](https://github.com/montanaflynn/stats/compare/v0.4.0...v0.5.0) (2019-01-16)
|
## [v0.5.0] - 2019-01-16
|
||||||
|
|
||||||
### Add
|
### Add
|
||||||
|
- Add Sigmoid and Softmax functions
|
||||||
* Add Sigmoid and Softmax functions
|
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
- Fix syntax highlighting and add CumulativeSum func
|
||||||
* Fix syntax highlighting and add CumulativeSum func
|
|
||||||
|
|
||||||
|
|
||||||
<a name="v0.4.0"></a>
|
<a name="v0.4.0"></a>
|
||||||
## [v0.4.0](https://github.com/montanaflynn/stats/compare/0.3.0...v0.4.0) (2019-01-14)
|
## [v0.4.0] - 2019-01-14
|
||||||
|
|
||||||
### Add
|
### Add
|
||||||
|
- Add goreport badge and documentation section to README.md
|
||||||
* Add goreport badge and documentation section to README.md
|
- Add Examples to test files
|
||||||
* Add Examples to test files
|
- Add AutoCorrelation and nist tests
|
||||||
* Add AutoCorrelation and nist tests
|
- Add String method to statsErr type
|
||||||
* Add String method to statsErr type
|
- Add Y coordinate error for ExponentialRegression
|
||||||
* Add Y coordinate error for ExponentialRegression
|
- Add syntax highlighting ([#43](https://github.com/montanaflynn/stats/issues/43))
|
||||||
* Add syntax highlighting ([#43](https://github.com/montanaflynn/stats/issues/43))
|
- Add CumulativeSum ([#40](https://github.com/montanaflynn/stats/issues/40))
|
||||||
* Add CumulativeSum ([#40](https://github.com/montanaflynn/stats/issues/40))
|
- Add more tests and rename distance files
|
||||||
* Add more tests and rename distance files
|
- Add coverage and benchmarks to azure pipeline
|
||||||
* Add coverage and benchmarks to azure pipeline
|
- Add go tests to azure pipeline
|
||||||
* Add go tests to azure pipeline
|
|
||||||
|
|
||||||
### Change
|
### Change
|
||||||
|
- Change travis tip alias to master
|
||||||
* Change travis tip alias to master
|
- Change codecov to coveralls for code coverage
|
||||||
* Change codecov to coveralls for code coverage
|
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
- Fix a few lint warnings
|
||||||
* Fix a few lint warnings
|
- Fix example error
|
||||||
* Fix example error
|
|
||||||
|
|
||||||
### Improve
|
### Improve
|
||||||
|
- Improve test coverage of distance functions
|
||||||
* Improve test coverage of distance functions
|
|
||||||
|
|
||||||
### Only
|
### Only
|
||||||
|
- Only run travis on stable and tip versions
|
||||||
* Only run travis on stable and tip versions
|
- Only check code coverage on tip
|
||||||
* Only check code coverage on tip
|
|
||||||
|
|
||||||
### Remove
|
### Remove
|
||||||
|
- Remove azure CI pipeline
|
||||||
* Remove azure CI pipeline
|
- Remove unnecessary type conversions
|
||||||
* Remove unnecessary type conversions
|
|
||||||
|
|
||||||
### Return
|
### Return
|
||||||
|
- Return EmptyInputErr instead of EmptyInput
|
||||||
* Return EmptyInputErr instead of EmptyInput
|
|
||||||
|
|
||||||
### Set
|
### Set
|
||||||
|
- Set up CI with Azure Pipelines
|
||||||
* Set up CI with Azure Pipelines
|
|
||||||
|
|
||||||
|
|
||||||
<a name="0.3.0"></a>
|
<a name="0.3.0"></a>
|
||||||
## [0.3.0](https://github.com/montanaflynn/stats/compare/0.2.0...0.3.0) (2017-12-02)
|
## [0.3.0] - 2017-12-02
|
||||||
|
|
||||||
### Add
|
### Add
|
||||||
|
- Add Chebyshev, Manhattan, Euclidean and Minkowski distance functions ([#35](https://github.com/montanaflynn/stats/issues/35))
|
||||||
* Add Chebyshev, Manhattan, Euclidean and Minkowski distance functions ([#35](https://github.com/montanaflynn/stats/issues/35))
|
- Add function for computing chebyshev distance. ([#34](https://github.com/montanaflynn/stats/issues/34))
|
||||||
* Add function for computing chebyshev distance. ([#34](https://github.com/montanaflynn/stats/issues/34))
|
- Add support for time.Duration
|
||||||
* Add support for time.Duration
|
- Add LoadRawData to docs and examples
|
||||||
* Add LoadRawData to docs and examples
|
- Add unit test for edge case that wasn't covered
|
||||||
* Add unit test for edge case that wasn't covered
|
- Add unit tests for edge cases that weren't covered
|
||||||
* Add unit tests for edge cases that weren't covered
|
- Add pearson alias delegating to correlation
|
||||||
* Add pearson alias delegating to correlation
|
- Add CovariancePopulation to Float64Data
|
||||||
* Add CovariancePopulation to Float64Data
|
- Add pearson product-moment correlation coefficient
|
||||||
* Add pearson product-moment correlation coefficient
|
- Add population covariance
|
||||||
* Add population covariance
|
- Add random slice benchmarks
|
||||||
* Add random slice benchmarks
|
- Add all applicable functions as methods to Float64Data type
|
||||||
* Add all applicable functions as methods to Float64Data type
|
- Add MIT license badge
|
||||||
* Add MIT license badge
|
- Add link to examples/methods.go
|
||||||
* Add link to examples/methods.go
|
- Add Protips for usage and documentation sections
|
||||||
* Add Protips for usage and documentation sections
|
- Add tests for rounding up
|
||||||
* Add tests for rounding up
|
- Add webdoc target and remove linting from test target
|
||||||
* Add webdoc target and remove linting from test target
|
- Add example usage and consolidate contributing information
|
||||||
* Add example usage and consolidate contributing information
|
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
- Added MedianAbsoluteDeviation
|
||||||
* Added MedianAbsoluteDeviation
|
|
||||||
|
|
||||||
### Annotation
|
### Annotation
|
||||||
|
- Annotation spelling error
|
||||||
* Annotation spelling error
|
|
||||||
|
|
||||||
### Auto
|
### Auto
|
||||||
|
- auto commit
|
||||||
* auto commit
|
- auto commit
|
||||||
* auto commit
|
|
||||||
|
|
||||||
### Calculate
|
### Calculate
|
||||||
|
- Calculate correlation with sdev and covp
|
||||||
* Calculate correlation with sdev and covp
|
|
||||||
|
|
||||||
### Clean
|
### Clean
|
||||||
|
- Clean up README.md and add info for offline docs
|
||||||
* Clean up README.md and add info for offline docs
|
|
||||||
|
|
||||||
### Consolidated
|
### Consolidated
|
||||||
|
- Consolidated all error values.
|
||||||
* Consolidated all error values.
|
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
- Fix Percentile logic
|
||||||
* Fix Percentile logic
|
- Fix InterQuartileRange method test
|
||||||
* Fix InterQuartileRange method test
|
- Fix zero percent bug and add test
|
||||||
* Fix zero percent bug and add test
|
- Fix usage example output typos
|
||||||
* Fix usage example output typos
|
|
||||||
|
|
||||||
### Improve
|
### Improve
|
||||||
|
- Improve bounds checking in Percentile
|
||||||
* Improve bounds checking in Percentile
|
- Improve error log messaging
|
||||||
* Improve error log messaging
|
|
||||||
|
|
||||||
### Imput
|
### Imput
|
||||||
|
- Imput -> Input
|
||||||
* Imput -> Input
|
|
||||||
|
|
||||||
### Include
|
### Include
|
||||||
|
- Include alternative way to set Float64Data in example
|
||||||
* Include alternative way to set Float64Data in example
|
|
||||||
|
|
||||||
### Make
|
### Make
|
||||||
|
- Make various changes to README.md
|
||||||
* Make various changes to README.md
|
|
||||||
|
|
||||||
### Merge
|
### Merge
|
||||||
|
- Merge branch 'master' of github.com:montanaflynn/stats
|
||||||
* Merge branch 'master' of github.com:montanaflynn/stats
|
- Merge master
|
||||||
* Merge master
|
|
||||||
|
|
||||||
### Mode
|
### Mode
|
||||||
|
- Mode calculation fix and tests
|
||||||
* Mode calculation fix and tests
|
|
||||||
|
|
||||||
### Realized
|
### Realized
|
||||||
|
- Realized the obvious efficiency gains of ignoring the unique numbers at the beginning of the slice. Benchmark joy ensued.
|
||||||
* Realized the obvious efficiency gains of ignoring the unique numbers at the beginning of the slice. Benchmark joy ensued.
|
|
||||||
|
|
||||||
### Refactor
|
### Refactor
|
||||||
|
- Refactor testing of Round()
|
||||||
* Refactor testing of Round()
|
- Refactor setting Coordinate y field using Exp in place of Pow
|
||||||
* Refactor setting Coordinate y field using Exp in place of Pow
|
- Refactor Makefile and add docs target
|
||||||
* Refactor Makefile and add docs target
|
|
||||||
|
|
||||||
### Remove
|
### Remove
|
||||||
|
- Remove deep links to types and functions
|
||||||
* Remove deep links to types and functions
|
|
||||||
|
|
||||||
### Rename
|
### Rename
|
||||||
|
- Rename file from types to data
|
||||||
* Rename file from types to data
|
|
||||||
|
|
||||||
### Retrieve
|
### Retrieve
|
||||||
|
- Retrieve InterQuartileRange for the Float64Data.
|
||||||
* Retrieve InterQuartileRange for the Float64Data.
|
|
||||||
|
|
||||||
### Split
|
### Split
|
||||||
|
- Split up stats.go into separate files
|
||||||
* Split up stats.go into separate files
|
|
||||||
|
|
||||||
### Support
|
### Support
|
||||||
|
- Support more types on LoadRawData() ([#36](https://github.com/montanaflynn/stats/issues/36))
|
||||||
* Support more types on LoadRawData() ([#36](https://github.com/montanaflynn/stats/issues/36))
|
|
||||||
|
|
||||||
### Switch
|
### Switch
|
||||||
|
- Switch default and check targets
|
||||||
* Switch default and check targets
|
|
||||||
|
|
||||||
### Update
|
### Update
|
||||||
|
- Update Readme
|
||||||
* Update Readme
|
- Update example methods and some text
|
||||||
* Update example methods and some text
|
- Update README and include Float64Data type method examples
|
||||||
* Update README and include Float64Data type method examples
|
|
||||||
|
|
||||||
### Pull Requests
|
### Pull Requests
|
||||||
|
- Merge pull request [#32](https://github.com/montanaflynn/stats/issues/32) from a-robinson/percentile
|
||||||
* Merge pull request [#32](https://github.com/montanaflynn/stats/issues/32) from a-robinson/percentile
|
- Merge pull request [#30](https://github.com/montanaflynn/stats/issues/30) from montanaflynn/fix-test
|
||||||
* Merge pull request [#30](https://github.com/montanaflynn/stats/issues/30) from montanaflynn/fix-test
|
- Merge pull request [#29](https://github.com/montanaflynn/stats/issues/29) from edupsousa/master
|
||||||
* Merge pull request [#29](https://github.com/montanaflynn/stats/issues/29) from edupsousa/master
|
- Merge pull request [#27](https://github.com/montanaflynn/stats/issues/27) from andrey-yantsen/fix-percentile-out-of-bounds
|
||||||
* Merge pull request [#27](https://github.com/montanaflynn/stats/issues/27) from andrey-yantsen/fix-percentile-out-of-bounds
|
- Merge pull request [#25](https://github.com/montanaflynn/stats/issues/25) from kazhuravlev/patch-1
|
||||||
* Merge pull request [#25](https://github.com/montanaflynn/stats/issues/25) from kazhuravlev/patch-1
|
- Merge pull request [#22](https://github.com/montanaflynn/stats/issues/22) from JanBerktold/time-duration
|
||||||
* Merge pull request [#22](https://github.com/montanaflynn/stats/issues/22) from JanBerktold/time-duration
|
- Merge pull request [#24](https://github.com/montanaflynn/stats/issues/24) from alouche/master
|
||||||
* Merge pull request [#24](https://github.com/montanaflynn/stats/issues/24) from alouche/master
|
- Merge pull request [#21](https://github.com/montanaflynn/stats/issues/21) from brydavis/master
|
||||||
* Merge pull request [#21](https://github.com/montanaflynn/stats/issues/21) from brydavis/master
|
- Merge pull request [#19](https://github.com/montanaflynn/stats/issues/19) from ginodeis/mode-bug
|
||||||
* Merge pull request [#19](https://github.com/montanaflynn/stats/issues/19) from ginodeis/mode-bug
|
- Merge pull request [#17](https://github.com/montanaflynn/stats/issues/17) from Kunde21/master
|
||||||
* Merge pull request [#17](https://github.com/montanaflynn/stats/issues/17) from Kunde21/master
|
- Merge pull request [#3](https://github.com/montanaflynn/stats/issues/3) from montanaflynn/master
|
||||||
* Merge pull request [#3](https://github.com/montanaflynn/stats/issues/3) from montanaflynn/master
|
- Merge pull request [#2](https://github.com/montanaflynn/stats/issues/2) from montanaflynn/master
|
||||||
* Merge pull request [#2](https://github.com/montanaflynn/stats/issues/2) from montanaflynn/master
|
- Merge pull request [#13](https://github.com/montanaflynn/stats/issues/13) from toashd/pearson
|
||||||
* Merge pull request [#13](https://github.com/montanaflynn/stats/issues/13) from toashd/pearson
|
- Merge pull request [#12](https://github.com/montanaflynn/stats/issues/12) from alixaxel/MAD
|
||||||
* Merge pull request [#12](https://github.com/montanaflynn/stats/issues/12) from alixaxel/MAD
|
- Merge pull request [#1](https://github.com/montanaflynn/stats/issues/1) from montanaflynn/master
|
||||||
* Merge pull request [#1](https://github.com/montanaflynn/stats/issues/1) from montanaflynn/master
|
- Merge pull request [#11](https://github.com/montanaflynn/stats/issues/11) from Kunde21/modeMemReduce
|
||||||
* Merge pull request [#11](https://github.com/montanaflynn/stats/issues/11) from Kunde21/modeMemReduce
|
- Merge pull request [#10](https://github.com/montanaflynn/stats/issues/10) from Kunde21/ModeRewrite
|
||||||
* Merge pull request [#10](https://github.com/montanaflynn/stats/issues/10) from Kunde21/ModeRewrite
|
|
||||||
|
|
||||||
|
|
||||||
<a name="0.2.0"></a>
|
<a name="0.2.0"></a>
|
||||||
## [0.2.0](https://github.com/montanaflynn/stats/compare/0.1.0...0.2.0) (2015-10-14)
|
## [0.2.0] - 2015-10-14
|
||||||
|
|
||||||
### Add
|
### Add
|
||||||
|
- Add Makefile with gometalinter, testing, benchmarking and coverage report targets
|
||||||
* Add Makefile with gometalinter, testing, benchmarking and coverage report targets
|
- Add comments describing functions and structs
|
||||||
* Add comments describing functions and structs
|
- Add Correlation func
|
||||||
* Add Correlation func
|
- Add Covariance func
|
||||||
* Add Covariance func
|
- Add tests for new function shortcuts
|
||||||
* Add tests for new function shortcuts
|
- Add StandardDeviation function as a shortcut to StandardDeviationPopulation
|
||||||
* Add StandardDeviation function as a shortcut to StandardDeviationPopulation
|
- Add Float64Data and Series types
|
||||||
* Add Float64Data and Series types
|
|
||||||
|
|
||||||
### Change
|
### Change
|
||||||
|
- Change Sample to return a standard []float64 type
|
||||||
* Change Sample to return a standard []float64 type
|
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
- Fix broken link to Makefile
|
||||||
* Fix broken link to Makefile
|
- Fix broken link and simplify code coverage reporting command
|
||||||
* Fix broken link and simplify code coverage reporting command
|
- Fix go vet warning about printf type placeholder
|
||||||
* Fix go vet warning about printf type placeholder
|
- Fix failing codecov test coverage reporting
|
||||||
* Fix failing codecov test coverage reporting
|
- Fix link to CHANGELOG.md
|
||||||
* Fix link to CHANGELOG.md
|
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Fixed typographical error, changed accomdate to accommodate in README.
|
||||||
* Fixed typographical error, changed accomdate to accommodate in README.
|
|
||||||
|
|
||||||
### Include
|
### Include
|
||||||
|
- Include Variance and StandardDeviation shortcuts
|
||||||
* Include Variance and StandardDeviation shortcuts
|
|
||||||
|
|
||||||
### Pass
|
### Pass
|
||||||
|
- Pass gometalinter
|
||||||
* Pass gometalinter
|
|
||||||
|
|
||||||
### Refactor
|
### Refactor
|
||||||
|
- Refactor Variance function to be the same as population variance
|
||||||
* Refactor Variance function to be the same as population variance
|
|
||||||
|
|
||||||
### Release
|
### Release
|
||||||
|
- Release version 0.2.0
|
||||||
* Release version 0.2.0
|
|
||||||
|
|
||||||
### Remove
|
### Remove
|
||||||
|
- Remove unneeded do packages and update cover URL
|
||||||
* Remove unneeded do packages and update cover URL
|
- Remove sudo from pip install
|
||||||
* Remove sudo from pip install
|
|
||||||
|
|
||||||
### Reorder
|
### Reorder
|
||||||
|
- Reorder functions and sections
|
||||||
* Reorder functions and sections
|
|
||||||
|
|
||||||
### Revert
|
### Revert
|
||||||
|
- Revert to legacy containers to preserve go1.1 testing
|
||||||
* Revert to legacy containers to preserve go1.1 testing
|
|
||||||
|
|
||||||
### Switch
|
### Switch
|
||||||
|
- Switch from legacy to container-based CI infrastructure
|
||||||
* Switch from legacy to container-based CI infrastructure
|
|
||||||
|
|
||||||
### Update
|
### Update
|
||||||
|
- Update contributing instructions and mention Makefile
|
||||||
* Update contributing instructions and mention Makefile
|
|
||||||
|
|
||||||
### Pull Requests
|
### Pull Requests
|
||||||
|
- Merge pull request [#5](https://github.com/montanaflynn/stats/issues/5) from orthographic-pedant/spell_check/accommodate
|
||||||
* Merge pull request [#5](https://github.com/montanaflynn/stats/issues/5) from orthographic-pedant/spell_check/accommodate
|
|
||||||
|
|
||||||
|
|
||||||
<a name="0.1.0"></a>
|
<a name="0.1.0"></a>
|
||||||
## [0.1.0](https://github.com/montanaflynn/stats/compare/0.0.9...0.1.0) (2015-08-19)
|
## [0.1.0] - 2015-08-19
|
||||||
|
|
||||||
### Add
|
### Add
|
||||||
|
- Add CONTRIBUTING.md
|
||||||
* Add CONTRIBUTING.md
|
|
||||||
|
|
||||||
### Rename
|
### Rename
|
||||||
|
- Rename functions while preserving backwards compatibility
|
||||||
* Rename functions while preserving backwards compatibility
|
|
||||||
|
|
||||||
|
|
||||||
<a name="0.0.9"></a>
|
<a name="0.0.9"></a>
|
||||||
## 0.0.9 (2015-08-18)
|
## 0.0.9 - 2015-08-18
|
||||||
|
|
||||||
### Add
|
### Add
|
||||||
|
- Add HarmonicMean func
|
||||||
* Add HarmonicMean func
|
- Add GeometricMean func
|
||||||
* Add GeometricMean func
|
- Add .gitignore to avoid commiting test coverage report
|
||||||
* Add .gitignore to avoid commiting test coverage report
|
- Add Outliers stuct and QuantileOutliers func
|
||||||
* Add Outliers stuct and QuantileOutliers func
|
- Add Interquartile Range, Midhinge and Trimean examples
|
||||||
* Add Interquartile Range, Midhinge and Trimean examples
|
- Add Trimean
|
||||||
* Add Trimean
|
- Add Midhinge
|
||||||
* Add Midhinge
|
- Add Inter Quartile Range
|
||||||
* Add Inter Quartile Range
|
- Add a unit test to check for an empty slice error
|
||||||
* Add a unit test to check for an empty slice error
|
- Add Quantiles struct and Quantile func
|
||||||
* Add Quantiles struct and Quantile func
|
- Add more tests and fix a typo
|
||||||
* Add more tests and fix a typo
|
- Add Golang 1.5 to build tests
|
||||||
* Add Golang 1.5 to build tests
|
- Add a standard MIT license file
|
||||||
* Add a standard MIT license file
|
- Add basic benchmarking
|
||||||
* Add basic benchmarking
|
- Add regression models
|
||||||
* Add regression models
|
- Add codecov token
|
||||||
* Add codecov token
|
- Add codecov
|
||||||
* Add codecov
|
- Add check for slices with a single item
|
||||||
* Add check for slices with a single item
|
- Add coverage tests
|
||||||
* Add coverage tests
|
- Add back previous Go versions to Travis CI
|
||||||
* Add back previous Go versions to Travis CI
|
- Add Travis CI
|
||||||
* Add Travis CI
|
- Add GoDoc badge
|
||||||
* Add GoDoc badge
|
- Add Percentile and Float64ToInt functions
|
||||||
* Add Percentile and Float64ToInt functions
|
- Add another rounding test for whole numbers
|
||||||
* Add another rounding test for whole numbers
|
- Add build status badge
|
||||||
* Add build status badge
|
- Add code coverage badge
|
||||||
* Add code coverage badge
|
- Add test for NaN, achieving 100% code coverage
|
||||||
* Add test for NaN, achieving 100% code coverage
|
- Add round function
|
||||||
* Add round function
|
- Add standard deviation function
|
||||||
* Add standard deviation function
|
- Add sum function
|
||||||
* Add sum function
|
|
||||||
|
|
||||||
### Add
|
### Add
|
||||||
|
- add tests for sample
|
||||||
* add tests for sample
|
- add sample
|
||||||
* add sample
|
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
- Added sample and population variance and deviation functions
|
||||||
* Added sample and population variance and deviation functions
|
- Added README
|
||||||
* Added README
|
|
||||||
|
|
||||||
### Adjust
|
### Adjust
|
||||||
|
- Adjust API ordering
|
||||||
* Adjust API ordering
|
|
||||||
|
|
||||||
### Avoid
|
### Avoid
|
||||||
|
- Avoid unintended consequence of using sort
|
||||||
* Avoid unintended consequence of using sort
|
|
||||||
|
|
||||||
### Better
|
### Better
|
||||||
|
- Better performing min/max
|
||||||
* Better performing min/max
|
- Better description
|
||||||
* Better description
|
|
||||||
|
|
||||||
### Change
|
### Change
|
||||||
|
- Change package path to potentially fix a bug in earlier versions of Go
|
||||||
* Change package path to potentially fix a bug in earlier versions of Go
|
|
||||||
|
|
||||||
### Clean
|
### Clean
|
||||||
|
- Clean up README and add some more information
|
||||||
* Clean up README and add some more information
|
- Clean up test error
|
||||||
* Clean up test error
|
|
||||||
|
|
||||||
### Consistent
|
### Consistent
|
||||||
|
- Consistent empty slice error messages
|
||||||
* Consistent empty slice error messages
|
- Consistent var naming
|
||||||
* Consistent var naming
|
- Consistent func declaration
|
||||||
* Consistent func declaration
|
|
||||||
|
|
||||||
### Convert
|
### Convert
|
||||||
|
- Convert ints to floats
|
||||||
* Convert ints to floats
|
|
||||||
|
|
||||||
### Duplicate
|
### Duplicate
|
||||||
|
- Duplicate packages for all versions
|
||||||
* Duplicate packages for all versions
|
|
||||||
|
|
||||||
### Export
|
### Export
|
||||||
|
- Export Coordinate struct fields
|
||||||
* Export Coordinate struct fields
|
|
||||||
|
|
||||||
### First
|
### First
|
||||||
|
- First commit
|
||||||
* First commit
|
|
||||||
|
|
||||||
### Fix
|
### Fix
|
||||||
|
- Fix copy pasta mistake testing the wrong function
|
||||||
* Fix copy pasta mistake testing the wrong function
|
- Fix error message
|
||||||
* Fix error message
|
- Fix usage output and edit API doc section
|
||||||
* Fix usage output and edit API doc section
|
- Fix testing edgecase where map was in wrong order
|
||||||
* Fix testing edgecase where map was in wrong order
|
- Fix usage example
|
||||||
* Fix usage example
|
- Fix usage examples
|
||||||
* Fix usage examples
|
|
||||||
|
|
||||||
### Include
|
### Include
|
||||||
|
- Include the Nearest Rank method of calculating percentiles
|
||||||
* Include the Nearest Rank method of calculating percentiles
|
|
||||||
|
|
||||||
### More
|
### More
|
||||||
|
- More commenting
|
||||||
* More commenting
|
|
||||||
|
|
||||||
### Move
|
### Move
|
||||||
|
- Move GoDoc link to top
|
||||||
* Move GoDoc link to top
|
|
||||||
|
|
||||||
### Redirect
|
### Redirect
|
||||||
|
- Redirect kills newer versions of Go
|
||||||
* Redirect kills newer versions of Go
|
|
||||||
|
|
||||||
### Refactor
|
### Refactor
|
||||||
|
- Refactor code and error checking
|
||||||
* Refactor code and error checking
|
|
||||||
|
|
||||||
### Remove
|
### Remove
|
||||||
|
- Remove unnecassary typecasting in sum func
|
||||||
* Remove unnecassary typecasting in sum func
|
- Remove cover since it doesn't work for later versions of go
|
||||||
* Remove cover since it doesn't work for later versions of go
|
- Remove golint and gocoveralls
|
||||||
* Remove golint and gocoveralls
|
|
||||||
|
|
||||||
### Rename
|
### Rename
|
||||||
|
- Rename StandardDev to StdDev
|
||||||
* Rename StandardDev to StdDev
|
- Rename StandardDev to StdDev
|
||||||
* Rename StandardDev to StdDev
|
|
||||||
|
|
||||||
### Return
|
### Return
|
||||||
|
- Return errors for all functions
|
||||||
* Return errors for all functions
|
|
||||||
|
|
||||||
### Run
|
### Run
|
||||||
|
- Run go fmt to clean up formatting
|
||||||
* Run go fmt to clean up formatting
|
|
||||||
|
|
||||||
### Simplify
|
### Simplify
|
||||||
|
- Simplify min/max function
|
||||||
* Simplify min/max function
|
|
||||||
|
|
||||||
### Start
|
### Start
|
||||||
|
- Start with minimal tests
|
||||||
* Start with minimal tests
|
|
||||||
|
|
||||||
### Switch
|
### Switch
|
||||||
|
- Switch wercker to travis and update todos
|
||||||
* Switch wercker to travis and update todos
|
|
||||||
|
|
||||||
### Table
|
### Table
|
||||||
|
- table testing style
|
||||||
* table testing style
|
|
||||||
|
|
||||||
### Update
|
### Update
|
||||||
|
- Update README and move the example main.go into it's own file
|
||||||
* Update README and move the example main.go into it's own file
|
- Update TODO list
|
||||||
* Update TODO list
|
- Update README
|
||||||
* Update README
|
- Update usage examples and todos
|
||||||
* Update usage examples and todos
|
|
||||||
|
|
||||||
### Use
|
### Use
|
||||||
|
- Use codecov the recommended way
|
||||||
* Use codecov the recommended way
|
- Use correct string formatting types
|
||||||
* Use correct string formatting types
|
|
||||||
|
|
||||||
### Pull Requests
|
### Pull Requests
|
||||||
|
- Merge pull request [#4](https://github.com/montanaflynn/stats/issues/4) from saromanov/sample
|
||||||
* Merge pull request [#4](https://github.com/montanaflynn/stats/issues/4) from saromanov/sample
|
|
||||||
|
|
||||||
|
[Unreleased]: https://github.com/montanaflynn/stats/compare/v0.7.0...HEAD
|
||||||
|
[v0.7.0]: https://github.com/montanaflynn/stats/compare/v0.6.6...v0.7.0
|
||||||
|
[v0.6.6]: https://github.com/montanaflynn/stats/compare/v0.6.5...v0.6.6
|
||||||
|
[v0.6.5]: https://github.com/montanaflynn/stats/compare/v0.6.4...v0.6.5
|
||||||
|
[v0.6.4]: https://github.com/montanaflynn/stats/compare/v0.6.3...v0.6.4
|
||||||
|
[v0.6.3]: https://github.com/montanaflynn/stats/compare/v0.6.2...v0.6.3
|
||||||
|
[v0.6.2]: https://github.com/montanaflynn/stats/compare/v0.6.1...v0.6.2
|
||||||
|
[v0.6.1]: https://github.com/montanaflynn/stats/compare/v0.6.0...v0.6.1
|
||||||
|
[v0.6.0]: https://github.com/montanaflynn/stats/compare/v0.5.0...v0.6.0
|
||||||
|
[v0.5.0]: https://github.com/montanaflynn/stats/compare/v0.4.0...v0.5.0
|
||||||
|
[v0.4.0]: https://github.com/montanaflynn/stats/compare/0.3.0...v0.4.0
|
||||||
|
[0.3.0]: https://github.com/montanaflynn/stats/compare/0.2.0...0.3.0
|
||||||
|
[0.2.0]: https://github.com/montanaflynn/stats/compare/0.1.0...0.2.0
|
||||||
|
[0.1.0]: https://github.com/montanaflynn/stats/compare/0.0.9...0.1.0
|
||||||
|
@ -0,0 +1,42 @@
|
|||||||
|
package stats
|
||||||
|
|
||||||
|
import (
|
||||||
|
"math"
|
||||||
|
)
|
||||||
|
|
||||||
|
// ProbGeom generates the probability for a geometric random variable
|
||||||
|
// with parameter p to achieve success in the interval of [a, b] trials
|
||||||
|
// See https://en.wikipedia.org/wiki/Geometric_distribution for more information
|
||||||
|
func ProbGeom(a int, b int, p float64) (prob float64, err error) {
|
||||||
|
if (a > b) || (a < 1) {
|
||||||
|
return math.NaN(), ErrBounds
|
||||||
|
}
|
||||||
|
|
||||||
|
prob = 0
|
||||||
|
q := 1 - p // probability of failure
|
||||||
|
|
||||||
|
for k := a + 1; k <= b; k++ {
|
||||||
|
prob = prob + p*math.Pow(q, float64(k-1))
|
||||||
|
}
|
||||||
|
|
||||||
|
return prob, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProbGeom generates the expectation or average number of trials
|
||||||
|
// for a geometric random variable with parameter p
|
||||||
|
func ExpGeom(p float64) (exp float64, err error) {
|
||||||
|
if (p > 1) || (p < 0) {
|
||||||
|
return math.NaN(), ErrNegative
|
||||||
|
}
|
||||||
|
|
||||||
|
return 1 / p, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// ProbGeom generates the variance for number for a
|
||||||
|
// geometric random variable with parameter p
|
||||||
|
func VarGeom(p float64) (exp float64, err error) {
|
||||||
|
if (p > 1) || (p < 0) {
|
||||||
|
return math.NaN(), ErrNegative
|
||||||
|
}
|
||||||
|
return (1 - p) / math.Pow(p, 2), nil
|
||||||
|
}
|
Loading…
Reference in new issue