throw new IllegalArgumentException("bad significance level: " + alpha); return (tTest(mu, sample) < alpha);
throws IllegalArgumentException, MathException { checkSignificanceLevel(alpha); return tTest(mu, sample) < alpha;
throws IllegalArgumentException, MathException { checkSignificanceLevel(alpha); return tTest(mu, sample) < alpha;
throws IllegalArgumentException, MathException { checkSignificanceLevel(alpha); return tTest(mu, sampleStats) < alpha;
throws IllegalArgumentException, MathException { checkSignificanceLevel(alpha); return tTest(mu, sampleStats) < alpha;
throw new IllegalArgumentException("insufficient data for t statistic"); return tTest( StatUtils.mean(sample), mu, StatUtils.variance(sample), sample.length);
throws IllegalArgumentException, MathException { double meanDifference = StatUtils.meanDifference(sample1, sample2); return tTest(meanDifference, 0, StatUtils.varianceDifference(sample1, sample2, meanDifference), sample1.length);
throws IllegalArgumentException, MathException { double meanDifference = StatUtils.meanDifference(sample1, sample2); return tTest(meanDifference, 0, StatUtils.varianceDifference(sample1, sample2, meanDifference), (double) sample1.length);
throw new IllegalArgumentException("insufficient data"); return tTest(StatUtils.mean(sample1), StatUtils.mean(sample2), StatUtils.variance(sample1), StatUtils.variance(sample2), (double) sample1.length, (double) sample2.length);
throws IllegalArgumentException, MathException { checkSampleData(sample); return tTest( StatUtils.mean(sample), mu, StatUtils.variance(sample), sample.length);
throws IllegalArgumentException, MathException { checkSampleData(sample); return tTest( StatUtils.mean(sample), mu, StatUtils.variance(sample), sample.length);
throw new IllegalArgumentException("insufficient data for t statistic"); return tTest(sampleStats.getMean(), mu, sampleStats.getVariance(), sampleStats.getN());
public IValue tTest(IList sample1, IList sample2){ double s1[] = makeT(sample1); double s2[] = makeT(sample2); //for(int i = 0; i < s1.length; i++) System.err.println("s1[" + i + "] = " + s1[i]); //for(int i = 0; i < s2.length; i++) System.err.println("s2[" + i + "] = " + s2[i]); try { double r = new TTestImpl().tTest(s1, s2); //System.err.println("r = " + r); return values.real(r); } catch (IllegalArgumentException e) { throw RuntimeExceptionFactory.illegalArgument(sample1, null, null, e.getMessage()); } catch (MathException e) { throw RuntimeExceptionFactory.illegalArgument(sample1, null, null, e.getMessage()); } }
throws IllegalArgumentException, MathException { checkSampleData(sampleStats); return tTest(sampleStats.getMean(), mu, sampleStats.getVariance(), sampleStats.getN());
throws IllegalArgumentException, MathException { checkSampleData(sampleStats); return tTest(sampleStats.getMean(), mu, sampleStats.getVariance(), sampleStats.getN());
public IValue tTest(IList sample1, IList sample2, INumber alpha){ double s1[] = makeT(sample1); double s2[] = makeT(sample2); try { return values.bool(new TTestImpl().tTest(s1, s2, alpha.toReal(values.getPrecision()).doubleValue())); } catch (IllegalArgumentException e) { throw RuntimeExceptionFactory.illegalArgument(sample1, null, null, e.getMessage()); } catch (MathException e) { throw RuntimeExceptionFactory.illegalArgument(sample1, null, null, e.getMessage()); } }
throw new IllegalArgumentException("insufficient data for t statistic"); return tTest(sampleStats1.getMean(), sampleStats2.getMean(), sampleStats1.getVariance(), sampleStats2.getVariance(), (double) sampleStats1.getN(), (double) sampleStats2.getN());
public IValue tTest(INumber mu, IList sample, INumber alpha){ double s[] = makeT(sample); try { return values.bool(new TTestImpl().tTest( mu.toReal(values.getPrecision()).doubleValue(), s, alpha.toReal(values.getPrecision()).doubleValue())); } catch (IllegalArgumentException e) { throw RuntimeExceptionFactory.illegalArgument(sample, null, null, e.getMessage()); } catch (MathException e) { throw RuntimeExceptionFactory.illegalArgument(sample, null, null, e.getMessage()); } }
checkSampleData(sample1); checkSampleData(sample2); return tTest(StatUtils.mean(sample1), StatUtils.mean(sample2), StatUtils.variance(sample1), StatUtils.variance(sample2), sample1.length, sample2.length);
checkSampleData(sampleStats1); checkSampleData(sampleStats2); return tTest(sampleStats1.getMean(), sampleStats2.getMean(), sampleStats1.getVariance(), sampleStats2.getVariance(), sampleStats1.getN(), sampleStats2.getN());