fn.variance & fn.stdev - flag population/sample #51

Open
trevnorris opened this Issue Jun 7, 2012 · 4 comments

Comments

Projects
None yet
2 participants
@trevnorris
Member

trevnorris commented Jun 7, 2012

In the static methods for variance() and stdev() a flag can be passed to indicate whether to compute the population or the sample for matrices. This cannot be done for the instance methods. Though it should be implemented.

@jamescgibson

This comment has been minimized.

Show comment
Hide comment
@jamescgibson

jamescgibson Sep 2, 2014

Contributor

Is this still an issue? I'm having trouble finding any distinction in the source, but this is an old issue.

This may not be the best place to discuss this, but is passing flags the best way to handle sample/population distinctions? I'm sure there is plenty of code that depends on it, so it would be bad to break existing code, but creating a populationStdDev() and sampleStdDev() could be a lot more readable in code that calls jStat than a flag.

Contributor

jamescgibson commented Sep 2, 2014

Is this still an issue? I'm having trouble finding any distinction in the source, but this is an old issue.

This may not be the best place to discuss this, but is passing flags the best way to handle sample/population distinctions? I'm sure there is plenty of code that depends on it, so it would be bad to break existing code, but creating a populationStdDev() and sampleStdDev() could be a lot more readable in code that calls jStat than a flag.

@trevnorris

This comment has been minimized.

Show comment
Hide comment
@trevnorris

trevnorris Sep 3, 2014

Member

@jamescgibson That's a good point on having separate function calls. Though the *StdDev part turns me off. Purely aesthetics though. What you propose is more functional. Go ahead and PR it if you want. :)

Member

trevnorris commented Sep 3, 2014

@jamescgibson That's a good point on having separate function calls. Though the *StdDev part turns me off. Purely aesthetics though. What you propose is more functional. Go ahead and PR it if you want. :)

@jamescgibson

This comment has been minimized.

Show comment
Hide comment
@jamescgibson

jamescgibson Sep 3, 2014

Contributor

Would populationStandardDeviation() and sampleStandardDeviation() be better? Or something else entirely?

I am actually mostly a Ruby developer and am not an expert on JavaScript naming best practice. I just think that flags tend to be a little hard to understand when called by other code.

Contributor

jamescgibson commented Sep 3, 2014

Would populationStandardDeviation() and sampleStandardDeviation() be better? Or something else entirely?

I am actually mostly a Ruby developer and am not an expert on JavaScript naming best practice. I just think that flags tend to be a little hard to understand when called by other code.

@trevnorris

This comment has been minimized.

Show comment
Hide comment
@trevnorris

trevnorris Sep 3, 2014

Member

@jamescgibson AHHH!!! no no. I like short names. ;-)

Member

trevnorris commented Sep 3, 2014

@jamescgibson AHHH!!! no no. I like short names. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment