Package

smile

math

Permalink

package math

Mathematical and statistical functions.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. math
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class AbsMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  2. case class AbsVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  3. case class AcosMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  4. case class AcosVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  5. case class AsinMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  6. case class AsinVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  7. case class AtanMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  8. case class AtanVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  9. case class Ax(A: MatrixExpression, x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  10. case class CbrtMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  11. case class CbrtVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  12. case class CeilMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  13. case class CeilVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  14. case class ExpMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  15. case class ExpVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  16. case class Expm1Matrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  17. case class Expm1Vector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  18. case class FloorMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  19. case class FloorVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  20. case class Log10Matrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  21. case class Log10Vector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  22. case class Log1pMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  23. case class Log1pVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  24. case class Log2Matrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  25. case class Log2Vector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  26. case class LogMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  27. case class LogVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  28. case class MatrixAddMatrix(A: MatrixExpression, B: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  29. case class MatrixAddValue(A: MatrixExpression, y: Double) extends MatrixExpression with Product with Serializable

    Permalink
  30. case class MatrixDivMatrix(A: MatrixExpression, B: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  31. case class MatrixDivValue(A: MatrixExpression, y: Double) extends MatrixExpression with Product with Serializable

    Permalink
  32. sealed trait MatrixExpression extends AnyRef

    Permalink
  33. case class MatrixLift(A: Matrix) extends MatrixExpression with Product with Serializable

    Permalink
  34. case class MatrixMulMatrix(A: MatrixExpression, B: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  35. case class MatrixMulValue(A: MatrixExpression, y: Double) extends MatrixExpression with Product with Serializable

    Permalink
  36. case class MatrixMultiplicationChain(A: Seq[MatrixExpression]) extends MatrixExpression with Product with Serializable

    Permalink
  37. case class MatrixMultiplicationExpression(A: MatrixExpression, B: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  38. class MatrixOrderOptimization extends LazyLogging

    Permalink

    Optimizes the order of matrix multiplication chain.

    Optimizes the order of matrix multiplication chain. Matrix multiplication is associative. However, the complexity of matrix multiplication chain is not associative.

  39. case class MatrixSubMatrix(A: MatrixExpression, B: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  40. case class MatrixSubValue(A: MatrixExpression, y: Double) extends MatrixExpression with Product with Serializable

    Permalink
  41. case class MatrixTranspose(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  42. case class RoundMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  43. case class RoundVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  44. case class SinMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  45. case class SinVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  46. case class SqrtMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  47. case class SqrtVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  48. case class TanMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  49. case class TanVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  50. case class TanhMatrix(A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  51. case class TanhVector(x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  52. case class ValueAddMatrix(y: Double, A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  53. case class ValueAddVector(y: Double, x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  54. case class ValueDivMatrix(y: Double, A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  55. case class ValueDivVector(y: Double, x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  56. case class ValueMulMatrix(y: Double, A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  57. case class ValueMulVector(y: Double, x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  58. case class ValueSubMatrix(y: Double, A: MatrixExpression) extends MatrixExpression with Product with Serializable

    Permalink
  59. case class ValueSubVector(y: Double, x: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  60. case class VectorAddValue(x: VectorExpression, y: Double) extends VectorExpression with Product with Serializable

    Permalink
  61. case class VectorAddVector(x: VectorExpression, y: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  62. case class VectorDivValue(x: VectorExpression, y: Double) extends VectorExpression with Product with Serializable

    Permalink
  63. case class VectorDivVector(x: VectorExpression, y: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  64. sealed trait VectorExpression extends AnyRef

    Permalink

    Vector Expression.

  65. case class VectorLift(x: Array[Double]) extends VectorExpression with Product with Serializable

    Permalink
  66. case class VectorMulValue(x: VectorExpression, y: Double) extends VectorExpression with Product with Serializable

    Permalink
  67. case class VectorMulVector(x: VectorExpression, y: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink
  68. case class VectorSubValue(x: VectorExpression, y: Double) extends VectorExpression with Product with Serializable

    Permalink
  69. case class VectorSubVector(x: VectorExpression, y: VectorExpression) extends VectorExpression with Product with Serializable

    Permalink

Value Members

  1. def abs(x: MatrixExpression): AbsMatrix

    Permalink
  2. def abs(x: VectorExpression): AbsVector

    Permalink
  3. def acos(x: MatrixExpression): AcosMatrix

    Permalink
  4. def acos(x: VectorExpression): AcosVector

    Permalink
  5. implicit def array2VectorExpression(x: Array[Double]): VectorLift

    Permalink
  6. def asin(x: MatrixExpression): AsinMatrix

    Permalink
  7. def asin(x: VectorExpression): AsinVector

    Permalink
  8. def atan(x: MatrixExpression): AtanMatrix

    Permalink
  9. def atan(x: VectorExpression): AtanVector

    Permalink
  10. def beta(x: Double, y: Double): Double

    Permalink

    The beta function, also called the Euler integral of the first kind.

    The beta function, also called the Euler integral of the first kind.

    B(x, y) = 01 tx-1 (1-t)y-1dt

    for x, y > 0 and the integration is over [0,1].The beta function is symmetric, i.e. B(x,y) = B(y,x).

  11. def cbrt(x: MatrixExpression): CbrtMatrix

    Permalink
  12. def cbrt(x: VectorExpression): CbrtVector

    Permalink
  13. def ceil(x: MatrixExpression): CeilMatrix

    Permalink
  14. def ceil(x: VectorExpression): CeilVector

    Permalink
  15. def chisqtest(table: Array[Array[Int]]): ChiSqTest

    Permalink

    Given a two-dimensional contingency table in the form of an array of integers, returns Chi-square test for independence.

    Given a two-dimensional contingency table in the form of an array of integers, returns Chi-square test for independence. The rows of contingency table are labels by the values of one nominal variable, the columns are labels by the values of the other nominal variable, and whose entries are non-negative integers giving the number of observed events for each combination of row and column. Continuity correction will be applied when computing the test statistic for 2x2 tables: one half is subtracted from all |O-E| differences. The correlation coefficient is calculated as Cramer's V.

  16. def chisqtest(x: Array[Int], prob: Array[Double], constraints: Int = 1): ChiSqTest

    Permalink

    One-sample chisq test.

    One-sample chisq test. Given the array x containing the observed numbers of events, and an array prob containing the expected probabilities of events, and given the number of constraints (normally one), a small value of p-value indicates a significant difference between the distributions.

  17. def chisqtest2(x: Array[Int], y: Array[Int], constraints: Int = 1): ChiSqTest

    Permalink

    Two-sample chisq test.

    Two-sample chisq test. Given the arrays x and y, containing two sets of binned data, and given one constraint, a small value of p-value indicates a significant difference between two distributions.

  18. def cholesky(A: MatrixExpression): Cholesky

    Permalink

    Cholesky decomposition.

  19. def cholesky(A: Matrix): Cholesky

    Permalink

    Cholesky decomposition.

  20. def cholesky(A: Array[Array[Double]]): Cholesky

    Permalink

    Cholesky decomposition.

  21. def det(A: MatrixExpression): Double

    Permalink

    Returns the determinant of matrix.

  22. def det(A: Matrix): Double

    Permalink

    Returns the determinant of matrix.

  23. def diag(A: Matrix): Array[Double]

    Permalink

    Returns the diagonal elements of matrix.

  24. def digamma(x: Double): Double

    Permalink

    The digamma function is defined as the logarithmic derivative of the gamma function.

  25. package distance

    Permalink

    Distance functions.

  26. def eig(A: MatrixExpression): EVD

    Permalink

    Returns eigen values.

  27. def eig(A: Matrix): EVD

    Permalink

    Returns eigen values.

  28. def eig(A: Array[Array[Double]]): EVD

    Permalink

    Returns eigen values.

  29. def eigen(A: SMatrix, k: Int): EVD

    Permalink

    Returns k largest eigenvectors.

  30. def eigen(A: DMatrix, k: Int): EVD

    Permalink

    Returns k largest eigenvectors.

  31. def eigen(A: MatrixExpression): EVD

    Permalink

    Eigen decomposition.

  32. def eigen(A: Matrix): EVD

    Permalink

    Eigen decomposition.

  33. def eigen(A: Array[Array[Double]]): EVD

    Permalink

    Eigen decomposition.

  34. def erf(x: Double): Double

    Permalink

    The error function (also called the Gauss error function) is a special function of sigmoid shape which occurs in probability, statistics, materials science, and partial differential equations.

    The error function (also called the Gauss error function) is a special function of sigmoid shape which occurs in probability, statistics, materials science, and partial differential equations. It is defined as:

    erf(x) = 0x e-t2dt

    The complementary error function, denoted erfc, is defined as erfc(x) = 1 - erf(x). The error function and complementary error function are special cases of the incomplete gamma function.

  35. def erfc(x: Double): Double

    Permalink

    The complementary error function.

  36. def erfcc(x: Double): Double

    Permalink

    The complementary error function with fractional error everywhere less than 1.2 × 10-7.

    The complementary error function with fractional error everywhere less than 1.2 × 10-7. This concise routine is faster than erfc.

  37. def exp(x: MatrixExpression): ExpMatrix

    Permalink
  38. def exp(x: VectorExpression): ExpVector

    Permalink
  39. def expm1(x: MatrixExpression): Expm1Matrix

    Permalink
  40. def expm1(x: VectorExpression): Expm1Vector

    Permalink
  41. def eye(m: Int, n: Int): Matrix

    Permalink

    Returns an m-by-n identity matrix.

  42. def eye(n: Int): Matrix

    Permalink

    Returns an n-by-n identity matrix.

  43. def floor(x: MatrixExpression): FloorMatrix

    Permalink
  44. def floor(x: VectorExpression): FloorVector

    Permalink
  45. def ftest(x: Array[Double], y: Array[Double]): FTest

    Permalink

    Test if the arrays x and y have significantly different variances.

    Test if the arrays x and y have significantly different variances. Small values of p-value indicate that the two arrays have significantly different variances.

  46. def gamma(x: Double): Double

    Permalink

    Gamma function.

    Gamma function. Lanczos approximation (6 terms).

  47. def inv(A: MatrixExpression): Matrix

    Permalink

    Returns the inverse of matrix.

  48. def inv(A: Matrix): Matrix

    Permalink

    Returns the inverse of matrix.

  49. def inverf(p: Double): Double

    Permalink

    The inverse error function.

  50. def inverfc(p: Double): Double

    Permalink

    The inverse complementary error function.

  51. def kendalltest(x: Array[Double], y: Array[Double]): CorTest

    Permalink

    Kendall rank correlation test.

    Kendall rank correlation test. The Kendall Tau Rank Correlation Coefficient is used to measure the degree of correspondence between sets of rankings where the measures are not equidistant. It is used with non-parametric data. The p-value is calculated by approximation, which is good for n > 10.

  52. def kstest(x: Array[Double], y: Array[Double]): KSTest

    Permalink

    The two-sample KS test for the null hypothesis that the data sets are drawn from the same distribution.

    The two-sample KS test for the null hypothesis that the data sets are drawn from the same distribution. Small values of p-value show that the cumulative distribution function of x is significantly different from that of y. The arrays x and y are modified by being sorted into ascending order.

  53. def kstest(x: Array[Double], y: Distribution): KSTest

    Permalink

    The one-sample KS test for the null hypothesis that the data set x is drawn from the given distribution.

    The one-sample KS test for the null hypothesis that the data set x is drawn from the given distribution. Small values of p-value show that the cumulative distribution function of x is significantly different from the given distribution. The array x is modified by being sorted into ascending order.

  54. def lgamma(x: Double): Double

    Permalink

    log of the Gamma function.

    log of the Gamma function. Lanczos approximation (6 terms)

  55. def log(x: MatrixExpression): LogMatrix

    Permalink
  56. def log(x: VectorExpression): LogVector

    Permalink
  57. def log10(x: MatrixExpression): Log10Matrix

    Permalink
  58. def log10(x: VectorExpression): Log10Vector

    Permalink
  59. def log1p(x: MatrixExpression): Log1pMatrix

    Permalink
  60. def log1p(x: VectorExpression): Log1pVector

    Permalink
  61. def log2(x: MatrixExpression): Log2Matrix

    Permalink
  62. def log2(x: VectorExpression): Log2Vector

    Permalink
  63. def lu(A: MatrixExpression): LU

    Permalink

    LU decomposition.

  64. def lu(A: Matrix): LU

    Permalink

    LU decomposition.

  65. def lu(A: Array[Array[Double]]): LU

    Permalink

    LU decomposition.

  66. package matrix

    Permalink
  67. implicit def matrix2MatrixExpression(x: Matrix): MatrixLift

    Permalink
  68. implicit def matrixExpression2Array(exp: MatrixExpression): Matrix

    Permalink
  69. def ones(m: Int, n: Int): Matrix

    Permalink

    Returns an m-by-n matrix of all ones.

  70. def ones(n: Int): Matrix

    Permalink

    Returns an n-by-n matrix of all ones.

  71. def pearsontest(x: Array[Double], y: Array[Double]): CorTest

    Permalink

    Pearson correlation coefficient test.

  72. implicit def pimpArray2D(data: Array[Array[Double]]): PimpedArray2D

    Permalink
  73. implicit def pimpDouble(x: Double): PimpedDouble

    Permalink
  74. implicit def pimpDoubleArray(data: Array[Double]): PimpedDoubleArray

    Permalink
  75. implicit def pimpIntArray(data: Array[Int]): PimpedArray[Int]

    Permalink
  76. implicit def pimpMatrix(matrix: Matrix): PimpedMatrix

    Permalink
  77. def qr(A: MatrixExpression): QR

    Permalink

    QR decomposition.

  78. def qr(A: Matrix): QR

    Permalink

    QR decomposition.

  79. def qr(A: Array[Array[Double]]): QR

    Permalink

    QR decomposition.

  80. def randn(m: Int, n: Int, mu: Double = 0.0, sigma: Double = 1.0): Matrix

    Permalink

    Returns an m-by-n matrix of normally distributed random numbers.

  81. def rank(A: MatrixExpression): Int

    Permalink

    Returns the rank of matrix.

  82. def rank(A: Matrix): Int

    Permalink

    Returns the rank of matrix.

  83. def round(x: MatrixExpression): RoundMatrix

    Permalink
  84. def round(x: VectorExpression): RoundVector

    Permalink
  85. def sin(x: MatrixExpression): SinMatrix

    Permalink
  86. def sin(x: VectorExpression): SinVector

    Permalink
  87. def spearmantest(x: Array[Double], y: Array[Double]): CorTest

    Permalink

    Spearman rank correlation coefficient test.

    Spearman rank correlation coefficient test. The Spearman Rank Correlation Coefficient is a form of the Pearson coefficient with the data converted to rankings (ie. when variables are ordinal). It can be used when there is non-parametric data and hence Pearson cannot be used.

    The raw scores are converted to ranks and the differences between the ranks of each observation on the two variables are calculated.

    The p-value is calculated by approximation, which is good for n > 10.

  88. def sqrt(x: MatrixExpression): SqrtMatrix

    Permalink
  89. def sqrt(x: VectorExpression): SqrtVector

    Permalink
  90. def svd(A: SMatrix, k: Int): SVD

    Permalink

    Returns k largest singular vectors.

  91. def svd(A: DMatrix, k: Int): SVD

    Permalink

    Returns k largest singular vectors.

  92. def svd(A: MatrixExpression): SVD

    Permalink

    SVD decomposition.

  93. def svd(A: Matrix): SVD

    Permalink

    SVD decomposition.

  94. def svd(A: Array[Array[Double]]): SVD

    Permalink

    SVD decomposition.

  95. def tan(x: MatrixExpression): TanMatrix

    Permalink
  96. def tan(x: VectorExpression): TanVector

    Permalink
  97. def tanh(x: MatrixExpression): TanhMatrix

    Permalink
  98. def tanh(x: VectorExpression): TanhVector

    Permalink
  99. def trace(A: Matrix): Double

    Permalink

    Returns the trace of matrix.

  100. def ttest(x: Array[Double], y: Array[Double]): TTest

    Permalink

    Given the paired arrays x and y, test if they have significantly different means.

    Given the paired arrays x and y, test if they have significantly different means. Small values of p-value indicate that the two arrays have significantly different means.

  101. def ttest(x: Array[Double], mean: Double): TTest

    Permalink

    Independent one-sample t-test whether the mean of a normally distributed population has a value specified in a null hypothesis.

    Independent one-sample t-test whether the mean of a normally distributed population has a value specified in a null hypothesis. Small values of p-value indicate that the array has significantly different mean.

  102. def ttest2(x: Array[Double], y: Array[Double], equalVariance: Boolean = false): TTest

    Permalink

    Test if the arrays x and y have significantly different means.

    Test if the arrays x and y have significantly different means. Small values of p-value indicate that the two arrays have significantly different means.

    equalVariance

    true if the data arrays are assumed to be drawn from populations with the same true variance. Otherwise, The data arrays are allowed to be drawn from populations with unequal variances.

  103. implicit def vectorExpression2Array(exp: VectorExpression): Array[Double]

    Permalink
  104. def zeros(m: Int, n: Int): Matrix

    Permalink

    Returns an m-by-n zero matrix.

  105. def zeros(n: Int): Matrix

    Permalink

    Returns an n-by-n zero matrix.

Inherited from AnyRef

Inherited from Any

Ungrouped