final class MM_StatVector extends AnyVal
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 the VectorD
.
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
- MM_StatVector
- AnyVal
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
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
-
def
amedian: Double
Compute the averaged median, which is the median when 'dim' is odd and the average of the median and the next'k'-median when 'dim' is even.
-
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: VectorD): 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: VectorD): 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): Double
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
ms: Double
Compute the mean square (ms) of 'self' vector.
-
def
pcorr(y: VectorD): 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'.
- y
the other vector
-
def
pcov(y: VectorD): 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
VectorD for pvariance
-
def
rms: Double
Compute the root mean square (rms) of 'self' vector.
-
def
scorr(y: VectorD): 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: VectorD
-
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
standardize: VectorD
Produce a standardized version of the vector by subtracting the mean and dividing by the standard deviation (e.g., Normal -> Standard Normal).
-
def
stddev: Double
Compute the standard deviation of 'self' vector.
-
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