New: GoStats -- Descriptive Statistics and Linear Regression

2,228 views
Skip to first unread message

GaryBoone

unread,
Jun 20, 2011, 12:01:26 AM6/20/11
to golang-nuts

Stats is a descriptive statistics and linear regression package for
Go. It provides:

• Descriptive Statistics: count, sum, min, max, mean, variance,
standard deviation, skew, and kurtosis
• Univariate Linear Regression: slope, intercept, r-squared, count,
slope standard error, intercept standard error
• Incremental updates: the stats and regression can be updated one or
a few at a time.
• Batch updates: Calculate stats and regression only for the given
array of values.
• Population and sample statistics included

Incremental updates are useful for streaming data applications or
situations in which storing the data for statistics is prohibitive. In
fact, if the data is stored only for the purpose of statistical
calculations, incremental updates make storage unnecessary.

The package includes convenience functions that allow incremental
updates by single or multiple values. Or you can use traditional batch
calculations on a given array of values. The linear regression
functions also include incremental and batch updates.

The code is here:

https://github.com/GaryBoone/GoStats

I've uploaded it to the Go Dashboard at

http://godashboard.appspot.com/package

Code reviews and comments welcome.

Thanks,
Gary

Bob Hancock

unread,
Sep 7, 2011, 3:03:14 PM9/7/11
to golan...@googlegroups.com
I don't see it on the dashboard.  Has it been removed?

peterGo

unread,
Sep 7, 2011, 3:35:21 PM9/7/11
to golang-nuts
Bob,

No.

Mathematics

GoStats - Descriptive statistics and linear regression for Go

http://godashboard.appspot.com/project

Peter

Bob Hancock

unread,
Sep 7, 2011, 10:42:06 PM9/7/11
to golan...@googlegroups.com
Got it. Thanks.

Anh Hai Trinh

unread,
Sep 7, 2011, 11:05:10 PM9/7/11
to GaryBoone, golang-nuts
Thanks for making this, I am soon in need of it :)

This description is incorrect:

// These are non-incremental functions that operate only on the data given them
// They're prefixed with 'Calc'

Looks like you mean prefixed with "Stats"?


Also, do we need both of these?

func (d *Stats) Count() int {
return int(d.n)
}

func (d *Stats) Size() int {
return int(d.n)
}

--
@chickamade

Samuel Lampa

unread,
Apr 24, 2014, 12:19:34 PM4/24/14
to golan...@googlegroups.com
Good news!

Btw, any p-value implementation in the plans? ... or do you know someone else who implemented it?
(Specifically, I'm looking for an alternative to the "phyper" function in R).

Best
// Samuel
Reply all
Reply to author
Forward
0 new messages