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

odd behavior of TwoSamplesIndependent.probability_not_equal_variance #3

Closed
fauman opened this issue May 2, 2011 · 3 comments
Closed

Comments

@fauman
Copy link

fauman commented May 2, 2011

Seems to give incorrect value. For example:

a=[0,0,0,1,1,1,2,2,2].to_scale
b=[2,2,2,3,3,3,4,4,4].to_scale
t_2 = Statsample::Test::T::TwoSamplesIndependent.new(a,b)
t_2.probability_not_equal_variance

this gives the result: => 0.03333672278567579

However, the result should be: 0.00016053418045947065

Which actually is the value of t_2.probability_equal_variance

The issue seems to be with Distribution::T.cdf which treats df different if its a Fixnum vs a Float.

For the two vectors, where the variance actually is the same, the t statistic and the df should be the same for the equal_variance case and the not_equal_variance case.

But Distribution::T.cdf(-4.8990,16) doesn't give the same result as Distribution::T.cdf(-4.8990,16.0)

I only just started using statsample today, so I don't know if this is a new issue or a long-standing one.

@clbustos
Copy link
Owner

clbustos commented May 3, 2011

I can't replicate the result with ruby 1.9.3. Can you give me more information of your setup?

  • Ruby version
  • Distribution and statsample gem version

@clbustos clbustos closed this as completed May 3, 2011
@clbustos clbustos reopened this May 3, 2011
@fauman
Copy link
Author

fauman commented May 3, 2011

Ok - must just be me - I'll keep checking my set up.

I'm on Windows XP
Ruby 1.9.2-p180
statsample 1.0.1

I do not have statisics2 or gsl installed

I'm using NetBeans 6.9.1 to manage my Ruby Gems

@clbustos
Copy link
Owner

clbustos commented May 3, 2011

Should be the ruby code. I will close this issue and open one on Distribution gem.

@clbustos clbustos closed this as completed May 3, 2011
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