All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cz.cuni.mff.d3s.spl.interpretation.ComparisonResult Maven / Gradle / Ivy

Go to download

Stochastice Performance Logic is a formalism for capturing performance assumptions. It is, for example, possible to capture assumption that newer version of a function bar is faster than the previous version or that library foobar is faster than library barfoo when rendering antialiased text. The purpose of this framework is to allow evaluation of SPL formulas inside Java applications.

There is a newer version: 1.0.4
Show newest version
/*
 * Copyright 2015 Charles University in Prague
 * Copyright 2015 Vojtech Horky
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cz.cuni.mff.d3s.spl.interpretation;

/** Encapsulates result of a comparison of two data sources.
 * 
 * 

* The basic operation is to get what is the relation between the * two data sets. * That is the only operation that must be provided by the interface, * all other methods may throw UnsupportedOperationException. * *

* For a typical statistical test the comparison result is directly * derived from the statistic and its position relative to the critical * region as computed at given significance level. * */ public interface ComparisonResult { /** Actual result of the comparison. * * All the values are bound to the given significance level. */ public enum Relation { /** It is not possible to tell the relation at given significance level. */ UNKNOWN { @Override public String toShortString() { return "?"; } }, /** The first (left) data set is smaller than the second (right) one. */ LESS_THAN { @Override public String toShortString() { return "<"; } }, /** The data sets are considered equal. */ EQUAL { @Override public String toShortString() { return "="; } }, /** The first (left) data set is greater than the second (right) one. */ GREATER_THAN { @Override public String toShortString() { return ">"; } }; /** Get relation as short string. * * @return Relation as short string. */ public abstract String toShortString(); }; /** Get the actual result. * * @param significanceLevel Significance level to use. * @return Relation between the two original data sets. */ public Relation get(double significanceLevel); /** Get statistic of the underlying test. * * @return Test statistic. * @throws UnsupportedOperationException When the operation is not supported. */ public double getStatistic(); /** Tells a critical value for given significance level. * * @param significanceLevel Significance level to use. * @return Critical value at given significance level. * @throws UnsupportedOperationException When the operation is not supported. * @throws IllegalArgumentException When the significanceLevel is outside range 0 and 1. */ public double getCriticalValue(double significanceLevel); /** Tells confidence interval for given level of the interpretation. * *

* Typically the confidence interval is returned for a difference * between means of the two data sets. * * @param confidenceLevel Confidence level to use. * @return Typically a two member array denoting the confidence interval. * @throws UnsupportedOperationException When the operation is not supported. * @throws IllegalArgumentException When the significanceLevel is outside range 0 and 1. */ public double[] getConfidenceInterval(double confidenceLevel); }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy