Unity Scopes API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
unity::scopes::testing::StudentsTTest Struct Reference

Implements different variants of the Student's T-test (see http://en.wikipedia.org/wiki/Student's_t-test) More...

#include <unity/scopes/testing/Statistics.h>

Classes

struct  Result
 Executing the test returns a set of hypothesis that have to be evaluated at the desired confidence level. More...
 

Public Member Functions

Result one_sample (const Sample &sample, Sample::ValueType mean, Sample::ValueType std_dev)
 one_sample calculates the Student's T test for one sample and a known mean and std. dev.. More...
 
Result two_independent_samples (const Sample &sample1, const Sample &sample2)
 two_independent_samples calculates the Student's T test for two samples More...
 

Detailed Description

Implements different variants of the Student's T-test (see http://en.wikipedia.org/wiki/Student's_t-test)

unity::scopes::ActionMetadata meta_data{default_locale, default_form_factor};
static const std::size_t sample_size{10};
static const std::chrono::seconds per_trial_timeout{1};
{
[search_result, meta_data]() { return std::make_pair(search_result, meta_data); },
{
sample_size,
per_trial_timeout
}
};
auto result = benchmark.for_preview(scope, config);
reference_preview_performance,
result);
EXPECT_EQ(unity::scopes::testing::HypothesisStatus::not_rejected,
test_result.sample_mean_is_eq_to_reference(0.05));
EXPECT_EQ(unity::scopes::testing::HypothesisStatus::not_rejected,
test_result.sample_mean_is_ge_than_reference(0.05));
EXPECT_EQ(unity::scopes::testing::HypothesisStatus::rejected,
test_result.sample_mean_is_le_than_reference(0.05));

Member Function Documentation

unity::scopes::testing::StudentsTTest::Result unity::scopes::testing::StudentsTTest::one_sample ( const Sample sample,
Sample::ValueType  mean,
Sample::ValueType  std_dev 
)

one_sample calculates the Student's T test for one sample and a known mean and std. dev..

Parameters
sampleSample of values.
meanThe known mean of the underlying distribution
std_devThe known std. dev. of the underlying distribution
Returns
unity::scopes::testing::StudentsTTest::Result unity::scopes::testing::StudentsTTest::two_independent_samples ( const Sample sample1,
const Sample sample2 
)

two_independent_samples calculates the Student's T test for two samples

Parameters
sample1The first sample
sample2The second sample
Returns
An instance of Result.

The documentation for this struct was generated from the following files: