Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined: stats.MedianAbsoluteDeviationPopulation #38

Closed
yildirim opened this issue May 22, 2018 · 7 comments
Closed

undefined: stats.MedianAbsoluteDeviationPopulation #38

yildirim opened this issue May 22, 2018 · 7 comments

Comments

@yildirim
Copy link

yildirim commented May 22, 2018

Hi,

I am not able to use the MedianAbsoluteDeviationPopulation function,

If I use "go doc", I do not see all functions:
$ go doc stats

package stats // import "github.com/zizmos/ego/vendor/github.com/montanaflynn/stats"

func Correlation(data1, data2 Float64Data) (float64, error)
func Covariance(data1, data2 Float64Data) (float64, error)
func GeometricMean(input Float64Data) (float64, error)
func HarmonicMean(input Float64Data) (float64, error)
func InterQuartileRange(input Float64Data) (float64, error)
func Max(input Float64Data) (max float64, err error)
func Mean(input Float64Data) (float64, error)
func Median(input Float64Data) (median float64, err error)
func Midhinge(input Float64Data) (float64, error)
func Min(input Float64Data) (min float64, err error)
func Mode(input Float64Data) (mode []float64, err error)
func Percentile(input Float64Data, percent float64) (percentile float64, err error)
func PercentileNearestRank(input Float64Data, percent float64) (percentile float64, err error)
func PopulationVariance(input Float64Data) (pvar float64, err error)
func Round(input float64, places int) (rounded float64, err error)
func Sample(input Float64Data, takenum int, replacement bool) ([]float64, error)
func SampleVariance(input Float64Data) (svar float64, err error)
func StandardDeviation(input Float64Data) (sdev float64, err error)
func StandardDeviationPopulation(input Float64Data) (sdev float64, err error)
func StandardDeviationSample(input Float64Data) (sdev float64, err error)
func StdDevP(input Float64Data) (sdev float64, err error)
func StdDevS(input Float64Data) (sdev float64, err error)
func Sum(input Float64Data) (sum float64, err error)
func Trimean(input Float64Data) (float64, error)
func VarP(input Float64Data) (sdev float64, err error)
func VarS(input Float64Data) (sdev float64, err error)
func Variance(input Float64Data) (sdev float64, err error)
type Coordinate struct{ ... }
func ExpReg(s []Coordinate) (regressions []Coordinate, err error)
func LinReg(s []Coordinate) (regressions []Coordinate, err error)
func LogReg(s []Coordinate) (regressions []Coordinate, err error)
type Float64Data []float64
type Outliers struct{ ... }
func QuartileOutliers(input Float64Data) (Outliers, error)
type Quartiles struct{ ... }
func Quartile(input Float64Data) (Quartiles, error)
type Series []Coordinate
func ExponentialRegression(s Series) (regressions Series, err error)
func LinearRegression(s Series) (regressions Series, err error)
func LogarithmicRegression(s Series) (regressions Series, err error)

However, MedianAbsoluteDeviationPopulation function is a public function in the implementation.
$go version
go version go1.10.2 darwin/amd64

$dep status
....
....
github.com/montanaflynn/stats ^0.2.0 0.2.0 eeaced0 0.2.0 1
...
...

@montanaflynn
Copy link
Owner

montanaflynn commented May 22, 2018

@yildirim can you try go get -u github.com/montanaflynn/stats which should pull latest code.

Edit: It's likely

package stats // import "github.com/zizmos/ego/vendor/github.com/montanaflynn/stats"

will still be used since it's in the /vendor directory. You should update this with the latest code that includes MedianAbsoluteDeviationPopulation.

Alternatively, after

go get -u github.com/montanaflynn/stats

you can use it directly

import "github.com/montanaflynn/stats"

@yildirim
Copy link
Author

I used dep management tool, and it created the vendor directory. Yes, it is used in there, but if you look at Gopkg.tml (dep management tool create), it shows:

[[constraint]]
name = "github.com/montanaflynn/stats"
version = "0.2.0"

Everything seems fine, I don't understand why this tool didn't generate stats dependency correctly.

@yildirim
Copy link
Author

ls vendor/github.com/montanaflynn/stats/
CHANGELOG.md LICENSE README.md stats.go
CONTRIBUTING.md Makefile legacy.go types.go

ls ~/src/github.com/montanaflynn/stats/
CHANGELOG.md legacy_test.go percentile_test.go
LICENSE load.go quartile.go
Makefile load_test.go quartile_test.go
README.md max.go regression.go
correlation.go max_test.go regression_test.go
correlation_test.go mean.go round.go
data.go mean_test.go round_test.go
data_set_distances.go median.go sample.go
data_set_distances_test.go median_test.go sample_test.go
data_test.go min.go sum.go
deviation.go min_test.go sum_test.go
deviation_test.go mode.go util.go
errors.go mode_test.go util_test.go
errors_test.go outlier.go variance.go
examples outlier_test.go variance_test.go
legacy.go percentile.go

@montanaflynn
Copy link
Owner

montanaflynn commented May 22, 2018

The problem is version 0.2.0 did not have MedianAbsoluteDeviationPopulation.

Related to #37 and #8 (comment) I need to release a new version. I will do that soon. In the meantime replace ./vendor/github.com/montanaflynn/stats/ with ~/src/github.com/montanaflynn/stats/ to have the latest code.

@yildirim
Copy link
Author

I guess that "dep init" and "dep ensure" messed it up. After that, I have to do
"dep ensure -update github.com/montanaflynn/stats". This fixed the problem.

@yildirim
Copy link
Author

Thanks for help

@montanaflynn
Copy link
Owner

I added a new tag 0.3.0 with the latest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants