final class StatVectorI extends AnyVal
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 the VectorI
.
The corresponding implicit conversion in the stat
package object.
- See also
stackoverflow.com/questions/14861862/how-do-you-enrich-value-classes-without-overhead -----------------------------------------------------------------------------
- Alphabetic
- By Inheritance
- StatVectorI
- AnyVal
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new StatVectorI(self: VectorI)
- self
the underlying object to be accessed via the 'self' accessor
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- Any
- final def ##: Int
- Definition Classes
- Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- Any
- def acorr(k: Int = 1): Double
Compute the 'k'-lag auto-correlation of 'self' vector.
Compute the 'k'-lag auto-correlation of 'self' vector.
- k
the lag parameter
- def acov(k: Int = 1): Double
Compute the 'k'-lag auto-covariance of 'self' vector.
Compute the 'k'-lag auto-covariance of 'self' vector.
- k
the lag parameter
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def ci(mu_: Double, ihw: Double): (Double, Double)
Return the confidence interval as (lower, upper) after calling either interval (unknown standard deviation) or interval2 (know standard deviation).
Return the confidence interval as (lower, upper) after calling either interval (unknown standard deviation) or interval2 (know standard deviation).
- mu_
the sample mean
- ihw
the interval half width
- def corr(y: VectorI): Double
Compute Pearson's correlation of 'self' vector with vector 'y'.
Compute Pearson's correlation of 'self' vector with vector 'y'.
- y
the other vector
- def cov(y: VectorI): Double
Compute the sample covariance of 'self' vector with vector 'y'.
Compute the sample covariance of 'self' vector with vector 'y'.
- y
the other vector
- def getClass(): Class[_ <: AnyVal]
- Definition Classes
- AnyVal → Any
- def interval(p: Double = .95): Double
Compute the confidence interval half-width for the given confidence level.
Compute the confidence interval half-width for the given confidence level. The Confidence Interval (CI) is on the mean, i.e., CI = [mean +/- interval].
- p
the confidence level
- def interval2(sig: Double, p: Double = .95): Double
Compute the confidence interval half-width for the given confidence level.
Compute the confidence interval half-width for the given confidence level. The Confidence Interval (CI) is on the mean, i.e., CI = [mean +/- interval]. This method assumes that the population standard deviation is known. uses the Standard Normal distribution.
- sig
the population standard deviation
- p
the confidence level
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def kurtosis(unbiased: Boolean = false): Double
Compute the kurtosis of 'self' vector.
Compute the kurtosis of 'self' vector. High kurtosis (> 3) indicates a distribution with heavier tails than a Normal distribution.
E(X - μ)4 / σ4
- unbiased
whether to shift the result so Normal is at 0 rather than 3
- See also
www.mathworks.com/help/stats/kurtosis.html
- def median(k: Int = (self.dim+1)/2): Int
Compute the 'k'-median ('k'-th smallest value) of 'self' vector.
Compute the 'k'-median ('k'-th smallest value) of 'self' vector. Setting 'k = (dim+1)/2' gives the regular median.
- k
the type of median (k-th smallest value)
- def mode: Int
Compute the mode of the 'self' vector, i.e., the value that occurs most frequently.
- def ms: Double
Compute the mean square (ms) of 'self' vector.
- def pcorr(y: VectorI): Double
Compute the population Pearson's correlation of 'self' vector with vector 'y'.
Compute the population Pearson's correlation of 'self' vector with vector 'y'. Note: should only differ from 'corr' due to round-off errors and NaN issue.
- y
the other vector
- def pcov(y: VectorI): Double
Compute the population covariance of 'self' vector with vector 'y'.
Compute the population covariance of 'self' vector with vector 'y'.
- y
the other vector
- def precise(threshold: Double = .2, p: Double = .95): Boolean
Determine if the Confidence Interval (CI) on the mean is tight enough.
Determine if the Confidence Interval (CI) on the mean is tight enough.
- threshold
the cut-off value for CI to be considered tight
- p
the confidence level
- def precision(p: Double = .95): Double
Compute the relative precision, i.e., the ratio of the confidence interval half-width and the mean.
Compute the relative precision, i.e., the ratio of the confidence interval half-width and the mean.
- p
the confidence level
- def pstddev: Double
Compute the population standard deviation of 'self' vector.
Compute the population standard deviation of 'self' vector.
- See also
VectorI for pvariance
- def rms: Double
Compute the root mean square (rms) of 'self' vector.
- def scorr(y: VectorI): Double
Compute Spearman's rank correlation of 'self' vector with vector 'y'.
Compute Spearman's rank correlation of 'self' vector with vector 'y'.
- y
the other vector
- See also
en.wikipedia.org/wiki/Spearman%27s_rank_correlation_coefficient
- val self: VectorI
- def skew(unbiased: Boolean = false): Double
Compute the skewness of 'self' vector.
Compute the skewness of 'self' vector. Negative skewness indicates the distribution is elongated on the left, zero skewness indicates it is symmetric, and positive skewness indicates it is elongated on the right.
E(X - μ)3 / σ3
- unbiased
whether to correct for bias
- See also
www.mathworks.com/help/stats/skewness.html
- def stddev: Double
Compute the standard deviation of 'self' vector.
Compute the standard deviation of 'self' vector.
- See also
VectorI for variance
- def t_sigma(p: Double = .95): Double
Compute the product of the critical value from the t-distribution and the standard deviation of the vector.
Compute the product of the critical value from the t-distribution and the standard deviation of the vector.
- p
the confidence level
- def toString(): String
- Definition Classes
- Any
- def z_sigma(p: Double = .95): Double
Compute the product of the critical value from the z-distribution (Standard Normal) and the standard deviation of the vector.
Compute the product of the critical value from the z-distribution (Standard Normal) and the standard deviation of the vector.
- p
the confidence level