コード例 #1
0
ファイル: orderWindow.cpp プロジェクト: lmjakt/exint_client
void OrderWindow::meanComparison(){

  exptPoints pts = inputWindow->currentPoints();
  zScore(pts.values);   // better algorithm.
  // determine the normed value..
  //bool normed = selector[1]->isChecked();    // radio buttons.. so it's ok.. 
  
  //emit doMeanComparison(pts.values, pts.indices, normed, getDist->isChecked());
}
コード例 #2
0
double Sensor::nomalization(double* tempOrHumid) {
  findTrimmed(tempOrHumid, TRIM_PERCENT);
  return zScore(tempOrHumid);
}
コード例 #3
0
/**
 * \brief Runs a one-sample Z test on a vector of numbers.
 * \param[in] values The vector of numbers.
 * \param[in] distributionMean The mean of the entire population.
 * \param[in] distributionStandardDeviation the standard deviation of the entire population.
 * \param[in] The confidence level (commonly used values: 0.95, 0.999)
 * \param[in] testCase The test case containing the hypothesis and null hypothesis chosen in germanStudentsTest()
 */
void StatisticalTesting::oneSampleZTest(const std::vector<double>& values,
		const double& distributionMean, const double& distributionStandardDeviation,
		const double& confidenceLevel, const TestCase& testCase) {

	/**
	 * TODO: Execute the Z test for the given vector of numbers and either
	 * reject the null hypothesis or state that you cannot reject the null hypothesis.
	 */

	/*
	 * Available methods:
	 * - lookupZTable(double Z): returns the cumulative density function
	 *       of the standard normal distribution at Z (see slide 23 for examples).
	 * - testCase.getHypothesis(): returns the hypothesis (see germanStudentsTest() above)
	 * - testCase.getNullHypothesis(): returns the null hypothesis (see germanStudentsTest() above)
	 *
	 * For both the hypothesis and the null hypothesis, the following methods are available:
	 * - hypothesis.getDirection(): Returns one element from the following enumeration:
	 *       LESS, GREATER, AT_LEAST, AT_MOST, EQUAL, or DIFFERENT.
	 * - hypothesis.reject(): Rejects the hypothesis.
	 * - hypothesis.cannotReject(): States that we cannot reject the hypothesis based on the data.
	 */
	double zscore = zScore(values,distributionMean,distributionStandardDeviation);
	double zlookup = lookupZTable(zscore);
	const Hypothesis& h1 = testCase.getHypothesis();
	const Hypothesis& h0 = testCase.getNullHypothesis();
	double zconfidence = 0;
	normal s;
	/* If greater or lesser the area of significance is on one side of curve. so we use quantile with same
	 * confidence level. Else we can divide alpha by 2 for two sided test
	 *
	 */
	if (h0.getDirection()==AT_MOST) 	{
		zconfidence = confidenceLevel;
		if (zlookup>zconfidence)
			h0.reject();
			else 		{
				h0.cannotReject();
			}
	}
	else {
		if(h0.getDirection()==AT_LEAST)
		{
			zconfidence = (1-confidenceLevel);
			if (zlookup<zconfidence)
				h0.reject();
				else {
					h0.cannotReject();
				}
		}
		else {
			double left_boundry = (1-confidenceLevel);
			double right_boundry = confidenceLevel;
						if((zlookup<left_boundry)||(zlookup>right_boundry))
							h0.reject();
							else 	{
								h0.cannotReject();
							}
		}
	}
}
コード例 #4
0
ファイル: normaliser.cpp プロジェクト: lmjakt/exint_server
void Normaliser::zScore(float** v, unsigned int ps, unsigned int es){
  for(int i=0; i < ps; i++){
    zScore(v[i], es);
  }
}
コード例 #5
0
ファイル: orderWindow.cpp プロジェクト: lmjakt/exint_client
void OrderWindow::rawComparison(){

  exptPoints pts = inputWindow->currentPoints();
  zScore(pts.values);   // better algorithm.
  //emit doRawComparison(pts.values, pts.indices, getDist->isChecked());
}