package stat
The stat
package contains classes, traits and objects for basic statistical
functions and analyses. The package object itself defines an implicit
conversion from scalation.linalgebra.VectorD
to StatVector
.
- Alphabetic
- By Inheritance
- stat
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
-
class
Anova extends AnyRef
The Anova class provides the functions necessary for performing a one-way ANalysis Of VAriance (ANOVA) on the input data matrix x.
The Anova class provides the functions necessary for performing a one-way ANalysis Of VAriance (ANOVA) on the input data matrix x. The data matrix: row i - i-th group/treatment column j - j-th replica
-
class
BatchVector extends AnyRef
The
BatchVector
class contains aVectorD
for maintaining experimental data in multiple batches and methods for computing statistics on these data.The
BatchVector
class contains aVectorD
for maintaining experimental data in multiple batches and methods for computing statistics on these data. Ex: It can be used to support the Method of Batch Means (MBM). -
class
Canvas extends Panel
Create a canvas on which to draw the histogram.
-
class
FramelessHistogram extends AnyRef
The
FramelessHistogram
class should be used in embedded applications. -
class
GoodnessOfFit_CS extends Error
The
GoodnessOfFit_CS
class is used to fit data to probability distributions.The
GoodnessOfFit_CS
class is used to fit data to probability distributions. Choosing the number of 'intervals' can be challenging and can affect the result: Suggestions: each interval should have 'E_i = n*p_i >= 5' and intervals >= sqrt (n). It uses the Chi-square goodness of fit test with equal width intervals.- See also
www.eg.bucknell.edu/~xmeng/Course/CS6337/Note/master/node66.html Compute the following for each interval and sum over all intervals. (O_i - E_i)^2 / E_i where O_i and E_i are the observed and expected counts for interval 'i', respectively.
-
class
GoodnessOfFit_CS2 extends Error
The
GoodnessOfFit_CS2
class is used to fit data to probability distributions.The
GoodnessOfFit_CS2
class is used to fit data to probability distributions. Suggestions: each interval should have 'E_i = n*p_i >= 5' and intervals >= sqrt (n). It uses the Chi-square goodness of fit test with equal probability intervals.- See also
www.eg.bucknell.edu/~xmeng/Course/CS6337/Note/master/node66.html Compute the following for each interval and sum over all intervals. (O_i - E_i)^2 / E_i where O_i and E_i are the observed and expected counts for interval 'i', respectively.
-
class
GoodnessOfFit_KS extends Error
The
GoodnessOfFit_KS
class is used to fit data to a probability distribution.The
GoodnessOfFit_KS
class is used to fit data to a probability distribution. It uses the Kolmogorov-Smirnov Goodness of Fit Test. Determine the maximum absolute difference 'd_max' between the data points 'd_i' and the theoretical value from a CDF F,d_max = max 1≤i≤n {|Fe(d_i) - F(d_i)|} (concept)
d_max = max 1≤i≤n {F(d_i) − (i−1)/n, i/n − F(d_i)} (calculation)
where 'Fe(.)' is the empirical distribution and 'F(.)' is the theoretical distribution. If 'd_max' is large, the fit should be rejected.
- See also
www.eg.bucknell.edu/~xmeng/Course/CS6337/Note/master/node66.html
www.itl.nist.gov/div898/handbook/eda/section3/eda35g.htm ---------------------------------------------------------------------------------
-
class
Histogram extends VizFrame
The
Histogram
class takes a vector of values, counts the number of values in each of several intervals and displays the counts vertically in a histogram. -
final
class
MM_StatVector extends AnyVal
The
MM_StatVector
value class provides methods for computing statistics on data vectors.The
MM_StatVector
value class provides methods for computing statistics on data vectors. Both maximum likelihood and unbiased estimators are supported. Unbiased should only be used on sample (not population) data. Ex: It can be used to support the Method of Independent Replications (MIR). For efficiency,MM_StatVector
is a value class that enriches theVectorD
. The corresponding implicit conversion in thestat
package object.- See also
stackoverflow.com/questions/14861862/how-do-you-enrich-value-classes-without-overhead -----------------------------------------------------------------------------
-
class
StatTable extends Frame
The
StatTable
class display statistical results in a frame's table. -
final
class
StatVector extends AnyVal
The
StatVector
value class provides methods for computing statistics on data vectors.The
StatVector
value class provides methods for computing statistics on data vectors. Both maximum likelihood and unbiased estimators are supported. Unbiased should only be used on sample (not population) data. Ex: It can be used to support the Method of Independent Replications (MIR). For efficiency,StatVector
is a value class that enriches theVectorD
. The corresponding implicit conversion in thestat
package object.- See also
stackoverflow.com/questions/14861862/how-do-you-enrich-value-classes-without-overhead -----------------------------------------------------------------------------
-
final
class
StatVectorI extends AnyVal
The
StatVectorI
value class provides methods for computing statistics on integer values data vectors.The
StatVectorI
value class provides methods for computing statistics on integer values data vectors. Both maximum likelihood and unbiased estimators are supported. Unbiased should only be used on sample (not population) data. For efficiency,StatVectorI
is a value class that enriches theVectorI
. The corresponding implicit conversion in thestat
package object.- See also
stackoverflow.com/questions/14861862/how-do-you-enrich-value-classes-without-overhead -----------------------------------------------------------------------------
-
class
Statistic extends Error
The
Statistic
class is used to collect values and compute sample statistics on them (e.g., waiting time).The
Statistic
class is used to collect values and compute sample statistics on them (e.g., waiting time). Contrast withTimeStatistic
defined below. -
class
T_Test extends AnyRef
The
T_Test
class is used to test whether the means, 'μ1' and 'μ2', of two data samples, 'x' and 'y', are different, 'μ1 ≠ μ2', using a Two-Sample, Independent t-test.The
T_Test
class is used to test whether the means, 'μ1' and 'μ2', of two data samples, 'x' and 'y', are different, 'μ1 ≠ μ2', using a Two-Sample, Independent t-test. Assumes samples are drawn from Normal distributions. The error in the test is measured by the conditional probability 'p' that a "difference is detected" when there "actually is none".p = P(different | μ1 = μ2)
The power of the test is the ability to detect actual differences. '1 - power' is measured by the conditional probability 'q' that a "difference is not detected" when there "actually is one".
q = P(! different | μ1 ≠ μ2)
These are called type I (measured by p) and type II (measured by q) errors.
- See also
en.wikipedia.org/wiki/Type_I_and_type_II_errors -----------------------------------------------------------------------------
-
class
T_Test1 extends AnyRef
The
T_Test1
class is used to test whether a data sample 'x' comes from a population with "known" mean 'μ0', by comparing the sample mean 'μ' with 'μ0', using a (Two-Sided/Two-Tailed) One-Sample t-test.The
T_Test1
class is used to test whether a data sample 'x' comes from a population with "known" mean 'μ0', by comparing the sample mean 'μ' with 'μ0', using a (Two-Sided/Two-Tailed) One-Sample t-test. Assumes the sample is drawn from a Normal distribution. The error in the test is measured by the conditional probability 'p' that a "difference is detected" when there "actually is none".p = P(different | μ = μ0)
The power of the test is the ability to detect actual differences. '1 - power' is measured by the conditional probability 'p2' that a "difference is not detected" when there "actually is one".
p2 = P(! different | μ ≠ μ0)
These are called Type I (measured by p) and Type II (measured by p2) errors.
- See also
en.wikipedia.org/wiki/Type_I_and_type_II_errors ----------------------------------------------------------------------------- H0: μ = μ0 Null Hypothesis H1: μ ≠ μ0 Alternative Hypothesis (Two-Sided) -----------------------------------------------------------------------------
-
class
TimeStatistic extends Statistic
The
TimeStatistic
class is used to collect values and compute time-persistent statistics on them (e.g., Number in Queue).The
TimeStatistic
class is used to collect values and compute time-persistent statistics on them (e.g., Number in Queue).- See also
staff.unak.is/andy/Year%203%20Simulation/Laboratories/v4manual/internal.htm
Value Members
-
implicit
def
vectorC2StatVector(x: VectorC): StatVector
Implicit conversion from
VectorD
toStatVector
, which supports more advanced statistical operations on vectors (e.g., covariance).Implicit conversion from
VectorD
toStatVector
, which supports more advanced statistical operations on vectors (e.g., covariance). Other vector types require to conversion toVectorD
via 'toDouble'. Caveat: won't work for vectors of string numbers (VectorS
) since there not a meaningful conversion for general strings.- x
the vector to be enriched
- implicit def vectorD2StatVector(x: VectorD): StatVector
- implicit def vectorI2StatVector(x: VectorI): StatVectorI
- implicit def vectorL2StatVector(x: VectorL): StatVector
- implicit def vectorQ2StatVector(x: VectorQ): StatVector
- implicit def vectorR2StatVector(x: VectorR): StatVector
- implicit def vectorT2StatVector(x: VectorT): StatVector
-
object
AnovaTest extends App
This object is used to test the Anova class.
This object is used to test the Anova class.
- See also
wiki.uiowa.edu/display/bstat/One-way+fixed+effects+ANOVA > runMain scalation.stat.AnovaTest
-
object
BatchVectorTest extends App
The
BatchVectorTest
object provides an example of how to use theBatchVector
class to implement the Method of Batch Means (MBM). -
object
Conversions
The
Conversions
object provide implicit conversion from memory mapped vectors toStatVectors
. -
object
GoodnessOfFit_CS
The
GoodnessOfFit_CS
companion object provides two discrepancy metrics to capture the differences between observed 'o' and expected 'o' counts.The
GoodnessOfFit_CS
companion object provides two discrepancy metrics to capture the differences between observed 'o' and expected 'o' counts.- See also
en.wikipedia.org/wiki/G-test
-
object
GoodnessOfFit_CS2Test extends App
The
GoodnessOfFit_CS2Test
object is used to test theGoodnessOfFit_CS
class.The
GoodnessOfFit_CS2Test
object is used to test theGoodnessOfFit_CS
class.- See also
www.seattlecentral.edu/qelp/sets/057/057.html > runMain scalation.stat.GoodnessOfFit_CS2Test
-
object
GoodnessOfFit_CSTest extends App
The
GoodnessOfFit_CSTest
object is used to test theGoodnessOfFit_CS
class.The
GoodnessOfFit_CSTest
object is used to test theGoodnessOfFit_CS
class.- See also
www.seattlecentral.edu/qelp/sets/057/057.html > runMain scalation.stat.GoodnessOfFit_CSTest
-
object
GoodnessOfFit_KS
The
GoodnessOfFit_KS
object provides methods to approximate the critical values/p-values for the KS Test.The
GoodnessOfFit_KS
object provides methods to approximate the critical values/p-values for the KS Test.P(D_n < d)
- See also
www.jstatsoft.org/article/view/v008i18/kolmo.pdf
sa-ijas.stat.unipd.it/sites/sa-ijas.stat.unipd.it/files/IJAS_3-4_2009_07_Facchinetti.pdf
-
object
GoodnessOfFit_KSTest extends App
The
GoodnessOfFit_KSTest
object is used to test theGoodnessOfFit_KS
class.The
GoodnessOfFit_KSTest
object is used to test theGoodnessOfFit_KS
class.- See also
www.seattlecentral.edu/qelp/sets/057/057.html > runMain scalation.stat.GoodnessOfFit_KSTest
-
object
GoodnessOfFit_KSTest2 extends App
The
GoodnessOfFit_KSTest2
object is used to test theGoodnessOfFit_KS
object.The
GoodnessOfFit_KSTest2
object is used to test theGoodnessOfFit_KS
object.- See also
www.utdallas.edu/~herve/Abdi-Lillie2007-pretty.pdf > runMain scalation.stat.GoodnessOfFit_KSTest2
-
object
GoodnessOfFit_KSTest3 extends App
The
GoodnessOfFit_KSTest3
object is used to test theGoodnessOfFit_KS
object.The
GoodnessOfFit_KSTest3
object is used to test theGoodnessOfFit_KS
object.- See also
www.jstatsoft.org/article/view/v008i18/kolmo.pdf > runMain scalation.stat.GoodnessOfFit_KSTest3
-
object
GoodnessOfFit_KSTest4 extends App
The
GoodnessOfFit_KSTest4
object is used to test theGoodnessOfFit_KS
object.The
GoodnessOfFit_KSTest4
object is used to test theGoodnessOfFit_KS
object. Fifty data points generated by a random variate generator for the Normal distribution are tested to see if they pass the Normality test. > runMain scalation.stat.GoodnessOfFit_KSTest4 -
object
HistogramTest extends App
The
HistogramTest
object is used to test theHistogram
class.The
HistogramTest
object is used to test theHistogram
class. As 'k' increases, the sum of Uniform approaches Normal. > runMain scalation.stat.HistogramTest -
object
MM_StatVectorTest extends App
The
MM_StatVectorTest
object is used to test theMM_StatVector
class.The
MM_StatVectorTest
object is used to test theMM_StatVector
class. > runMain scalation.stat.MM_StatVectorTest -
object
MM_StatVectorTest2 extends App
The
MM_StatVectorTest2
object provides an example of how to use theMM_StatVector
class to implement the Method of Independent Replications (MIR) following a simple two-stage procedure. -
object
MethodOfMoments
The
MethodOfMoments
object provides methods for estimating parameters for popular probability distributions using the Method of Moments (MOM).The
MethodOfMoments
object provides methods for estimating parameters for popular probability distributions using the Method of Moments (MOM). The main alternative is to use Maximum Likelihood Estimators (MLE).- See also
www.math.uah.edu/stat/point/Moments.html
-
object
Normality
The
Normality
object provides methods for testing Normality based on skewness and kurtosis.The
Normality
object provides methods for testing Normality based on skewness and kurtosis. Such test are more suitable for large sample sizes where more powerful goodness-of-fit tests tend to frequently reject Normality.- See also
stats.stackexchange.com/questions/29731/regression-when-the-ols-residuals-are-not-normally-distributed
stats.stackexchange.com/questions/2492/is-normality-testing-essentially-useless
en.wikipedia.org/wiki/D%27Agostino%27s_K-squared_test
-
object
NormalityTest extends App
The
NormalityTest
object is used to test theNormality
object.The
NormalityTest
object is used to test theNormality
object.- See also
www.seattlecentral.edu/qelp/sets/057/057.html > runMain scalation.stat.NormalityTest
-
object
Probability extends Error
The
Probability
object provides methods for operating on univariate and bivariate probability distributions of discrete random variables 'X' and 'Y'.The
Probability
object provides methods for operating on univariate and bivariate probability distributions of discrete random variables 'X' and 'Y'. A probability distribution is specified by its probability mass functions (pmf) stored either as a "probability vector" for a univariate distribution or a "probability matrix" for a bivariate distribution.joint probability matrix: pxy(i, j) = P(X = x_i, Y = y_j) marginal probability vector: px(i) = P(X = x_i) conditional probability matrix: px_y(i, j) = P(X = x_i|Y = y_j)
In addition to computing joint, marginal and conditional probabilities, methods for computing entropy and mutual information are also provided. Entropy provides a measure of disorder or randomness. If there is little randomness, entropy will close to 0, while when randomness is high, entropy will be close to, e.g., 'log2 (px.dim)'. Mutual information provides a robust measure of dependency between random variables (contrast with correlation).
- See also
scalation.stat.StatVector
-
object
ProbabilityTest extends App
The
ProbabilityTest
object is used to test theProbability
object.The
ProbabilityTest
object is used to test theProbability
object. > runMain scalation.stat.ProbabilityTest -
object
ProbabilityTest2 extends App
The
ProbabilityTest2
provides upper bound for 'entropy' and 'nentropy'.The
ProbabilityTest2
provides upper bound for 'entropy' and 'nentropy'. > runMain scalation.stat.ProbabilityTest2 -
object
ProbabilityTest3 extends App
The
ProbabilityTest3
object is used to test theProbability
class.The
ProbabilityTest3
object is used to test theProbability
class. Plot entropy. > runMain scalation.stat.ProbabilityTest3 -
object
ProbabilityTest4 extends App
The
ProbabilityTest4
object is used to test theProbability
class.The
ProbabilityTest4
object is used to test theProbability
class. Plot probability and log-probability for binomial distributions. > runMain scalation.stat.ProbabilityTest4 -
object
ProbabilityTest5 extends App
The
ProbabilityTest5
object is used to test theProbability
class.The
ProbabilityTest5
object is used to test theProbability
class. Plot entropy and normalize entropy for binomial distributions. > runMain scalation.stat.ProbabilityTest5 -
object
ProbabilityTest6 extends App
The
ProbabilityTest6
object is used to test theProbability
class.The
ProbabilityTest6
object is used to test theProbability
class. It computes entropy, relative entropy and cross entropy and verifies thst cross entropy == entropy + relative entropy- See also
arxiv.org/pdf/0808.4111.pdf > runMain scalation.stat.ProbabilityTest6
-
object
ProbabilityTest7 extends App
The
ProbabilityTest7
object is used to test theProbability
class.The
ProbabilityTest7
object is used to test theProbability
class. It computes joint, marginal and conditional probabilities as well as measures of independence.- See also
ocw.mit.edu/courses/mathematics/18-05-introduction-to-probability-and-statistics-spring-2014/readings/MIT18_05S14_Reading7a.pdf > runMain scalation.stat.ProbabilityTest7
-
object
Q_Q_Plot extends Error
The
Q_Q_Plot
object produces Quantile-Quantile plots that are used to compare probability distributions. -
object
Q_Q_PlotTest extends App
The
Q_Q_PlotTest
object is used to test theQ_Q_Plot
object: distribution vs.The
Q_Q_PlotTest
object is used to test theQ_Q_Plot
object: distribution vs. distribution. > runMain scalation.stat.Q_Q_PlotTest -
object
Q_Q_PlotTest2 extends App
The
Q_Q_PlotTest2
object is used to test theQ_Q_Plot
object: data vector vs.The
Q_Q_PlotTest2
object is used to test theQ_Q_Plot
object: data vector vs. distribution. > runMain scalation.stat.Q_Q_PlotTest2 -
object
StatTableTest extends App
The
StatTableTest
is used to test theStatTable
class. -
object
StatVector
The
StatVector
companion object extends statistics vector operations to matrices and convenience functions on vectors. -
object
StatVectorITest extends App
The
StatVectorITest
object is used to test theStatVectorI
class.The
StatVectorITest
object is used to test theStatVectorI
class.- See also
www.mathworks.com/help/stats/skewness.html > runMain scalation.stat.StatVectorITest
-
object
StatVectorTest extends App
The
StatVectorTest
object is used to test theStatVector
class.The
StatVectorTest
object is used to test theStatVector
class.- See also
www.mathworks.com/help/stats/skewness.html > runMain scalation.stat.StatVectorTest
-
object
StatVectorTest2 extends App
The
StatVectorTest2
object provides an example of how to use theStatVector
class to implement the Method of Independent Replications (MIR) following a simple two-stage procedure.The
StatVectorTest2
object provides an example of how to use theStatVector
class to implement the Method of Independent Replications (MIR) following a simple two-stage procedure. > runMain scalation.stat.StatVectorTest2 -
object
StatVectorTest3 extends App
The
StatVectorTest3
object is used to test theStatVector
companion object by computing covariance, correlation and cosine matrices.The
StatVectorTest3
object is used to test theStatVector
companion object by computing covariance, correlation and cosine matrices.- See also
www.itl.nist.gov/div898/handbook/pmc/section5/pmc541.htm > runMain scalation.stat.StatVectorTest3
-
object
StatVectorTest4 extends App
The
StatVectorTest4
object is used to test theStatVector
companion object by computing covariance, correlation and cosine matrices.The
StatVectorTest4
object is used to test theStatVector
companion object by computing covariance, correlation and cosine matrices.- See also
www.itl.nist.gov/div898/software/dataplot/refman2/auxillar/corrmatr.htm > runMain scalation.stat.StatVectorTest4
-
object
StatVectorTest5 extends App
The
StatVectorTest5
object is used to test theStatVector
companion object by analyzing a time-series vector.The
StatVectorTest5
object is used to test theStatVector
companion object by analyzing a time-series vector. > runMain scalation.stat.StatVectorTest5 -
object
StatVectorTest6 extends App
The
StatVectorTest6
object is used to test theStatVector
class by computing point and interval statistics on a data vector/sample.The
StatVectorTest6
object is used to test theStatVector
class by computing point and interval statistics on a data vector/sample.- See also
Data Science Using ScalaTion, Chapter 2, Example Problems > runMain scalation.stat.StatVectorTest6
-
object
StatVectorTest7 extends App
The
StatVectorTest7
object is used to test theStatVector
class by computing point and interval statistics on a data vector/sample.The
StatVectorTest7
object is used to test theStatVector
class by computing point and interval statistics on a data vector/sample. It tests the success rates of confidence intervals based on the z- and t-distributions.- See also
Data Science Using ScalaTion, Chapter 2, Example Problems > runMain scalation.stat.StatVectorTest7
-
object
Statistic extends Error
The
Statistic
companion object provides additional values and functions. -
object
StatisticTest extends App
The
StatisticTest
object is used to test theStatistic
andTimeStatistic
classes.The
StatisticTest
object is used to test theStatistic
andTimeStatistic
classes. > runMain scalation.stat.StatisticTest -
object
T_Test
The
T_Test
companion object provides a convenient method for performing t-test. -
object
T_Test1
The
T_Test1
companion object provides a convenient method for performing t-test.The
T_Test1
companion object provides a convenient method for performing t-test. If 'difference' is false (fail to reject), making a decision on this basis can be risky, so 'same' should be called. If neither 'different' or 'same' are true, need to collect more data. -
object
T_Test1Test extends App
The
T_Test1Test
object is used to test theT_Test1
class.The
T_Test1Test
object is used to test theT_Test1
class. > runMain scalation.stat.T_Test1Test -
object
T_Test1Test2 extends App
The
T_Test1Test2
object is used to test theT_Test1
class.The
T_Test1Test2
object is used to test theT_Test1
class.- See also
www.statsdirect.com/help/parametric_methods/single_sample_t.htm > runMain scalation.stat.T_Test1Test2
-
object
T_TestTest extends App
The
T_TestTest
object is used to test theT_Test
class.The
T_TestTest
object is used to test theT_Test
class.- See also
www.isixsigma.com/tools-templates/hypothesis-testing/making-sense-two-sample-t-test/ > runMain scalation.stat.T_TestTest
-
object
TimeStatistic extends Error
The
TimeStatistic
companion object provides additional functions.